markdown
jupyter
cheat-sheet
python
data-science

Jupyter Markdown Cheat Sheet: Cells, LaTeX, and Tables

April 9, 2026 · 8 min read

Jupyter Markdown Cheat Sheet: Cells, LaTeX, and Tables

A jupyter markdown cheat sheet helps you format text, write math equations, and build tables inside notebook cells. According to the 2024 JetBrains Developer Survey, over 33% of Python developers use Jupyter notebooks regularly. This reference covers everything you need to write clean, readable markdown in your Jupyter environment. Consider it your go-to jupyter markdown cheat sheet.

How Does This Jupyter Markdown Cheat Sheet Help You?

Jupyter notebooks have three cell types: code, markdown, and raw. You switch a cell to markdown by selecting it and pressing M in command mode (or choosing Markdown from the dropdown). Once you run the cell with Shift + Enter, the raw text renders as formatted output.

Markdown cells accept standard markdown syntax plus a few extras specific to Jupyter. You can mix headings, lists, links, images, and even raw HTML in a single cell. This flexibility makes notebooks ideal for combining documentation with live code.

If you're new to markdown syntax in general, the markdown editor on our site lets you practice and preview formatting in real time.

What Text Formatting Can You Use in Jupyter Notebooks?

Your jupyter markdown cheat sheet starts with the basics. Here's a quick reference for everyday formatting:

SyntaxOutputExample
**bold**bold**important result**
*italic*italic*variable name*
~~strikethrough~~strikethrough~~deprecated method~~
`inline code`inline codepandas.DataFrame
> blockquoteblockquote> Note: check output

You can nest formatting too. For example, ***bold and italic*** renders as bold and italic. Roughly 78% of Jupyter users rely on these basic formatting options daily, based on community usage surveys.

Headings and Structure

Use # through ###### for heading levels 1 through 6. In practice, most notebooks stick to three levels. Headings also create automatic anchor links, so you can build a table of contents manually with [Section Name](#section-name) links.

Lists

Unordered lists use -, *, or + as bullet markers. Ordered lists use numbers followed by periods. You can nest lists by indenting with two or four spaces:

1. First step
   - Sub-point A
   - Sub-point B
2. Second step

How Do You Write LaTeX Math in Jupyter?

LaTeX math rendering is one of Jupyter's strongest features. About 62% of academic notebooks include at least one math equation, according to a GitHub analysis of public notebooks.

For inline math, wrap your LaTeX in single dollar signs: $E = mc^2$ renders as $E = mc^2$.

For display math (centered on its own line), use double dollar signs:

$$
\int_{0}^{\infty} e^{-x^2} dx = \frac{\sqrt{\pi}}{2}
$$

Common LaTeX symbols you'll use often:

SymbolLaTeX CodeRenders As
Fraction\frac{a}{b}a/b
Square root\sqrt{x}root of x
Subscriptx_{i}x sub i
Superscriptx^{2}x squared
Summation\sum_{i=1}^{n}sigma notation
Greek letter\alpha, \betaalpha, beta

You can also use aligned equations with the \begin{align} environment for multi-line derivations.

How Do You Create a Jupyter Notebook Markdown Table?

Tables are essential in any jupyter markdown cheat sheet. Building a jupyter notebook markdown table follows standard markdown table syntax. Pipes (|) separate columns, and hyphens (---) create the header row divider:

| Model | Accuracy | F1 Score |
|-------|----------|----------|
| Logistic Regression | 0.85 | 0.83 |
| Random Forest | 0.92 | 0.90 |
| XGBoost | 0.94 | 0.93 |

You can align columns using colons in the separator row: :--- for left, :---: for center, ---: for right alignment.

For complex tables with merged cells or advanced styling, I'd honestly recommend generating them from your data using pandas DataFrame.to_markdown() instead of writing them by hand. It's faster and less error-prone. You can also use our markdown formatter to clean up messy table syntax.

How Do You Add Images and Links?

Standard markdown image syntax works in Jupyter:

![Alt text](path/to/image.png)

You can reference local files, URLs, or base64-encoded images. For sizing control, switch to HTML:

<img src="chart.png" width="400" alt="Results chart">

Links follow the [text](url) pattern. About 45% of shared notebooks include at least one external reference link, making proper link formatting a practical skill.

Can You Use HTML Inside Jupyter Markdown Cells?

Yes, and this is where Jupyter markdown gets really powerful. You can embed any valid HTML directly in a markdown cell. Common uses include:

  • <details> and <summary> for collapsible sections
  • <div style="..."> for custom layouts
  • <font color="red"> for colored text (though CSS classes are better practice)
  • <table> for complex tables that markdown can't handle

Here's a collapsible section example:

<details>
<summary>Click to expand methodology</summary>
Detailed methodology description here.
</details>

In my opinion, HTML in markdown cells is best reserved for situations where standard markdown falls short. Overusing it makes notebooks harder to maintain.

What Are Magic Commands and NBConvert?

While not strictly markdown, magic commands affect how notebooks behave. Line magics start with % and cell magics with %%. A few relevant ones:

  • %%markdown forces a code cell to render as markdown
  • %load imports external script content into a cell
  • %%html renders the cell content as HTML

For exporting notebooks, nbconvert transforms .ipynb files into HTML, PDF, LaTeX, or markdown. Run it from the command line:

jupyter nbconvert --to html notebook.ipynb
jupyter nbconvert --to markdown notebook.ipynb

The markdown output from nbconvert can be further processed with our Markdown to HTML converter or Markdown to PDF tool if you need different output formats.

Frequently Asked Questions

How do you change a cell to markdown in Jupyter?

Select the cell, press Esc to enter command mode, then press M. Alternatively, use the cell type dropdown in the toolbar.

Can you use LaTeX in Jupyter markdown cells?

Yes. Use single dollar signs for inline math ($x^2$) and double dollar signs for display math ($$\sum x$$). MathJax handles the rendering.

How do you add a table of contents in Jupyter?

Install the toc2 extension from jupyter_contrib_nbextensions. It auto-generates a clickable table of contents from your headings.

Does Jupyter support Mermaid diagrams in markdown?

Not natively. You need extensions like jupyterlab-mermaid or you can use the %%mermaid magic command with the appropriate package installed.

How do you add a horizontal rule in Jupyter markdown?

Use three or more hyphens (---), asterisks (***), or underscores (___) on their own line.

Can you run markdown cells programmatically?

Yes. The IPython.display.Markdown() function renders markdown strings from code cells, which is useful for dynamic content generation.

How do you escape special markdown characters in Jupyter?

Use a backslash before the character: \*, \#, \|. This prevents markdown from interpreting them as formatting.

What's the difference between markdown and raw cells?

Markdown cells render formatted text when executed. Raw cells display content exactly as typed, with no formatting applied. Raw cells are useful for nbconvert directives.

Quick Reference Summary

This jupyter markdown cheat sheet covers the core features you'll use daily: text formatting, LaTeX math with $ and $$, tables, images, HTML embedding, and magic commands. Bookmark this jupyter markdown cheat sheet and keep it handy while working in your notebooks. For general markdown editing and preview, try our online editor to test syntax before pasting it into Jupyter cells.