MathJax.tex2mmlPromise in pageReady()

2 views
Skip to first unread message

Alex Jordan

unread,
Dec 21, 2025, 1:11:10 AM (yesterday) Dec 21
to MathJax Users
At this sample page:

I have taken PreTeXt's sample article and I'm trying to adjust it to load math macros in a different way than what PreTeXt has always done (which is to load them inside math delimiters somewhere early in the page). There's a lot going on in this page for all that PreTeXt does, and the only part I have modified is that I've inserted lines 93-107:

MathJax.tex2mmlPromise(String.raw`
...a bunch of tex commands defining macros...
`);

I'm getting an error in the console:
Uncaught (in promise) TypeError: l.item.renderMath is not a function

and the page is clearly not succeeding to load the macros being defined here. This is with MathJax3. But also PreTeXt has a flag to try using MathJax4, and when I try that with the same changes, I get a similar error, just with a different name on some indexed variable:
Uncaught (in promise) TypeError: i.item.renderMath is not a function

Is it easy to see what I'm doing wrong here?
Reply all
Reply to author
Forward
0 new messages