Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TeX to ASCIImath \frac error #14

Open
Lyudol opened this issue Aug 7, 2022 · 1 comment
Open

TeX to ASCIImath \frac error #14

Lyudol opened this issue Aug 7, 2022 · 1 comment

Comments

@Lyudol
Copy link

Lyudol commented Aug 7, 2022

When running this code:

from py_asciimath.translator.translator import (
    ASCIIMath2MathML,
    ASCIIMath2Tex,
    MathML2Tex,
    Tex2ASCIIMath
)

latex_input = r"\frac{3}{2^4}"
tex2asciimath = Tex2ASCIIMath(log=False, inplace=True)
parsed = tex2asciimath.translate(latex_input, from_file=False, pprint=False,)
print(parsed)

prints this:

frac(3)((2)^(4))

when it's meant to print:

(3)/(2^4)

Is there something wrong with how the LaTeX equation is being input or is it a bug?

@belerico
Copy link
Owner

Hi @Lyudol and sorry for the late response. It's been a long since i haven't done something on this repo 🥲. I don't think there's a bug in there, i think that is not optimized to reduce the unneeded parentheses; but, for the reason above, i can also be wrong.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants