Skip to content

Commit

Permalink
Enable proper math
Browse files Browse the repository at this point in the history
  • Loading branch information
kastnerp committed Dec 10, 2024
1 parent e299f96 commit 948fed5
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 2 deletions.
19 changes: 19 additions & 0 deletions docs/javascripts/mathjax.js
Original file line number Diff line number Diff line change
@@ -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()
})
10 changes: 8 additions & 2 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,16 @@ extra:
link: https://orcid.org/0000-0003-4940-341X

extra_javascript:
- https://unpkg.com/[email protected]/dist/tablesort.min.js
- javascripts/tablesort.js
- https://unpkg.com/[email protected]/dist/tablesort.min.js
# Display math
- javascripts/mathjax.js
- https://unpkg.com/mathjax@3/es5/tex-mml-chtml.js

markdown_extensions:
# Display math
- pymdownx.arithmatex:
generic: true
- admonition
- pymdownx.caret
- pymdownx.mark
Expand Down Expand Up @@ -182,7 +188,7 @@ plugins:

- multirepo:
# (optional) tells multirepo to cleanup the temporary directory after site is built.
cleanup: true
cleanup: false
# if set the docs directory will not be removed when importing docs. When using this with a nav section in an imported repo
# you must keep the docs directory in the path (e.g., docs/path/to/file.md).
keep_docs_dir: true
Expand Down

0 comments on commit 948fed5

Please sign in to comment.