Skip to content
This repository has been archived by the owner on May 2, 2020. It is now read-only.

fix undefined symbols problem #7

Open
hiamandeep opened this issue Mar 20, 2016 · 1 comment
Open

fix undefined symbols problem #7

hiamandeep opened this issue Mar 20, 2016 · 1 comment

Comments

@hiamandeep
Copy link
Contributor

pm is used to show plus-minus, is yet not implemented into sympy. #5305
Example latex: \frac{-b\pm\sqrt{b^2-4ac}}{2a}
when converted into sympy using latex2sympy, I get
-b*pm*sqrt(-4*a*c + b**2)/(2*a)

So, the undefined pm simply gets multiplied. Hence getting wrong expression.
It should have probably shown an error.

In fact, any undefined thing simply gets multiplied
Ex: -b*pm*blabla*(-4*a*c + b**2)/(2*a)

@augustt198
Copy link
Owner

Maybe \pm should be blacklisted as an invalid symbol because it produces such an unexpected result.

In regards to \blabla or something like that, I don't think it's a good idea to have a whitelist of valid symbols because it would be hard to account for the variety of symbols that people would want to use.

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

No branches or pull requests

2 participants