Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 410
dbanas Avatar asked Mar 23 '15 18:03

dbanas


People also ask

How to convert ipynb to PDF?

Solution: A better, hassle-free option is to use an online converter which will convert the *.html version of your *.ipynb to *.pdf. First, from your Jupyter notebook interface, convert your *.ipynb to *.html using:

How to rotate PDF pages from portrait to landscape?

If you get a PDF document with a mix of landscape and portrait pages, you can use a PDF editor like PDFelement to change PDF pages from portrait to landscape or vice versa with the rotate PDF page tool to help you make all pages consistent in three simple steps! Step 1. Open a PDF File. Launch PDFelement and open the PDF file you want to edit.

How to change orientation of PDF page in Windows 10?

Change Orientation of PDF with Page Right-click 1 Step 1. Open a PDF File#N#Launch PDFelement and open the PDF file you want to edit. Click on the "Open files" button in... 2 Step 2. Select "Rotate Pages" Tool#N#After opening a PDF file, find the PDF page you want to change orientation,... 3 Step 3. Change Orientation of PDF More ...

How to convert Jupyter notebook to PDF on Mac?

1 Open the terminal 2 Navigate to the folder containing the jupyter notebook 3 type "jupyter nbconvert --to pdf your_jupyter_notebook.ipynb "


1 Answers

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:

ipython nbconvert --to latex your_notebook.ipynb

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

\documentclass[a4paper,landscape]{article}
like image 170
Amirkhm Avatar answered Nov 08 '22 14:11

Amirkhm