{"id":1680,"date":"2016-02-10T18:57:50","date_gmt":"2016-02-10T23:57:50","guid":{"rendered":"http:\/\/unitstep.net\/?p=1680"},"modified":"2016-02-10T18:57:50","modified_gmt":"2016-02-10T23:57:50","slug":"converting-an-ipython-notebook-to-pdf","status":"publish","type":"post","link":"https:\/\/unitstep.net\/blog\/2016\/02\/10\/converting-an-ipython-notebook-to-pdf\/","title":{"rendered":"Converting an IPython Notebook to PDF"},"content":{"rendered":"
If you have an IPython Notebook ( However, if you run that, you’re likely to run into an error asking to you install Pandoc; this is because Running the conversion again yields another error, suggesting you need the *.ipynb<\/code> file), you may want to convert to PDF<\/acronym> for distribution. If you read the documentation for
ipython nbconvert<\/code><\/a>, it seems fairly straightforward:<\/p>\n
$ ipython nbconvert --to PDF<\/acronym> <your notebook>.ipynb<\/code><\/pre>\n
nbconvert<\/code> relies on an intermediate conversion to LaTeX first, and then to the final PDF<\/acronym> output. Pandoc is used for this. To install on OS X:<\/p>\n
$ brew install pandoc<\/code><\/pre>\n
pdflatex<\/code> command; Pandoc doesn’t include any built-in support for LaTeX->PDF<\/acronym>, so you’ll need a LaTeX install. The Pandoc documentation<\/a> suggests BasicTeX:<\/p>\n
$ brew cask install basictex<\/code><\/pre>\n