Page MenuHomePhabricator

Too much space in <math>\mathrm{d}x</math> with MathML
Open, Needs TriagePublicBUG REPORT

Description

Enable "MathML (experimental; no images)" in Special:Preferences → Apperance → Math. Then preview a page with the contents <math>\mathrm{d}x</math>.

This renders like d x in Firefox but it should render like dx (without space), which is also how it looks with client-side MathJax. \mathrm{d}x is commonly encountered in differential equations and integrals.

This is the MathML generated:

<math xmlns="http://www.w3.org/1998/Math/MathML" class="mwe-math-element mwe-math-element-inline">
  <mrow data-mjx-texclass="ORD">
    <mstyle displaystyle="true" scriptlevel="0">
      <mrow data-mjx-texclass="ORD">
        <mi mathvariant="normal">d</mi>
      </mrow>
      <mi>x</mi>
    </mstyle>
  </mrow>
</math>

https://temml.org/ uses mpadded instead of mrow, which achieves the desired result.

https://latexml.mathweb.org/editor generates

<mrow><mi mathvariant="normal">d</mi><mo>⁢</mo><mi>x</mi></mrow>

which also suffers from too much spacing.

A workaround is to use \text{d}x instead but this generates an mtext element, which is semantically wrong for the differential dx.