Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some TeXAtoms of class ORD don't get data-mjx-texclass="ORD" in serialized MathML output #2585

Closed
dpvc opened this issue Dec 16, 2020 · 0 comments
Labels
Accepted Issue has been reproduced by MathJax team Fixed Test Needed v3 v3.1
Milestone

Comments

@dpvc
Copy link
Member

dpvc commented Dec 16, 2020

When TeXAtom nodes are created and setProperty('texClass') is NOT called for them, they get texClass of ORD automatically, but that isn't set in the property list, and so it doesn't appear in the serialized MathML output. That means that ORD class can be lost in saving to MathML and reading it back into MathJax. For example, when braces are used in TeX input, they produce a TeXAtom of class ORD of this type.

For example, f{\left(x\right)} currently produces

<math xmlns="http://www.w3.org/1998/Math/MathML">
  <mi>f</mi>
  <mrow>
    <mrow data-mjx-texclass="INNER">
      <mo data-mjx-texclass="OPEN">(</mo>
      <mi>x</mi>
      <mo data-mjx-texclass="CLOSE">)</mo>
    </mrow>
  </mrow>
</math>

and since the outer <mrow> does not include a TeX class, the spacing is that of INNER when this MathML is read into MathJax (but the spacing is ORD when the TeX input is processed).

The serialized MathML should produce

<math xmlns="http://www.w3.org/1998/Math/MathML">
  <mi>f</mi>
  <mrow data-mjx-texclass="ORD">
    <mrow data-mjx-texclass="INNER">
      <mo data-mjx-texclass="OPEN">(</mo>
      <mi>x</mi>
      <mo data-mjx-texclass="CLOSE">)</mo>
    </mrow>
  </mrow>
</math>
dpvc added a commit to mathjax/MathJax-src that referenced this issue Dec 16, 2020
@dpvc dpvc added Accepted Issue has been reproduced by MathJax team and removed Abandoned labels Dec 16, 2020
@dpvc dpvc added this to the 3.1.3 milestone Jan 31, 2021
dpvc added a commit to mathjax/MathJax-src that referenced this issue Mar 8, 2021
Update TeXAtom to save the texClass in the property list, so it appears in MathML output.  (mathjax/MathJax#2585)
@dpvc dpvc added Merged Merged into develop branch Fixed v3.1 and removed Ready for Review Merged Merged into develop branch labels Apr 26, 2021
@dpvc dpvc closed this as completed Apr 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Accepted Issue has been reproduced by MathJax team Fixed Test Needed v3 v3.1
Projects
None yet
Development

No branches or pull requests

1 participant