Best way to print an iPython notebook

Goosal Tapal picture Goosal Tapal · May 17, 2017 · Viewed 16.2k times · Source

What is the best way to print an iPython notebook (.ipynb) that contains a lot of figures/plots, photos, and code that would appear with a horizontal scroll bar? I've tried converting them to HTML, slides, PDF, etc, but neither has produced a decent output. For example, the slides have super-large font/zoom such that one page has no more than 5 lines of text in it. I've tried GitPrint, but that's only good for markdown (md) files. I've tried converting ipynb to tex and using pdflatex to convert to PDF, but there are a lot of errors and I keep getting stuck with a question mark prompt (?). When I hit enter through them, the output doesn't contain the photos. So what is the best way here? I don't care about the extension, only that it looks good (like the ipynb) on paper.

Answer

kingbase picture kingbase · Nov 1, 2017

You can use nbconvert to convert the ipynb file into HTML and the question will be: How to pretty print a HTML file? And print a HTML file would be much easier compared with printing a ipynb file.

Command is like this:

jupyter nbconvert --to html filename.ipynb