ianharrigan / mathmlformula

Automatically exported from code.google.com/p/mathmlformula
1 stars 0 forks source link

ConvertFromMathMLToLatex produces invalid latex for unicode characters #96

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
I hope this is the right place to report bugs to the java-library - Clicking 
"Bugs or need new features?" in the Java section of the website got me here.

Calling

ConvertFromMathMLToLatex.convertToLatex(
"<math><mrow><mo>∀</mo><mi>x</mi><mo>:</mo><mi>x</mi></mrow></math>");

returns "\\forallx: x"
instead of "\\forall x: x"

"\forallx" is invalid latex.

What version of the product are you using?
latest (2.0)

Thank you for the great library ;)

Original issue reported on code.google.com by johannes...@gmail.com on 2 Jun 2015 at 3:18

Attachments:

GoogleCodeExporter commented 8 years ago

Original comment by ionel.alexandru@gmail.com on 2 Jun 2015 at 3:33

GoogleCodeExporter commented 8 years ago
Just as a side note, there is a simple workaround.
Variables can be wrapped in {} to produce valid latex like this:

String mathML = ...
mathML = mathML.replace("<mi>", "<mi>{").replace("</mi>", "}</mi>");
then convert to latex

Original comment by johannes...@gmail.com on 2 Jun 2015 at 5:19