In order to export your notebooks as Reveal.js slides, follow these steps:
- Open a notebook by double clicking it in the file browser.
- Select Cell tools in the left sidebar.
- Select the slide type (Slide, Subslide, Fragment, Skip, Notes).
Type of slides
- Slide: New slide
- Sub-Slides: New section within a topic. Cells with this marker will be placed on a new slide underneath the previous slide.
- Fragments: Additional information that adds to an existing slide or sub-slide.
- -: additional information that appears at the same time than the previous cell.
- Notes: Speaker notes. These can be viewed on a separate browser window out of the view from the audience. (see the ‘Installation’ -> ‘Full Setup’ section of the REVEAL.js Github repo).
- Skip: Cells that are set to skip do not appear in the presentation.
To access these options, while a notebook is open, browse the File menu:
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
# Turn interactive mode on
plt.ion()
data = np.random.randn(2, 100)
fig, ax = plt.subplots()
ax.scatter(*data, c=data[1], s=100*np.abs(data[0]));
Figure: scatterplot with random data
!jupyter nbconvert presentation.ipynb --to slides --no-prompt --TagRemovePreprocessor.remove_input_tags={\"to_remove\"}
- A new file was created. Its name is the same as your jupyter notebook but its extension is
html
. - Double click on your file to show your presentation
Visualize in slideshow mode
- Switch to standard jupyter notebook e.g. change
lab
totree
in the Jupyterhub address.
For instance, if you adress is
https://abisko.uiogeo-apps.sigma2.no/user/df0bb829-8d2d-487e-9748-cf1b58c1ab4b/lab
then the corresponding standard jupyter noteboo view is
https://abisko.uiogeo-apps.sigma2.no/user/df0bb829-8d2d-487e-9748-cf1b58c1ab4b/tree
- Click on your html file to visualize.
!jupyter nbconvert presentation.ipynb --to slides --no-prompt --TagRemovePreprocessor.remove_input_tags={\"to_remove\"}
Tips and ticks
if you add images (not generated by python plotting), it is important to download these images too (for instance to the github repositoy).
In presentation mode, you can know more about the reveal-specific shortcuts just pressing the help button at the slideshow left bottom corner.
- Darkish themes have css conflict with the notebook css, so it need customization to make them work (not provided by default).
- Markdown Images get left aligned by default. Enclose the image like
<center>![noimg](path/to/image.png)</center>
to center it.
!jupyter nbconvert presentation.ipynb --to slides --no-prompt --TagRemovePreprocessor.remove_input_tags={\"to_remove\"} --SlidesExporter.reveal_theme=sky
List of available theme at https://github.com/hakimel/reveal.js/tree/master/css/theme