svenkreiss / unicodeit

Converts LaTeX tags to unicode: \mathcal{H} → ℋ. Available on the web or as Automator script for the Mac.
https://www.unicodeit.net
Other
275 stars 35 forks source link

Superscripts are not grouped by {...} #37

Closed schneiderfelipe closed 3 years ago

schneiderfelipe commented 3 years ago

Hi, I observed that ^{...} does not behave as I would expect in LaTeX:

import unicodeit

print(unicodeit.replace("cm^{-1}"))
# => cm^{−1}

print(unicodeit.replace("cm^-^1"))
# => cm⁻¹

Is this expected? unicodeit.net seems to interpret ^{...} just fine.

Is there a way I can make this work in Python? Thanks!

svenkreiss commented 3 years ago

Thanks for reporting @schneiderfelipe . It should be fixed in the next release.