Google Colab
Jump to navigation
Jump to search
Printing to PDF
Pre-script: The second, more complicated method below generally comes up with much better PDFs than the first one... It just takes more work.
- Sometimes using the File->Print command with a PDF-based destination will work fine! Check out the preview to see if it does. Be careful though - the issues might not creep up until deep within the notebook. Take a look at particularly large output formatted output cells.
- If that doesn't work, try this (note: this assumes that you have the Google Drive app installed such that your file system can directly see your Google Drive):
- Make sure that you have run and saved the notebook(s) that you want to your Google Drive and that you know where they are
- Go to ToHTML_local.ipynb
- Open the local files panel by clicking the folder icon at left (bottom icon) and wait for the runtime to connect - there should be a sample_data folder when this is done
- Click the "Upload to session storage" icon (first icon of the four above the file list; piece of paper with an up arrow)
- Navigate to where the .ipynb file is that you want to print and upload it to local storage
- Repeat this for any notebooks that you want to print (you can shift-click to get multiple files from the same folder). This will make local copies in the current runtime
- Run the one cell in the ToHTML_local.ipynb - this will make an HTML version of any .ipynb files in the runtime
- Once you have done that for all the files, you can click the Refresh icon (second icon of the four above the file list; folder with a circular arrow); you can also just wait for the list to refresh itself
- Hover over the HTML version of the file(s) you want, click the menu button that comes up (three dots), and then choose download
- Open the HTML version of the files you want in a browser, then use the browser's print comm end to create a PDF