From 151ce422969a381527b01717d3f9333b5a89a91a Mon Sep 17 00:00:00 2001 From: Ju-yeong Ji Date: Wed, 21 Oct 2026 14:49:30 +0900 Subject: [PATCH] add missing mathjax.js --- docs/javascripts/mathjax.js | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 docs/javascripts/mathjax.js diff --git a/docs/javascripts/mathjax.js b/docs/javascripts/mathjax.js new file mode 100644 index 0000000..8276464 --- /dev/null +++ b/docs/javascripts/mathjax.js @@ -0,0 +1,27 @@ +// MathJax configuration for pymdownx.arithmatex (generic mode). +// Must load BEFORE the MathJax library (see extra_javascript in zensical.toml). +window.MathJax = { + tex: { + inlineMath: [["\\(", "\\)"]], + displayMath: [["\\[", "\\]"]], + processEscapes: true, + processEnvironments: true, + }, + options: { + ignoreHtmlClass: ".*|", + processHtmlClass: "arithmatex", + }, +}; + +// With navigation.instant, pages are swapped in without a full reload, so +// MathJax's startup typeset never sees the new content. Re-typeset on every +// page change emitted by the theme's document$ observable. +if (window.document$ && typeof window.document$.subscribe === "function") { + window.document$.subscribe(() => { + if (!window.MathJax || !MathJax.startup || !MathJax.typesetPromise) return; + MathJax.startup.output.clearCache(); + MathJax.typesetClear(); + MathJax.texReset(); + MathJax.typesetPromise(); + }); +}