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

ASCIIMath2Tex frac error #15

Open
SPRCSY opened this issue Jul 9, 2023 · 0 comments
Open

ASCIIMath2Tex frac error #15

SPRCSY opened this issue Jul 9, 2023 · 0 comments

Comments

@SPRCSY
Copy link

SPRCSY commented Jul 9, 2023

when running unit test

parser = ASCIIMath2Tex(log=False)
s = parser.translate("f(x)/g(x)")
self.assertEqual(s,r"$\frac{f(x)}{g(x)}$")

it outputs

======================================================================
FAIL: test_asciimath2tex_ok_10 (__main__.TestASCIIMath2Tex.test_asciimath2tex_ok_10)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "e:\Folder\py_asciimath\tests\test_ASCIIMath2Tex.py", line 119, in test_asciimath2tex_ok_10
    self.assertEqual(s,r"$\frac{f(x)}{g(x)}$")
AssertionError: '$f \\frac{x}{g} \\left(x\\right)$' != '$\\frac{f(x)}{g(x)}$'
- $f \frac{x}{g} \left(x\right)$
+ $\frac{f(x)}{g(x)}$

Mathjax, who renders asciimath formula, will treat $f$ and $g$ as a function symbol like $\sin$, will render f(x)/g(x) to the view $\frac{f(x)}{g(x)}$. I hope it can be fixed.

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

1 participant