From 3702b2c2c2bef2467cf07d5b079e340c0fdbae45 Mon Sep 17 00:00:00 2001 From: Andre Maia Chagas Date: Tue, 24 Oct 2023 11:44:39 +0100 Subject: [PATCH] try to add formula support --- docs/javascripts/Mathjax.js | 16 ++++++++++++++++ mkdocs.yml | 5 +++++ 2 files changed, 21 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 0000000..0f4b6e6 --- /dev/null +++ b/docs/javascripts/Mathjax.js @@ -0,0 +1,16 @@ +window.MathJax = { + tex: { + inlineMath: [["\\(", "\\)"]], + displayMath: [["\\[", "\\]"]], + processEscapes: true, + processEnvironments: true + }, + options: { + ignoreHtmlClass: ".*|", + processHtmlClass: "arithmatex" + } + }; + + document$.subscribe(() => { + MathJax.typesetPromise() + }) \ No newline at end of file diff --git a/mkdocs.yml b/mkdocs.yml index 0e18b35..56e8e86 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -38,6 +38,11 @@ theme: extra_javascript: - https://cdnjs.cloudflare.com/ajax/libs/tablesort/5.2.1/tablesort.min.js - javascripts/tables.js + #math formulas + - javascripts/mathjax.js + - https://polyfill.io/v3/polyfill.min.js?features=es6 + - https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js + plugins: - search