From 79f1d28fcd589c89402c3d95d2240fab59573b25 Mon Sep 17 00:00:00 2001 From: Cambridge Yang Date: Sun, 24 May 2026 22:32:09 -0400 Subject: [PATCH] docs: render math in Jupyter notebooks (MathJax dollar delimiters) The MathJax config only processed pymdownx.arithmatex spans (\(...\) on .md pages). mkdocs-jupyter emits notebook markdown math as raw $...$, which was neither delimited nor allowed to be processed, so it showed as literal text. Accept both delimiter styles (\(...\)/\[...\] for arithmatex, $...$/$$...$$ for notebooks) and drop the arithmatex-only processHtmlClass restriction so MathJax scans the whole page (it still skips
/, so $ in code is
untouched). Both .md and notebook math now render.
---
 docs/javascripts/mathjax.js | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/docs/javascripts/mathjax.js b/docs/javascripts/mathjax.js
index a3e7521..77471dc 100644
--- a/docs/javascripts/mathjax.js
+++ b/docs/javascripts/mathjax.js
@@ -1,15 +1,16 @@
-// MathJax config for Material for MkDocs + pymdownx.arithmatex (generic mode).
+// MathJax config covering both rendering paths on this site:
+//   - Markdown pages via pymdownx.arithmatex (generic): math arrives as
+//     \(...\) / \[...\] inside `arithmatex` spans.
+//   - Jupyter notebooks via mkdocs-jupyter: math arrives as raw $...$ / $$...$$.
+// So we accept both delimiter styles and let MathJax scan the whole page (it
+// skips 
//