Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to print a jupyter/ipython notebook slide presentation?

Is there a way to print out a slide deck of a jupyter/ipython notebook slides? Is it possible to do from the nbviewer site (http://nbviewer.ipython.org) ?

I know that I can print a pdf of my notebook, but when I do, it doesn't have the same page breaks and doesn't skip all the code that I would like skipped (for example, the libraries I've imported aren't necessary). I'd like to have it as a backup or a printable handout.

like image 753
Anna S. Avatar asked Dec 08 '15 22:12

Anna S.


1 Answers

You can try this:

jupyter nbconvert --to slides --post serve /path/to/your/notebook.ipynb

This should fire up your browser and serve the presentation (e.g at http://127.0.0.1:8000/<some-title>.slides.html#/)

change the url to

 http://127.0.0.1:8000/<some-title>.slides.html?print-pdf

If you now open the print dialog from your browser, the slides should have the right formatting.

Instead of sending to a printer you should be able to choose to write to a pdf file from the printer menu.


I tested this in chrome on OSX. I assume it works on all systems, but I did not test.

like image 155
cel Avatar answered Nov 13 '22 09:11

cel