Export Jupyter to other formats

The IPython notebooks can be converted in the following formats:

  • html
  • latex
  • pdf
  • markdown
  • rst
  • script
  • slides
  • notebook

The command-line syntax to run the nbconvert script is:

$ ipython nbconvert --to <FORMAT> notebook.ipynb

The default output format is html, for which the --to argument may be omitted

Exporting to HTML

As an example, lets convert the analysis.ipynb notebook to HTML

In [1]:

ipython nbconvert --to html --template full 'example/analysis.ipynb'
[NbConvertApp] Converting notebook example/analysis.ipynb to html
[NbConvertApp] Writing 368559 bytes to analysis.html

This is the result:

In [2]:
from IPython.display import IFrame
IFrame('analysis.html', 1000, 400)

Creating SLIDES

This generates a Reveal.js HTML slideshow. It must be served by an HTTP server. The easiest way to do this is adding --post serve on the command-line.

To create the slides we first have to select slideshow from the Cell Toolbar menu and then configure the Slide Type of each cell as:

  • Slide
  • Sub-Slide
  • Fragment
  • Skip
  • Notes

I created a copy of the example/analysis.ipynb called analysis_slideshow.ipynb where I configured the behaviour of every cell.

In [3]:

ipython nbconvert --to slides --template output_toggle --post serve 'example/analysis_slideshow.ipynb'
Process is terminated.