That is correct an output (repr
escape some characters, \
in this case.). Try to print it.
>>> x = '\\frac{\\alpha}{x}'
>>> x
'\\frac{\\alpha}{x}'
>>> print(x)
\frac{\alpha}{x}
Question
from sympy import *
x, alpha = symbols('x alpha')
latex(alpha/x)
Out[1]: '\\frac{\\alpha}{x}'
That doesn't work in latex. What do I do to get the proper output, i.e.: '\frac{\alpha}{x}' ?
La solution
That is correct an output (repr
escape some characters, \
in this case.). Try to print it.
>>> x = '\\frac{\\alpha}{x}'
>>> x
'\\frac{\\alpha}{x}'
>>> print(x)
\frac{\alpha}{x}
Autres conseils
Got it!
Write:
print latex(alpha/x)
\frac{\alpha}{x}
Sorry about bothering you guys!