How can I display LaTeX code in a IPython Notebook?
One of the most popular is Jupyter Notebook that uses MathJax to render the Latex syntax inside the markdown/HTML. To use LaTeX in the Jupyter notebook, put the Latex math content inside the '$ … $' double '$$ … $$' symbols.
Simply Enter Esc and type m it will convert to text cell.
LaTeX is a typesetting language for producing scientific documents. We introduce a very small part of the language for writing mathematical notation. Jupyter notebook recognizes LaTeX code written in markdown cells and renders the symbols in the browser using the MathJax JavaScript library.
Mathematical formulaWe can use LaTeX to write mathematical equations in Markdown. To write inline LaTeX formula use a single $ before and after the equation and use a double $ to display equations.
IPython notebook uses MathJax to render LaTeX inside html/markdown. Just put your LaTeX math inside $$
.
$$c = \sqrt{a^2 + b^2}$$
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'))
This came up in a search I was just doing, found a better solution with some more searching, IPython notebooks now have a %%latex
magic that makes the whole cell Latex without the $$
wrapper for each line.
Refer notebook tour for Rich Display System
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