How to write LaTeX in IPython Notebook?

任何人都可以分享方式,如何在IPython Notebook中编写LaTeX代码?


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


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^{2pi i k} dx'))


Use $$ if you want your math to appear in a single line, eg,

$$a = b + c$$ (line break after the equation)

If you don't need a line break after the math, use single dollar sign $, eg,

$a = b + c$   (no line break after the equation)
链接地址: http://www.djcxy.com/p/68938.html

上一篇: 语法突出显示在ipython控制台中

下一篇: 如何在IPython Notebook中编写LaTeX?