Jupyter Notebook Markdown

Markdown syntax guide for Jupyter Notebooks including LaTeX math and HTML

Jupyter supports standard Markdown plus LaTeX math and HTML. See our Markdown Cheat Sheet for basic syntax.

LaTeX Math

Inline Math

Inline equations

$E = mc^2$

Display Math

Centered equations

$$\sum_{i=1}^{n} x_i$$

Fractions

Fraction notation

$\frac{a}{b}$

Greek Letters

Greek symbols

$\alpha, \beta, \gamma, \theta$

Subscript/Superscript

Sub and super

$x_i^2$ or $x_{i+1}^{n-1}$

Square Root

Roots

$\sqrt{x}$ or $\sqrt[n]{x}$

HTML in Markdown

Colored Text

Custom colors

<span style="color:red">Red text</span>

Centered Text

Center alignment

<center>Centered text</center>

Image Size

Sized images

<img src="img.png" width="300"/>

Line Break

Force line break

<br>

Advanced Formatting

Internal Link

Link to heading

[Link to section](#section-name)

Alert Box

Info boxes

<div class="alert alert-info">Info message</div>

Collapsible

Expandable section

<details><summary>Title</summary>Hidden content</details>

Magic Commands

%matplotlib inlineDisplay plots inline
%load_ext autoreloadEnable autoreload extension
%timeitTime a single statement
%%timeTime entire cell
%%writefile filenameWrite cell to file
%%bashRun cell as bash script
%%htmlRender cell as HTML
%%latexRender cell as LaTeX

Keyboard Shortcuts

Esc + MConvert cell to Markdown
Esc + YConvert cell to Code
Shift + EnterRun cell and select below
Ctrl + EnterRun cell
Esc + AInsert cell above
Esc + BInsert cell below
Esc + D, DDelete cell

Related Cheat Sheets