Skip to content

Instantly share code, notes, and snippets.

@fomightez
Last active November 24, 2024 02:38
Show Gist options
  • Save fomightez/8ecab697c1183da25180b935f465951e to your computer and use it in GitHub Desktop.
Save fomightez/8ecab697c1183da25180b935f465951e to your computer and use it in GitHub Desktop.
Demostration Collecting a cell from a previously run Jupyter Notebook and making PDF with that output

The demonstration notebook , related to SO question 'How to export all output from certain Jupyter cell, say, using %%capture magic, and save output to a PDF file?', was developed and works in MyBinder-served Jupyter sessions launched from here. However, the easiest way to launch is to click here so this demo notebook will be opened in that environment. (It was set up to have the PDF making step work with !jupyter nbconvert --no-input --to pdf new_ntbk.ipynb.)

Or click: Binder

If you start the session from the development repo here, you can run the following in a new notebook to get the demo notebook:

!curl -OL https://gist.githubusercontent.com/fomightez/8ecab697c1183da25180b935f465951e/raw/207e1e0006a5d07ebdd90b03405707c610fb3561/collecting_one_cell_and_making_pdf_with_output.ipynb

Once the session starts, drag from your local system the notebook into the file navigation panel on the left and release your most button to drop.
Alternatively, get the notebook onto your local system from here, and then drag from your local system the notebook into the file navigation panel on the left and release your most button to drop. That will upload it from your local system to the remote session.
It should work and look much like this static form of that notebook run.

Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment