Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What tools are available to export an ipython notebook to a PDF file? [closed]

I have a nicely-formatted ipython notebook complete with markdown cells and whatnot. I'm wondering what my options are in terms of exporting to a PDF file.

So far, I've been going to File > Print View and printing the resulting page to PDF with chromium's "save to file" function. This technically works, but it has one major inconvenience: my figures, code and markdown cells are often split by page breaks.

Are there any other solutions for explort such that I can have one continuous PDF file?

EDIT: I ran into nbconvert, but when I keep getting a "file not found" error. Anybody have any luck with nbconvert? The documentation claims to support exporting to PDF, but when I ran nbconvert.py -f pdf, the error message suggested that the PDF format was not, in fact, supported.

like image 885
Louis Thibault Avatar asked Jan 03 '13 02:01

Louis Thibault


1 Answers

You can use ipython to do this, for instance the command:

ipython nbconvert notebookname.ipynb --to latex --post pdf

to convert notebookname.ipynb to a pdf. It does however require that you are running the latest version of texlive (that's texlive 2013) to have the supporting software. Note that Ubuntu 12.04 comes with texlive 2009 from their repositories. 2013 can be installed from CTAN directly, just follow these directions. Then you are up and running, and it looks great.

like image 132
Signal4 Avatar answered Sep 28 '22 09:09

Signal4