Ger
Ger

Reputation: 441

Suppress cell from being printed in Jupyter Notebook PDF export

I'm writing a sort of scientific article which mixes text, figures and code in Jupyter Notebook. I would like to get a PDF copy (using LaTeX) but some of the cells occupy a lot of space in the final PDF.

So my question, is: how can I hide some cells (and/or its output) from being printed into the PDF?

Upvotes: 2

Views: 1518

Answers (1)

Wayne
Wayne

Reputation: 9865

Use the hide_code extension. You can set individual code and output and the settings get respected upon conversion to PDF. The key though is to use the special menu buttons the extension adds for the conversion. The same triggers can be accessed from under the added 'Hide Code' menu on the top toolbar.

If you'd like to test it out before installing locally, you can go here and click the launch binder button to launch a temporary session. The demo notebook I have there upon launch isn't really related at this time. Everything is already installed and works (just ran it to verify) like the animation in the hide_code repo.

Upvotes: 2

Related Questions