Google Co-laboratory notebook PDF download

China☆狼群 提交于 2020-12-29 02:51:47

问题


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?


回答1:


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.




回答2:


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




回答3:


  1. Download .ipynb file
  2. Download as html
  3. Print PDF from browser



回答4:


Try any one:

  1. You have an option File > Download .ipynb. Use below command to convert ipynb to pdf or any other format

jupyter nbconvert --to FORMAT notebook.ipynb

See usage guide: https://nbconvert.readthedocs.io/en/latest/usage.html

  1. As mentoned by Bob, use print option to save as pdf. Here, you may lose text if it goes out of the page



回答5:


so to browser print option and select cancel option in that you will get save as pdf.




回答6:


  1. download the .ipynb file from colab from file->download .ipynb
  2. Then upload it to your jupyter notebook and download it in pdf format as you used to in stand-alone jupyter.

Since .ipynb files take a few MBs of data at maximum.




回答7:


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



回答8:


If you are using colab -

  1. go to file then click on print,
  2. there will be a "destination" tab,
  3. choose the "save as pdf" option over there


来源:https://stackoverflow.com/questions/52588552/google-co-laboratory-notebook-pdf-download

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!