MathJax 4 - problem with <mtext> in <mmultiscript> argument or just bad MathML?

15 views
Skip to first unread message

Mark Doyle

unread,
Sep 8, 2025, 3:30:21 PM (7 days ago) Sep 8
to mathja...@googlegroups.com
Hi,

I am a bit rusty in MathML and MathJax. At the MathJax demo site (https://www.mathjax.org/#demo), MathJax renders this snippet containing an <mtext> tag for the hyphen in "58-61" as a subscript, but it should be a superscript:

<math><mmultiscripts><mi>Cu</mi><none/><mo>*</mo><mprescripts/><none/><mrow><mn>58</mn><mtext>–</mtext><mn>61</mn></mrow></mmultiscripts></math>

But changing the <mtext> tag to an <mo> tag works as expected:

<math><mmultiscripts><mi>Cu</mi><none/><mo>*</mo><mprescripts/><none/><mrow><mn>58</mn><mo>–</mo><mn>61</mn></mrow></mmultiscripts></math>

Is using <mtext> in this context incorrect or is this a MathJax 4 bug? Note this code comes from a production vendor for one of journals and works properly in their PDF formatter. That doesn't mean it is correct, of course! Thanks for any insights!

Best,
Mark

Davide Cervone

unread,
Sep 8, 2025, 4:58:39 PM (7 days ago) Sep 8
to mathja...@googlegroups.com
Mark:

It looks like the semantic enrichment is adding <none> elements into the expression (for some reason) and the parity is off, moving the superscript to a subscript.  I'll make an issue for this, and will look into what it going wrong.

I think <mtext> is a reasonable thing to use, here, but substituting <mo lspace="0" rspace="0"> seems like a good workaround for now.

Davide


--
You received this message because you are subscribed to the Google Groups "MathJax Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mathjax-user...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/mathjax-users/CAEAsKFsPwuPgg0jAYjpdvB2eybWHahwn0nEJ3UW6LOQDH-srXw%40mail.gmail.com.

Mark Doyle

unread,
Sep 8, 2025, 6:17:09 PM (7 days ago) Sep 8
to MathJax Users
Thanks, Davide, for the quick reply! We'll use the workaround until the issue can be resolved.

Best,
Mark

Reply all
Reply to author
Forward
0 new messages