Markdown cells (5 minutes)


One of the hardest habits to get into is documenting your work. Jupyter makes it easy.

Click in an empty cell. Go to the pop-up menu near the top of the page that reads Code. Select Markdown from that menu. Now you can type plain text in that cell; e.g., “The following code sums all the histograms in the analysis.” When you’re done, hit SHIFT-ENTER to see the formatted result.

You can also include Markdown,1 HTML,2 and LaTeX3 commands to format the text. Here are some examples: declare a cell to be Markdown, paste one of the following paragraphs into the cell, and hit SHIFT-ENTER:

##### Markdown

# 2025 Analysis Project

*Energy*, **time**, and `momentum` are all variables in this
##### HTML

<h1>2019 Analysis Project</h1>

<p><i>Energy</i>, <b>time</b>, and

<p>The following code reads in an n-tuple.</p>
##### LaTeX


nabla times vec{mathbf{B}} -, frac1c,
frac{partialvec{mathbf{E}}}{partial t} & =

nabla cdot vec{mathbf{E}} & = 4 pi rho 

nabla times vec{mathbf{E}}, +, frac1c,
frac{partialvec{mathbf{B}}}{partial t} & = vec{mathbf{0}}

nabla cdot vec{mathbf{B}} & = 0


Can you mix all of them in a single Markdown cell? Give it a try!


Markdown is a simple text-layout layout that emphasizes readability over the methods described in the next two footnotes. Here is a pretty good Markdown tutorial.

Though I tend to prefer HTML (see the next footnote), in 2022 I composed most of this tutorial using Markdown, because it was easier to translate from the original Microsoft Word document.


HTML (“HyperText Markup Language”) is the standard language for formatting content in web browsers. If you’ve never seen it before, it’s because you’ve used some program that formats web pages for you into HTML (Markdown is one such program). Here’s my favorite HTML tutorial.

If you want a couple of xkcd cartoons on HTML: and


LaTeX is a document-preparation package that’s often used in research. If you write a paper for publication this summer, you are going to use LaTeX; physics publications don’t accept articles in MS-Office or Google Docs format.

Don’t worry about learning LaTeX. Most people don’t write a LaTeX document from scratch; they get one from someone and learn by example. It’s much easier than learning ROOT. Here are some Jupyter-related examples.

You can spend a lifetime learning LaTeX, but almost no one ever has. I certainly have not, which is why the PDF version of this tutorial looks sloppy.