How to convert .ipynb files to pdf so I can print notes?
python - How to convert IPython notebooks to PDF and HTML? - Stack Overflow
How to convert ipynb to pdf inside Jupyter notebook? I came across a solution stating we need to install pandoc but the official pandoc redirects us to the GitHub files which one to download now ??
Converting Jupyter Notebooks to PDF: Exploring Your Options
Does the IPYNB to PDF converter work without LaTeX?
Is this IPYNB to PDF converter free? Are there any limitations?
How to open IPYNB file?
Videos
I'm taking Jose Portilla's "Python Zero to Hero" course on Udemy. He linked us to all of his notes for each lesson in GitHub. I can download the zips of the notes (.ipynb), but I want to convert them so I can print and read them in a physical version. Is there a link to his notes in a way that's easy to print? Or does someone know how I can convert them? Apologies if my terminology isn't correct. Cheers
If you have LaTeX installed you can download as PDF directly from Jupyter notebook with File -> Download as -> PDF via LaTeX (.pdf). Otherwise follow these two steps.
For HTML output, you should now use Jupyter in place of IPython and select File -> Download as -> HTML (.html) or run the following command:
jupyter nbconvert --to html notebook.ipynbThis will convert the Jupyter document file notebook.ipynb into the html output format.
Google Colaboratory is Google's free Jupyter notebook environment that requires no setup and runs entirely in the cloud. If you are using Google Colab the commands are the same, but Google Colab only lets you download .ipynb or .py formats.
Convert the html file notebook.html into a pdf file called notebook.pdf. In Windows, macOS (
brew install wkhtmltodf) or Linux, install wkhtmltopdf. wkhtmltopdf is a command line utility to convert html to pdf using WebKit. You can download wkhtmltopdf from the linked webpage, or in many Linux distros it can be found in their repositories.wkhtmltopdf notebook.html notebook.pdf
Original (now almost obsolete) revision: Convert the IPython notebook file to html.
ipython nbconvert --to html notebook.ipynb
Also pass the --execute flag to generate the output cells
jupyter nbconvert --execute --to html notebook.ipynb
jupyter nbconvert --execute --to pdf notebook.ipynb
The best practice is to keep the output out of the notebook for version control, see: Using IPython notebooks under version control
But then, if you don't pass --execute, the output won't be present in the HTML, see also: How to run an .ipynb Jupyter Notebook from terminal?
For an HTML fragment without header: How to export an IPython notebook to HTML for a blog post?
Tested in Jupyter 4.4.0.