-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Dealing with Infinity in parse #1842
Description
The math.parse feature is very helpful in converting a math expression or a matrix into TeX.
I have one suggestion and one doubt regarding this feature.
Scenario: I want to perform some math operation and display the output in TeX.
let a = math.matrix([1,2,3,4]);
let b = math.divide(a,0);
let c = b.toString();
let d = math.parse(c);
let texOut = d.toTex();Suggestion:
The output is "\begin{bmatrix}Infinity\\Infinity\\Infinity\\Infinity\\\end{bmatrix}". However replacing Infinity with \infty is more appropriate.
Doubt:
Also, I am not sure if I am correctly using the last step. Because: math variable b is converted to string and then math.parse is applied. Is there any command to obtain TeX directly from b instead of converting it into a string and then back into a math.js object?
PS: In the math.js example here.
So, I think math.evaluate and math.parse part their ways here in understanding the input string.
Thank you.

