From 6b7a5d845a2af59f62279f283982d63ecc04f45e Mon Sep 17 00:00:00 2001 From: hyandt Date: Thu, 3 Oct 2024 13:10:14 -0600 Subject: [PATCH] add math support --- docs/javascripts/mathjax.js | 20 ++++++++++++++++++++ mkdocs.yml | 5 +++++ 2 files changed, 25 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 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