Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Tips and trics with Jupyter Notebooks

Table of contents

  • Create internal links using the same heading as the one linked to.

  • Autofill happens automagically after writing the hashtag in the parenthesis, but this may miss out on capital letters.

[Including Markdown content from](#Including-Markdown-content-from-file)

Example:

  1. Including Markdown content from

  2. Create filling text on the fly

  3. Exporting to PDF

  4. Interactive graphics

  5. HTML

Including Markdown content from file

Loading...

Create filling text on the fly

Loading...

Exporting to PDF

  • If not installed:

pip install 'nbconvert[webpdf]'

  • First time usage to install Chromium for conversion via HTML instead of LaTeX:

jupyter nbconvert --to webpdf --allow-chromium-download your-notebook-file.ipynb

  • Normal usage:

jupyter nbconvert --to webpdf your-notebook-file.ipynb

  • For general hiding of code in code cells:

jupyter nbconvert --to webpdf --no-input your-notebook-file.ipynb

  • Other export options (may need additional packages installed to work): ‘asciidoc’, ‘custom’, ‘html’, ‘html_ch’, ‘html_embed’, ‘html_toc’, ‘latex’, ‘markdown’, ‘notebook’, ‘pdf’, ‘python’, ‘qtpdf’, ‘qtpng’, ‘rst’, ‘script’, ‘selectLanguage’, ‘slides’, ‘webpdf’.

  • There are also a lot of other customisations available through other parameters, e.g., various templates and themes.

Interactive graphics

  • Basic interactivity is possible directly in Plotly when exporting to HTML.

  • Advanced interactivity needs live running in some Jupyter environment or converting to a dynamic web page using Voilá, Mercury or similar.

  • Plotly’s renderer may need setting for correct compatibility and inclusion of JavaScript.

Loading...
Loading...

HTML

  • Markdown supports some HTML, but Markdown commands have no effect inside HTML tags.

  • Basic HTML is preserved also when converting to PDF.

μ=1\mu = 1

Some text over here
ContentMore content
Even more contentLast content $\mu = 1$
Notebook Cell