How to Convert a Jupyter Notebook to PDF or Other Formats
A quick guide to the nbconvert tool to convert a Jupyter notebook to other formats such as PDF, LaTeX and Markdown.
Jupyter notebooks have become one of the main choices for various tasks regarding Python nowadays, from mastering the basics of the language to developing advanced machine learning algorithms.
In this article, we will see how to export a Jupyter Notebook into various file formats, such as PDF or LaTeX, using the nbconvert tool.
Installing nbconvert
First of all, we need to install the nbconvert tool.
nbconvert is an optional package for Jupyter Notebook and can be easily installed with pip or conda.
pip install nbconvert
# OR
conda install nbconvert
However, to work with nbconvert we also need at least pandoc for markdown content and TeX packages for PDF and LaTeX formats.
# pandoc
sudo apt-get install pandoc
# TeX
sudo apt-get install texlive-xetex texlive-fonts-recommended texlive-plain-generic
See the following link for the official instructions on installing nbconvert and other dependencies.