diff --git a/javascripts/katex.js b/javascripts/katex.js new file mode 100644 index 000000000..84b165367 --- /dev/null +++ b/javascripts/katex.js @@ -0,0 +1,12 @@ +document$.subscribe(({ body }) => { + + + renderMathInElement(body, { + delimiters: [ + { left: "$$", right: "$$", display: true }, + { left: "$", right: "$", display: true }, + { left: "\\(", right: "\\)", display: false }, + { left: "\\[", right: "\\]", display: false } + ], + }) +}) diff --git a/mkdocs/mkdocs.yml b/mkdocs/mkdocs.yml index a76299fdf..82a5a4d60 100644 --- a/mkdocs/mkdocs.yml +++ b/mkdocs/mkdocs.yml @@ -60,4 +60,13 @@ markdown_extensions: - pymdownx.superfences - pymdownx.tabbed: alternate_style: true + - pymdownx.arithmatex: + generic: true +extra_javascript: + - javascripts/katex.js + - https://unpkg.com/katex@0/dist/katex.min.js + - https://unpkg.com/katex@0/dist/contrib/auto-render.min.js + +extra_css: + - https://unpkg.com/katex@0/dist/katex.min.css