From ac07362535f759a308df811e3498bb75728751fd Mon Sep 17 00:00:00 2001 From: Yan Lin Date: Thu, 15 May 2025 22:46:36 +0200 Subject: [PATCH] Add nix shell config --- dist/blog/html/multi-modal-transformer.html | 38 +++++--- dist/blog/html/one-step-diffusion-models.html | 93 ++++++++++++------- dist/blog/template.html | 15 +++ requirements.txt | 4 +- shell.nix | 17 ++++ 5 files changed, 120 insertions(+), 47 deletions(-) create mode 100644 shell.nix diff --git a/dist/blog/html/multi-modal-transformer.html b/dist/blog/html/multi-modal-transformer.html index 42dc413..32cc058 100644 --- a/dist/blog/html/multi-modal-transformer.html +++ b/dist/blog/html/multi-modal-transformer.html @@ -21,6 +21,21 @@ processHtmlClass: 'arithmatex' } }; + + window.addEventListener('load', function() { + document.querySelectorAll('script[type^="math/tex"]').forEach(function(script) { + const isDisplay = script.type.includes('mode=display'); + const math = script.textContent; + const span = document.createElement('span'); + span.className = isDisplay ? 'mathjax-block' : 'mathjax-inline'; + span.innerHTML = isDisplay ? `\\[${math}\\]` : `\\(${math}\\)`; + script.parentNode.replaceChild(span, script); + }); + + if (typeof MathJax !== 'undefined' && MathJax.typesetPromise) { + MathJax.typesetPromise(); + } + });