Presenting with Jupyter Notebooks

Scott Jeen

17th November 2021

In the last year I've started presenting work using Jupyter Notebooks, rebelling against the Bill Gates'-driven status-quo. Here I'll explain how to do it. It's not difficult, but in my opinion makes presentations look slicker, whilst allowing you to run code live in a presentation if you like. First, we need to download the plug-in that gives us the presentation functionality, it's called RISE. We can do this easily using pip in a terminal window:

In [ ]:
pip install RISE

Once installed, our first move is to add the presentation toggles to our notebook cells. We do this by clicking View in the menu bar, then Cell Toolbar, then Slideshow:

Adding Presentation Toggles to Cells

Slide Types

This adds a Slide Type dropdown to each cell in the notebook. Here we can choose one of five options:

  • Slide: Used to start a new chapter in your presentation, think of this as a section heading in LaTeX.
  • Sub-slide: Slide falling within the chapter defined by a Slide cell.
  • Fragment: this is to split the contents of one slide into pieces; a cell marked as a fragment will create a break inside the slide; it will not show up right away, you will need to press Space one more time to see it.
  • Skip: Skips cell when in presenter mode.
  • Notes: Cell that allows the author to write notes on a slide that aren't shown in presenter view.

As with any notebook, we can define the cell type to be either Markdown or Code. As you'd expect, we present any text or image-based slide in Markdown, reserving the Code cell type if and only if we want to explicitly run some code in the presentation. If you aren't familiar, Markdown is a straightforward language for text foramtting; I won't go into the details here, but suffice to say you can learn the basics of Markdown in 5 minutes. You can find a useful cheatsheet here.

Here's an example of a Markdown Slide!

I can create bullet points easily:

  • Groundbreaking idea no. 1
  • Groundbreaking idea no. 2

And I can add tables easily too:

Presentation Software Rating (scale: [0,10])
MS Powerpoint -3
RISE 11
In [6]:
# Here's an example of a Code slide!

print('I\'m using RISE to present code in Jupyter Notebooks!')
I'm using RISE to present code in Jupyter Notebooks!

Adding images is easy too. I advise creating a sub-directory in your working directory calles /images and storing anything you want to present there. Then you display them in a markdown file using some simple HTML syntax:

<img class="" src="images/london_deaths.jpeg" style="width:75%">

You can manipulate the style attribute to change the size of the image. Don't worry, this is the only HTML you need to know!

Displaying Images is Easy Too!

To view your slideshow click on the bar-chart button in the menu bar. This will start the presentation from the cell currently selected:

Enter Presentation Mode on the Menu Bar

That's it! This tutorial has given you an introduction to the basics of RISE for presenting with Jupyter Notebooks, you can of course customise these to your heart's content using further plug-ins and more advanced Markdown. Here's a summary of the useful links from this document to finish:

Thanks!

Twitter: @enjeeneer

Website: https://enjeeneer.io/