reverse function of latex()

asked 2017-06-06 05:01:17 -0500

ortollj gravatar image

Hi imagine I got this Latex expression from wikipedia: z_k = 2 \sqrt{\frac{-p}3} \cos{\left(\frac13\arccos{\left(\frac{-q}2\sqrt{\frac{27}{-p^3}}\right)}+ \frac{2k\pi}3\right)}\qquad\mbox{ avec }\qquad k\in{0,1,2}

is there a reverse function kind of retro-latex(z_k = 2 \sqrt{\frac{-p}3} \cos{\left(\frac13\arccos{\left(\frac{-q}2\sqrt{\frac{27}{-p^3}}\right)}+ \frac{2k\pi}3\right)}\qquad\mbox{ avec }\qquad k\in{0,1,2}) which will gives me the expression in classical form (not in Latex) ?

edit retag flag offensive close merge delete


The expression $$ z_k = 2 \sqrt{\frac{-p}3} \cos\left( \frac13\arccos\left(\frac{-q}2\sqrt{\frac{27}{-p^3}}\right) + \frac{2k\pi}3\right) $$ (with $k\in {0,1,2}$) is not too long. Typing with bare hands should be please enough in this case. (It is really hard to parse such a thing. Python does not have latex( myExpression ) . Then sage makes us a present, providing latex. But its reverse engineering... i.e. parse spaces, the superfluous brackets, function names, (sums and products with variables running "implicitly"), and prepositions in all languages in latex expressions taken from all possible wiki or article latex expressions... This is really too much for a rather small community.)

dan_fulea gravatar imagedan_fulea ( 2017-06-06 12:25:18 -0500 )edit

you could try this one (i haven't) :

mforets gravatar imagemforets ( 2017-06-17 03:43:21 -0500 )edit