diff --git a/docs/javascripts/mathjax.js b/docs/javascripts/mathjax.js new file mode 100644 index 000000000..a697f59c7 --- /dev/null +++ b/docs/javascripts/mathjax.js @@ -0,0 +1,20 @@ +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() +}) + diff --git a/mkdocs.yml b/mkdocs.yml index a789c5f9a..75aa954d7 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -192,6 +192,8 @@ theme: markdown_extensions: - toc: permalink: "#" + - pymdownx.arithmatex: + generic: true - admonition - attr_list - meta @@ -204,6 +206,9 @@ extra: property: UA-189117140-2 extra_css: - stylesheets/extra.css +extra_javascript: + - javascripts/mathjax.js + - https://unpkg.com/mathjax@3/es5/tex-mml-chtml.js site_name: NREL HPC repo_url: https://github.com/NREL/HPC/tree/gh-pages repo_name: NREL/HPC