Search code examples
jupyter-notebook

How to get landscape orientation when converting IPython notebook to PDF?


I'm converting my IPython notebook to PDF, using the following command:

ipython nbconvert --to latex --post PDF <notebook_filename>

and can't figure out what extra option to give, such that my final PDF is rendered in landscape orientation (so that none of my Python code gets clipped).

Anyone know how to accomplish this?


Solution

  • You can firstly produce a .tex out of your .ipynb file and then edit it using your latex interface.

    1. in your terminal use the following code:

    jupyter nbconvert --to latex your_notebook.ipynb

    1. Open your file in a LaTeX interface and use the command below to change the look to landscape:

      \documentclass[a4paper,landscape]{article}