Tagging a weird equation

30 views
Skip to first unread message

Michael Boudreau

unread,
Jul 16, 2025, 5:38:54 PMJul 16
to MathJax Users
Hello,

I realize this is not a forum for how-to-tag-something-in-MathML, but I'm wondering if someone here can point me toward such a forum or resource?

I'm looking for MathML help because we've received an article for publication that includes a formula that the author rendered (using LaTeX) like this:

Screenshot 2025-07-16 at 4.32.30 PM.png

Our tagging vendor says they don't know how to get the right-harpoon-over-left-harpoon with the curly arrows in MathML, and their attempt to produce something close causes our Arbortext Editor installation to crash (though Oxygen XML Editor renders it--the screenshot above is from Oxygen).

Can anyone recommend a resource for tricky MathML problems, or do we need to go back to the author and ask "Can you show this formula a different way?"

--Michael Boudreau
The University of Chicago Press

Davide Cervone

unread,
Jul 17, 2025, 4:28:13 PMJul 17
to mathja...@googlegroups.com
I'm pretty sure you are not going to be able to do this reliably in MathML.  One thing you don't mention is where the output will be used in the end.  Is this for a print-based publishing pipeline, or will it end up one the web?  And if on the web, will you be relying on the browser's native MathML-Core implementation, or will it use MathJax or something similar to do the rendering?

I can see some terrible hacks that could get you something close to this, but they would rely on mis-using some symbols, like using U+25DF (LOWER LEFT QUADRANT CIRCULAR ARC) for the curve below the top N and shifting things around to get the placement to work.  But if you are doing this for print, you would have to verify that that character is available, and there is no guarantee that the positioning needed to get it to look right in Arbortext would be the same as needed by the printer.  If you are going to use it on the web with native MathML rendering, it will have to rely on the characters available on the user's computer, and that will virtually guarantee that you will need different positioning values for different users, so it will be unreliable.  

Indeed, even getting the stretchy left-right harpoons is asking for a lot.  A quick test in Firefox, Safari, and Chrome on MacOS reveals that U+21CC (RIGHTWARDS HARPOON OVER LEFTWARDS HARPOON) doesn't stretch in Safari and Chrome (at least with the fonts I have installed), and is stretched by a horizontal transform that distorts the character beyond usability in Firefox.  So even the basic, unembellished stretchy character is unavailable.  Moreover, there is no unicode character that could be used for the downward curved arrow below the bar, though one might be able to use curve like U+25DC (UPPER LEFT QUADRANT CIRCULAR ARC) and combine it with a triangle to make an arrow head.  But all the positioning will be very fragile, and my experiments across the three browsers mentioned indicate that MathML-Core is not up to the task.

If you are using MathJax to render the result rather than using the browser's native output, you could get a more reliable result across browsers, though it is still pretty fragile.  In this case, you could use some CSS trickery to get the curves using borders with appropriate border-radius settings.  Here is my best effort:

mml-tagging.png
using the following monstrosity:

<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
  <msub>
    <mi>P</mi>
    <mi>S</mi>
  </msub>
  <mspace width=".5em" />
  <munderover align="left">
    <mo stretchy="true">&#x21CC;</mo>
    <mrow>
      <mspace width="0em"/>
      <mpadded voffset="1.06em" depth="-1.06em">
        <munder>
          <munder>
            <mpadded width=".075em" height="-.5em" voffset="-.5em">
              <mspace width="1.5em" height=".8em" 
                style="border-left:1px solid; border-top:1px solid; border-radius:80% 0 0 0 / 100% 0 0 0" />
            </mpadded>
            <mstyle scriptlevel="0">
              <mpadded height="-.55em" style="overflow:hidden">
                <mtext>&#x2193;</mtext>
              </mpadded>
            </mstyle>
          </munder>
          <mstyle scriptlevel="0">
            <msub>
              <mi>N</mi>
              <mi>e</mi>
            </msub>
          </mstyle>
        </munder>
      </mpadded>
      <mstyle scriptlevel="0">
        <mpadded voffset=".15em" depth="-.1em" height="-.1em">
          <mn>1</mn>
          <mo lspace="0" rspace="0">/</mo>
          <mi>h</mi>
        </mpadded>
      </mstyle>
      <mspace width=".2em" />
    </mrow>
    <mrow>
      <mspace width="-.2em" />
      <mpadded voffset="-.53em" height="-.53em">
        <mover align="left">
          <mrow>
            <mspace width=".5em" />
            <mspace width="2em" height="1.2em"
              style="border-left:1px solid; border-bottom:1px solid; border-radius:0 0 0 80%/ 0 0 0 90%" />
          </mrow>
          <mstyle scriptlevel="0">
            <mi>N</mi>
          </mstyle>
        </mover>
      </mpadded>
      <mspace width=".5em" />
      <mpadded voffset="-.15em" height="-.15em">
        <mstyle scriptlevel="0">
        <mi>a</mi>
        </mstyle>
      </mpadded>
      <mspace width=".7em" />
    </mrow>
  </munderover>
  <mspace width=".5em" />
  <msub>
    <mi>P</mi>
    <mi>H</mi>
  </msub>
</math>

I do not recommend that you use this, or even try it out.  It is only for illustration.  The results of this in the browser's native MathML rendering are hopelessly broken.  Even in MathJax, it requires the upcoming v4 release (in order to get the stretchy harpoons), and even then, only works in the CHTML output (as MathJax's SVG output doesn't handle the border-radius CSS styles).

So this is just me being stubborn and seeing how far I can push MathJax.  Do not try this at home.

Davide


On Jul 16, 2025, at 5:38 PM, Michael Boudreau <mrb...@gmail.com> wrote:

Hello,

I realize this is not a forum for how-to-tag-something-in-MathML, but I'm wondering if someone here can point me toward such a forum or resource?

I'm looking for MathML help because we've received an article for publication that includes a formula that the author rendered (using LaTeX) like this:

<Screenshot 2025-07-16 at 4.32.30 PM.png>

Our tagging vendor says they don't know how to get the right-harpoon-over-left-harpoon with the curly arrows in MathML, and their attempt to produce something close causes our Arbortext Editor installation to crash (though Oxygen XML Editor renders it--the screenshot above is from Oxygen).

Can anyone recommend a resource for tricky MathML problems, or do we need to go back to the author and ask "Can you show this formula a different way?"

--Michael Boudreau
The University of Chicago Press


--
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/db7c8137-4328-4303-854b-8939a82ee190n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages