Skip to content

Commit 55dcd2e

Browse files
authored
Merge pull request #9 from thisiscam/fix-notebook-mathjax
docs: render math in Jupyter notebooks (MathJax $ delimiters)
2 parents 9288e6f + 79f1d28 commit 55dcd2e

1 file changed

Lines changed: 8 additions & 7 deletions

File tree

‎docs/javascripts/mathjax.js‎

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
1-
// MathJax config for Material for MkDocs + pymdownx.arithmatex (generic mode).
1+
// MathJax config covering both rendering paths on this site:
2+
// - Markdown pages via pymdownx.arithmatex (generic): math arrives as
3+
// \(...\) / \[...\] inside `arithmatex` spans.
4+
// - Jupyter notebooks via mkdocs-jupyter: math arrives as raw $...$ / $$...$$.
5+
// So we accept both delimiter styles and let MathJax scan the whole page (it
6+
// skips <pre>/<code>/<script> by default, so $ in code is untouched).
27
window.MathJax = {
38
tex: {
4-
inlineMath: [["\\(", "\\)"]],
5-
displayMath: [["\\[", "\\]"]],
9+
inlineMath: [["\\(", "\\)"], ["$", "$"]],
10+
displayMath: [["\\[", "\\]"], ["$$", "$$"]],
611
processEscapes: true,
712
processEnvironments: true,
813
},
9-
options: {
10-
ignoreHtmlClass: ".*|",
11-
processHtmlClass: "arithmatex",
12-
},
1314
};
1415

1516
// Re-typeset on Material's instant-navigation page loads.

0 commit comments

Comments
 (0)