Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Co-laboratory notebook PDF download

Google Co-laboratory notebook doesn't have the "Download as" dropdown menu item in "File" menu like standalone Jupyter does. How to download the notebook as PDF?

like image 722
Pokemonrathon Avatar asked Oct 01 '18 09:10

Pokemonrathon


People also ask

Can we download Google colab notebook?

You can download any Colab notebook that you've created from Google Drive following these instructions, or from within Colab's File menu. All Colab notebooks are stored in the open source Jupyter notebook format ( . ipynb).

Can we download Google Colab?

To download a file for Colab lib use, however, you will need to use the Google Chrome Browser. If you are using Firefox, then this won't work. Once executed, this will download the file directly to your downloads.


2 Answers

You can also run the solution of mayurmadnani directly on Colab.
Therefore create a new Python workbook in Colab and connect it to a runtime.
Install the necessary packages into the virtual machine with:

!apt-get install texlive texlive-xetex texlive-latex-extra pandoc !pip install pypandoc 

Mount your google drive to get access to your ipynb files

from google.colab import drive drive.mount('/content/drive') 

I had to copy the files from the drive to the working directory,
because the drive is/was mounted as read only.

!cp drive/My Drive/Colab Notebooks/Untitled.ipynb ./ 

Then you can run the converter.

!jupyter nbconvert --to PDF "Untitled.ipynb" 

Then you can download the file in the left side panel.

like image 176
user10914779 Avatar answered Nov 20 '22 13:11

user10914779


Use the built-in browser print. Then, save the result as a pdf.

like image 45
Bob Smith Avatar answered Nov 20 '22 13:11

Bob Smith