asnunes / mathml-to-latex

A JavaScript tool to convert mathml string to LaTeX equation string.
MIT License
51 stars 14 forks source link

Missing spaces after commands lead to invalid LaTex commands #5

Closed muelphil closed 3 years ago

muelphil commented 3 years ago

Using MathJax to generate MathML for the asciimath string a=>b gives

<math xmlns="http://www.w3.org/1998/Math/MathML">
  <mstyle displaystyle="true">
    <mi>a</mi>
    <mo>&#x21D2;</mo>
    <mi>b</mi>
  </mstyle>
</math>"

Using convert yields a\Rightarrowb, resulting in an invalid Latex command, because there is no space inserted after \Rightarrow.

asnunes commented 3 years ago

Hello, @muelphil.

You are right, It should be adding a space after that command. I released a new version on PR #6 that fix this problem. It is not happening anymore on version v1.1.0 that is now available on npm.

Thank you for your report!