UPDATE 2013-07-19: For details on the alternative to nbconvert briefly mentioned below, long custom PDF page sizes, see On Mac, only Firefox can PDF without page breaks.
UPDATE 2013-07-15: See Quick link to download nbconvert for updated download location.
The official iPython Notebook documentation states that to convert a notebook to PDF, you should use your browser's "Print to PDF" capability. The problem is that that chops charts and graphs in half due to PDF pagination (unless you are able to configure a custom PDF paper size e.g. 60 inches long).
A command-line utility, nbconvert, which will eventually be merged into IPython but is not yet, nicely converts Notebooks to PDF. It even includes nice instructions on installing on a Mac, but the instructions are only 98% complete. Below are the missing steps:
- Download the nbconvert package as a Zip and unzip to your home directory.
- Follow the steps from https://github.com/ipython/nbconvert/blob/173bb08dd86d02a7485801969c94d4816913cd09/README.rst, specifically:
- pip install jinja2
- pip install markdown
- curl http://docutils.svn.sourceforge.net/viewvc/docutils/trunk/docutils/?view=tar > docutils.tgz
- pip install -U docutils.tgz
- pip install pygments
- sudo easy_install -U sphinx
- Install PanDoc via the installer http://code.google.com/p/pandoc/downloads/list
- Install MacTex via the .pkg http://www.tug.org/mactex/
- Execute to convert your .ipynb to .pdf:
export PYTHONPATH=~/nbconvert-master/nbconvert/utils python ~/nbconvert-master/nbconvert1/nbconvert.py --format=pdf MyNotebook.ipynb
