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?
Since .ipynb files take a few MBs of data at maximum.
check here for video: https://youtu.be/n2Cd9NCZtZk
%cd go_to_your_path
#run these.
!sudo apt-get install texlive-xetex texlive-fonts-recommended texlive-generic-recommended
!jupyter nbconvert --to pdf fileName.ipynb
so to browser print option and select cancel option in that you will get save as pdf.
Try any one:
jupyter nbconvert --to FORMAT notebook.ipynb
See usage guide: https://nbconvert.readthedocs.io/en/latest/usage.html
If you are using colab -
You can also run the solution of mayurmadnani directly on CO.
Therefor create a new Python workbook in CO 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.