Presenting Code Using Jupyter Notebook Slides

When you make a slide presentation, there are a few programs you likely think of: Microsoft PowerPoint, Google Slides, Prezi (just kidding). PPT and Slides are great applications, to be sure. They offer tons of formatting and style options and integrate well with other software developed by Microsoft and Google, respectively. But there is another great program for making slides, and it is especially useful for anyone interested in presenting code. I’m talking about Jupyter Notebook Slides. Most coders know Jupyter Notebooks as an environment for writing code, but it can do even more!

The main advantage of Jupyter Notebook slides is that you can take that very same Jupyter Notebook you used to model and visualize a dataset, and turn it into a slideshow for a technical presentation. It is easy to choose individual cells to present as well as which ones to skip. And formatting is virtually a non-issue for anyone who already knows how to use Markdown.

The rest of this blog will be a short tutorial on turning a Jupyter notebook into a slideshow.


Walkthrough

So, to start off, I’ve got my Jupyter notebook:

In order to get my notebook into a slideshow format, I go to View → Cell Toolbar → Slideshow

After clicking slideshow, a light gray bar will appear above each cell with a scroll down window on the top right.

At this point, I can select what type of slide each cell should be. I can make something a regular slide, or a sub-slide if it is a continuation of the previous slide. I can also skip slides or make them be notes, which is helpful when you’ve got lots of code that you don’t necessarily need for your presentation.

Now that I’ve got my slides, there’s one final step. In order to open this notebook as a slideshow I need to run a command in Terminal:

jupyter nbconvert Jupyter\ Slides.ipynb --to slides --post serve

‘Jupyter\ Slides.ipynb’ was just the name of my notebook.

So let’s see how the notebook looks.

There are three main things to notice. First, since my overview slide was labeled as a sub-slide, I hit the down arrow to get to it. Next, my Notes cell did not appear. Lastly, in order to see all my slides at the end I pressed the esc key.


Conclusion

Jupyter notebook slides offer a simple, clear layout and are incredibly easy to create. While they do not offer the amount of formatting and design features as other presentation applications, they do a very good job of presenting code and data visualizations for technical audiences.