1// MathJax config expected by pymdownx.arithmatex (generic mode). 2// 3// CRITICAL: only set window.MathJax if it isn't already defined. Material's 4// instant-nav re-executes <body> scripts on every page swap, which means 5// this file runs again â and unconditionally assigning 6// `window.MathJax = {tex, options}` would overwrite the live library 7// (with its typesetPromise / startup / etc.) with a stub config object, 8// silently breaking every subsequent re-typeset. The math on the first 9// page renders because MathJax completes its initial typeset *before* 10// the post-load instant-nav clobber; click any link and the new page's 11// arithmatex spans stay as raw `\(...\)` text. 12if (!window.MathJax) { 13 window.MathJax = { 14 tex: { 15 inlineMath: [["\\(", "\\)"]], 16 displayMath: [["\\[", "\\]"]], 17 processEscapes: true, 18 processEnvironments: true 19 }, 20 options: { 21 ignoreHtmlClass: ".*|", 22 processHtmlClass: "arithmatex" 23 } 24 }; 25} 26 27// Belt-and-suspenders typeset boot. typesetPromise is idempotent over 28// already-rendered output, so calling it twice on the same page is 29// harmless. The DOMContentLoaded path covers direct loads where the 30// MathJax library hasn't quite finished setup by the time document$ 31// would normally have emitted; document$.subscribe covers Material's 32// instant-nav swaps where DOMContentLoaded does NOT re-fire. 33function typesetMath() { 34 if (window.MathJax && MathJax.typesetPromise) { 35 MathJax.typesetPromise(); 36 } 37} 38if (document.readyState === "loading") { 39 document.addEventListener("DOMContentLoaded", typesetMath); 40} else { 41 typesetMath(); 42} 43if (typeof document$ !== "undefined" && document$.subscribe) { 44 document$.subscribe(typesetMath); 45}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.