Questions tagged [nbconvert]

nbconvert is a tool for Jupyter Notebook conversions.

nbconvert is a tool for Jupyter Notebook conversions.

The nbconvert tool, jupyter nbconvert, converts notebooks to various other formats via Jinja templates. The nbconvert tool allows you to convert an .ipynb notebook file into various static formats including:

Github: https://github.com/jupyter/nbconvert

Docs: https://nbconvert.readthedocs.io/en/latest/

298 questions
6
votes
1 answer

Write pre-commit that *checks* if jupyter notebooks have output cleared

I know you can use jupyter nbconvert --clear-output --inplace (per here) to clear the output of a jupyter notebook. I'm wondering if there's an easy way to check if output has been cleared in a pre-commit hook. That way I can fail the…
dfried
  • 313
  • 2
  • 8
6
votes
1 answer

What is the proper way to specify a custom template path for jupyter nbconvert V6?

What is the proper way to specify a custom template path for nbconvert? Under nbonvert version 6, templates are now a directory with several files. Those templates can live in any number of locations depending on the…
Aaron Ciuffo
  • 804
  • 8
  • 22
6
votes
1 answer

Clear a specific metadata property of a Jupyter Notebook in version control

When saving my jupyter Notebooks with Git, I'd like to remove: Outputs (answered in https://stackoverflow.com/a/58004619/3733974) ExecuteTime in metadata (code below in .ipynb) "metadata": { "ExecuteTime": { "end_time":…
mbh86
  • 6,078
  • 3
  • 18
  • 31
6
votes
2 answers

Where is custom.css in the generated html file from nbconvert?

I am using nbconvert to convert my jupyter notebook to html by jupyter nbconvert my.ipynb --to html Then it says: [NbConvertApp] Converting notebook my.ipynb to html [NbConvertApp] Writing 407497 bytes to my.html Then in the generated my.html, I…
derek
  • 9,358
  • 11
  • 53
  • 94
6
votes
4 answers

Jupyter Notebook nbconvert without magic commands/ w/o markdown

I have a Jupyter notebook and I'd like to convert it into a Python script using the nbconvert command from within the Jupyter notebook. I have included the following line at the end of the notebook: !jupyter nbconvert --to script…
profj
  • 311
  • 3
  • 10
6
votes
0 answers

Detect if notebook is run interactively or being exported in nbconvert

I want to run some extra checks in my code when my notebooks are being exported using nbconvert. Is there any way to detect when this is the case? I already tried the solutions from Detecting when a python script is being run interactively in…
MasterScrat
  • 7,090
  • 14
  • 48
  • 80
6
votes
2 answers

Logging while nbconvert execute

I have a Jupyter notebook that needs to run from the command line. For this I have the following command: jupyter nbconvert --execute my_jupyter_notebook.ipynb --to python This command creates a python script and then executes it. However, I'm…
Victor
  • 1,163
  • 4
  • 25
  • 45
6
votes
0 answers

Jupyter `export as html` does not use my customized theme and changes the font colors

I use a dark theme (custom.css) for the jupyter notebooks. When I use nbconvert either through the command line or from the menu, it gives me an html file with a different font colors. I read about it on the developer GitHub page but I did not…
Roo
  • 862
  • 1
  • 10
  • 22
6
votes
0 answers

jupyter nbconvert sticky bit runtime warning

When I run jupyter nbconvert --execute --to html toy_notebook.ipynb with jupyter version 4.3.0 and python 3.6 on macOS 10.12.5, I get the following warning: [NbConvertApp] Converting notebook toy_notebook.ipynb to html [NbConvertApp] Executing…
6
votes
2 answers

How do I convert tags in markdown cells when exporting in Jupyter?

I've got a large report-like notebook which has got many images. Instead of using the ![title](link) syntax, I've had to use instead, so I have better control on them. While this works inside the notebook in…
François Leblanc
  • 1,412
  • 1
  • 17
  • 23
6
votes
2 answers

Best way to print Jupyter notebook slides? How to put a page break?

I want to print my jupyter notebook and share the hardcopy with non-programmer coworkers. What I have done so far: I've figured out the way to hide the code :How to hide code from cells in ipython notebook visualized with nbviewer? I've figre out…
Lisa
  • 4,126
  • 12
  • 42
  • 71
5
votes
1 answer

How to get images rendered when converting a Jupyter Notebook to PDF?

I convert my Jupyter Notebooks to PDF files with the 'nbconvert' and 'notebook-as-pdf' modules with the following on the command line: jupyter nbconvert --to PDFviaHTML The images(png files)referenced in Markdown cells that show…
Rinkalaone
  • 86
  • 1
  • 5
5
votes
3 answers

jupyter command not found in terminal MacOS

For some reason, when I pip3 everything, it goes all under this PATH /Users/XXX/Library/Python/3.8/bin same for my notebook. So I opened my vscode and go to .zshrc and add export PATH=$PATH:/Users/XXX/Library/Python/3.8/bin to my path. And I go to…
Sheldon
  • 169
  • 1
  • 2
  • 12
5
votes
1 answer

How can I tell to Nbconvert: "Please, this time use pdfLaTeX in place of XeLaTeX"

I have different ANCIENT templates to convert a Jupyter notebook to a PDF, but starting from version 5.0 jupyter-nbconvert (at least, this is the name of the binary on Debian) uses XeLaTeX by default and, as it happens, some of those templates are…
gboffi
  • 22,939
  • 8
  • 54
  • 85
5
votes
1 answer

How to resolve TemplateNotFound error when upgrading nbconvert to 6.x+?

When trying to make a new Jupyter-based presentation using a template I've used in the past, I found that when nbconvert is upgraded past 6.0, I get an error related to a missing built-in template basic.tpl. A minimal reproducer for this, create a…
Paul
  • 10,381
  • 13
  • 48
  • 86
1 2
3
19 20