How to write LaTeX in IPython Notebook?

KostasA picture KostasA · Nov 3, 2012 · Viewed 331.9k times · Source

How can I display LaTeX code in a IPython Notebook?

Answer

minrk picture minrk · Nov 4, 2012

IPython notebook uses MathJax to render LaTeX inside html/markdown. Just put your LaTeX math inside $$.

$$c = \sqrt{a^2 + b^2}$$

sqrt

Or you can display LaTeX / Math output from Python, as seen towards the end of the notebook tour:

from IPython.display import display, Math, Latex
display(Math(r'F(k) = \int_{-\infty}^{\infty} f(x) e^{2\pi i k} dx'))

integral