phfaist / pylatexenc

Simple LaTeX parser providing latex-to-unicode and unicode-to-latex conversion
https://pylatexenc.readthedocs.io
MIT License
283 stars 35 forks source link

problem with ensuremath construct #100

Open fiolj opened 10 months ago

fiolj commented 10 months ago

Hi, pylatexenc 2.10 is failing with the construct:

LatexNodes2Text().latex_to_text(unicode_to_latex(LatexNodes2Text().latex_to_text(r"$\pm$")))

giving empty strings. The conversion:

`LatexNodes2Text().latex_to_text(r"$\pm$")`

gives the expected result: '±'

and the conversion to latex: unicode_to_latex('±') seems to be ok also: '\\ensuremath{\\pm}'

but the last conversion: LatexNodes2Text().latex_to_text('\\ensuremath{\\pm}') fails, producing the empty string