viktorstrate / algebra-latex

Parse and calculate latex formatted math
https://www.npmjs.com/package/algebra-latex
MIT License
28 stars 9 forks source link

issue with operators #14

Closed Porizm closed 3 years ago

Porizm commented 3 years ago

Hello,

I am struggling with plus and minus operators

"x + 1" is giving tex "x+1"

But "x +- 1" is giving tex "x+-1"

and "x -- 1" is giving tex "x--1"

is there a way to remove the extra operator after using toLatex ?

Thank you in advance

viktorstrate commented 3 years ago

x +- 1 will be parsed as x + (-1), I guess the formatter could be improved by adding the explicit parenthesis