Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions docs/javascripts/mathjax.js
Original file line number Diff line number Diff line change
@@ -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();
});
}
Loading