Wayne's Github Page

A place to learn about statistics

Typesetting equations and code with Jupyter Notebooks

Jupyter Notebook

In your typical Jupyter Notebook, there are different cells. All cells default to “Code” cells but you can type math or text into a “Markdown” cell. To change this, simply use the downdown menu as shown below.

Jupyter Cells Dropdown Menu

Once the cell is a Markdown cell. You can enter Markdown which is a very common/simple way to format text for online materials.

Here’s what typing in Markdown looks like:

Jupyter markdown code

If you run the code, it’ll look like this:

Jupyter markdown rendered

You also enter mathematical equations using LaTeX by surrounding the commands with the dollar sign symbol $. LaTeX is one of the most popular ways to typeset mathematical equations. Please see the example below:

You can mix the mathematical equation within the Markdown

Jupyter markdown math code

If you run the code, it’ll look like this:

Jupyter markdown rendered

Note that the other cells still default to code:

Jupyter md with code

For more details on formatting your Notebooks, please see this super useful page. To export the file as a PDF, you can simply download it as a PDF

Jupyter download PDF