# reverse function of latex()

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) ?

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.)you could try this one (i haven't) : https://github.com/augustt198/latex2s...