A more accurate representation of jupyter notebooks when converting to pdfs. This template was designed to make converted jupyter notebooks look (almost) identical to the actual notebook. If something doesn't exist in the original notebook then it doesn't belong in the conversion.
As of nbconvert 5.5.0, the majority of these improvements have been merged into nbconvert's default template. Version 3.x of this package will continue to support nbconvert 5.5.0 and lower, whereas in the future version 4.x will only support nbconvert 5.5.0 and newer. Versions 3.x, and 4.x will overlap support for nbconvert version 5.5.0.
Quick Comparison:
for a closer look see the example directory.
pip install nb_pdf_template
python -m nb_pdf_template.install
pip install -U nb_pdf_template
python -m nb_pdf_template.install
Drop all of the "*.tplx" files into the folder containing the other LaTeX nbconvert templates. If using anaconda, it should be something like:
*/Anaconda3/Lib/site-packages/nbconvert/templates/latex
From the command line:
jupyter nbconvert --to pdf filename.ipynb --template classic
Adding:
c.LatexExporter.template_file = 'classic'
to the jupyter_nbconvert_config.py
file will let you drop the "--template classic", and to the jupyter_notebook_config.py
file will let you use "download as pdf" from within the Jupyter notebook.
Replace classic
with your template of choice.
This package offers the following templates:
Template | Use |
---|---|
classic.tplx (Recommended) | For most accurate recreation of the default Jupyter Notebook style. |
classicm.tplx | m for modified. Similar to classic.tplx, but in/out prompts are above cells instead of in the margin. Bonus left margins are smaller so code cells are wider. |
Version | Tag | Published |
---|---|---|
4.0.0 | 4yrs ago | |
3.0.3 | 4yrs ago | |
3.0.2 | 4yrs ago | |
3.0.1 | 4yrs ago |