diff --git a/docs/javascripts/mathjax.js b/docs/javascripts/mathjax.js new file mode 100644 index 00000000..ee3e6eb5 --- /dev/null +++ b/docs/javascripts/mathjax.js @@ -0,0 +1,19 @@ +window.MathJax = { + tex: { + inlineMath: [["\\(", "\\)"]], + displayMath: [["\\[", "\\]"]], + processEscapes: true, + processEnvironments: true + }, + options: { + ignoreHtmlClass: ".*|", + processHtmlClass: "arithmatex" + } +}; + +document$.subscribe(() => { + MathJax.startup.output.clearCache() + MathJax.typesetClear() + MathJax.texReset() + MathJax.typesetPromise() +}) \ No newline at end of file diff --git a/mkdocs.yml b/mkdocs.yml index b4c8a9cf..51788ae8 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -130,6 +130,8 @@ theme: extra_javascript: - 'javascripts/analysis.js' + - 'javascripts/mathjax.js' + - 'https://unpkg.com/mathjax@3/es5/tex-mml-chtml.js' repo_url: https://github.com/west2-online/fzu-run repo_name: west2-online/fzu-run @@ -141,3 +143,5 @@ markdown_extensions: - pymdownx.keys - pymdownx.mark - pymdownx.tilde + - pymdownx.arithmatex: + generic: true