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
4
votes
2 answers

How to get ipywidgets interact to work in HTML?

I have a Jupyter notebook with the following cell: from ipywidgets import widgets, interact slider = widgets.IntSlider() def print_val(v): print(v) interact(print_val,v=slider) This works fine in the notebook - when I change the slider the…
soungalo
  • 1,106
  • 2
  • 19
  • 34
4
votes
0 answers

Syntax highlighting for code blocks within alert box in Jupyter for both notebook and reveal.js slides output?

I'm trying to render Jupyter markdown cells with code blocks inside HTML alert boxes, but can't get the syntax highlighter to work for both reveal.js slides and notebook cell output. Edit: I'm using JupyterLab 2.0 to render the notebooks (but…
4
votes
1 answer

How can I wrap Jupyter output in custom HTML?

I want to be able to take the normal output for an object and insert it into custom HTML components. Specifically, I want to allow things like putting several charts into an accordion UI element, or having hidden dataframes that are shown when a…
bwk
  • 622
  • 6
  • 18
4
votes
1 answer

Make jupyter nbconvert write output to notebook after each cell finishes instead of waiting till the end of execution

I am using jupyter nbconvert to execute some notebooks, as follows: jupyter nbconvert --ExecutePreprocessor.timeout=-1 --to notebook --inplace --execute myNotebook.ipynb The command works fine, however, I am unable to see the progress while the…
Othmane
  • 1,094
  • 2
  • 17
  • 33
4
votes
1 answer

Jupiter: nbconvert does convert HTML image to LaTex

I love using jupyter notebooks to document topics for my physics course, so I am having my students use CoCalc and either Markdown or Jupyter notebook to write their lab reports. I have a problem. In a jupyter notebook, the Markdown way to insert an…
Prof Huster
  • 938
  • 7
  • 14
4
votes
2 answers

Jupyter nbconvert LaTex Export Theme

I am using Jupyter Notebook nbconvert (Save as menu) to export as pdf via Latex. However, the pdf file is not in a good shape. For example, some wide tables are shown well. I would prefer to have a box for tables to be resized to the width of the…
Roo
  • 862
  • 1
  • 10
  • 22
4
votes
0 answers

ipywidgets not rendering with nbconvert using jupyter/scipy-notebook docker image

When I convert a notebook containing an ipywidget, the widget doesn't render, only the label is printed. Is it possible to get nbconvert to render the ipywidget when converting to html or pdf? I don't need interactivity, just a static image. Here is…
jScience
  • 68
  • 7
4
votes
0 answers

How to render slides from a jupyter notebook after exporting them to html?

I wrote a jupyter notebook and set up slideshow options to obtain slides and do a presentation. Thus I can see my presentation with jupyter nbconvert notebook.ipynb --to slides --post serve Doing this I also obtain a notebook.slides.html file. But…
Ger
  • 9,076
  • 10
  • 37
  • 48
4
votes
1 answer

How to run nbconvert on notebook in google colaboratory

I have a simple jupyter notebook, say foo.ipynb. I wish simply to run nbconvert in the usual way: on my local machine I would execute !jupyter nbconvert foo.ipynb in the notebook itself, or jupyter notebook foo.ipynb in a shell. On Google…
muskrat
  • 1,519
  • 11
  • 18
4
votes
3 answers

nbconvert suddenly producing .txt instead of .py

For a while now, I've been happily exporting a Python executable of my Jupyter notebook by running jupyter nbconvert --to script notebook.ipynb which creates notebook.py. OK, actually, I've been executing !jupyter nbconvert --to script…
David Kaufman
  • 989
  • 1
  • 7
  • 20
4
votes
0 answers

How to change Jupyter notebook html output template?

I use jupytherthemes module to change Jupyter notebook theme to solarized. For some reason, I needed to reinstall the Anaconda. After that I was not able to use jupytherthemse and I just used another custom.css file and left it in .jupyter/custom…
Roo
  • 862
  • 1
  • 10
  • 22
4
votes
2 answers

Convert Jupyter notebook to PDF - pdflatex not found on PATH

I'm trying to download my Jupyter notebook as a PDF from the web interface by going to: File -> Download as -> PDF via LaTeX However, I get this error: nbconvert failed: pdflatex not found on PATH I have both pandoc and MacTex installed.…
cyril
  • 2,976
  • 5
  • 19
  • 26
3
votes
0 answers

How to remove the quiet flag in xelatex in nbconvert to pdf

Hello I know when I run jupyter nbconvert --to pdf foo.ipynb it firsts constructs a notebook.tex and required resources and then runs xelatex notebook.tex -quiet However if xelatex crashes, well you end up with: nbconvert.exporters.pdf.LatexFailed:…
3
votes
0 answers

Styling the HTML document created by nbconvert

I try to create a theme for the HTML-file created by nbconvert. In the past it was possible to include a custum.css which was applied to the produced HTML-file. Nowadays jupyterlabs theme structure is completely different and I want to recreate…
TheIdealis
  • 707
  • 5
  • 13
3
votes
3 answers

Running reprexpy on PyCharm CE: ImportError: cannot import name 'contextfilter' from 'jinja2'

I installed reprexpy 0.3.1 on PyCharm CE but when I run it, I get the following error: (...) File "/Users/serena/PycharmProjects/pythonProject2/venv/lib/python3.7/site-packages/nbconvert/exporters/html.py", line 14, in from jinja2…
Emy
  • 817
  • 1
  • 8
  • 25