Skip to content

Commit 41a782f

Browse files
committed
switch to pymdownx.arithmatex for MathJax as per https://squidfunk.github.io/mkdocs-material/reference/math
1 parent 0a58fbb commit 41a782f

File tree

2 files changed

+32
-3
lines changed

2 files changed

+32
-3
lines changed

MDhelp/docs/javascripts/mathjax.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
window.MathJax = {
2+
tex: {
3+
inlineMath: [["\\(", "\\)"]],
4+
displayMath: [["\\[", "\\]"]],
5+
processEscapes: true,
6+
processEnvironments: true
7+
},
8+
options: {
9+
ignoreHtmlClass: ".*|",
10+
processHtmlClass: "arithmatex"
11+
}
12+
};
13+
14+
document$.subscribe(() => {
15+
MathJax.startup.output.clearCache()
16+
MathJax.typesetClear()
17+
MathJax.texReset()
18+
MathJax.typesetPromise()
19+
})

MDhelp/mkdocs.yml_pdf

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,12 +87,22 @@ plugins:
8787
markdown_extensions:
8888
- def_list
8989
- admonition
90-
- mdx_math
90+
# - mdx_math
91+
- pymdownx.arithmatex:
92+
generic: true
93+
tex_inline_wrap: ["$", "$"]
94+
tex_block_wrap: ["$$", "$$"]
9195

92-
extra_javascript:
93-
- https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML
96+
extra_javascript:
97+
- javascripts/mathjax.js
98+
- https://unpkg.com/mathjax@3/es5/tex-mml-chtml.js
99+
100+
101+
#extra_javascript:
102+
# - https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML
94103
# - https://unpkg.com/mathjax@3/es5/tex-mml-chtml.js # MathJax library from CDN
95104

105+
96106
#local build settings from https://www.mkdocs.org/user-guide/deploying-your-docs/#local-files
97107

98108
site_url: ""

0 commit comments

Comments
 (0)