ronkok / Temml

TeX-to-MathML conversion library in JavaScript
https://temml.org/
MIT License
162 stars 12 forks source link

node merging heuristics, for <mn> in the base, like 123^5 #40

Closed hbghlyj closed 11 months ago

hbghlyj commented 11 months ago

Temml separates "123" into two nodes

  <mrow>
    <mn>12</mn>
    <msup>
      <mn>3</mn>
      <mn>5</mn>
    </msup>
  </mrow>

MathJax and LaTeXML and Pandoc treat "123" as a whole base, which can simplify MathML code

  <msup>
    <mn>123</mn>
    <mn>5</mn>
  </msup>
ronkok commented 11 months ago

Hmm... At one point, Temml parsed this expression as you suggest. Then came issue #13. My fix for that issue has created this issue.

I'll look into it. I'm sure it's fixable, but a few days may go by before I get to it.

ronkok commented 11 months ago

@hbghlyj, Your issues are getting more obscure. That's encouraging.

This issue is resolved by release v0.10.19.

hbghlyj commented 10 months ago

@ronkok I found a similar issue with number with a decimal point, for example 12.3 is converted to <mn>12.3</mn> in Temml 12.3^4 is converted to <mn>12</mn><mi>.</mi><msup><mn>3</mn><mn>4</mn></msup> in MathJax and LaTeXML and Pandoc, 12.3^4 is converted to <msup><mn>12.3</mn><mn>4</mn></msup>