How do you get iPython to output results using latex?
For example, like on this page: http://nbviewer.ipython.org/urls/raw.github.com/ipython/ipython/master/examples/notebooks/SymPy%20Examples.ipynb
If I execute the code:
Rational(3,2)*pi + exp(I*x) / (x**2 + y)
I get output:
Out[13]: 3*pi/2 + exp(I*x)/(x**2 + y)
I want to see output in latex as shown in the link above.
An updated answer for those googlers:
from IPython.display import Math
Math('3 \cdot \\frac{\pi}{2} + e^{\\frac{I*x}{x^2 + y}}')
A bit more clumsy than SymPy, but doesn't need an extra package.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With