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
5
votes
0 answers

How to include two figures horizontally in Jupyter Notebook using LaTeX, ready to export to PDF?

I want to include two figures as shown here. I tried to use the Markdown syntax, however, when exporting to PDF, the two images go out of bounds of the page. Pandoc can't convert HTML to LaTeX and vice versa, so including the figures in HTML also…
Pehy
  • 129
  • 7
5
votes
1 answer

nbconvert: ValueError: No template sub-directory with name 'rst' found in the following paths: [LS OF PATHS]

I am using nbconvert to convert markdown file to pdf. In the code I used writer = nbconvert.RSTExporter() but when render the result with writer.from_notebook_node(), I faced the error: ValueError: No template sub-directory with name 'rst' found in…
Hoa Nguyen
  • 470
  • 6
  • 15
5
votes
0 answers

How to embed images in html using nbconvert export with 'toc' and 'hide input'?

My question is an extension of this one (Combine 'toc' and 'hide input' when using nbconvert html export). The suggested solution works on Win 10 (Anaconda, Jupyter notebook) but the images are saved in a separate directory. I would like to embed…
5
votes
3 answers

Timeout when running iPython nbconvert from command line

I'm trying to automate IPython scripts using batch files and the Windows Task Manager. After much digging I've found that you can use Task Manager to trigger a BAT and through that execute the nbconvert package in order to run the Jupyter Notebook…
5
votes
1 answer

Hide some cells when converting ipython notebook to notebook

I am trying to hide some specific cells when converting an IPython notebook to a notebook. I'd like to use notebooks in class and want to generate 'exercise' notebooks from a master notebook that contains both questions and answers. This post was…
5
votes
4 answers

Right place to put custom nbconvert templates

I've made a custom nbconvert template and want it to be accessible from any folder where I launch nbconvert utility. Where should I put my template? I couldn't find anything in official docs. I have already tried usual places for jupyter configs,…
krvkir
  • 771
  • 7
  • 12
5
votes
1 answer

Combine 'toc' and 'hide input' when using nbconvert html export

I would like to export my Jupyter notebook to html displaying the table of contents (toc2) AND hiding the input cells at the same time in the export. I use a template to hide the code (https://github.com/ihuston/jupyter-hide-code-html), which works…
Zoe_89
  • 93
  • 1
  • 6
5
votes
0 answers

Convert jupyter notebook to html without css

I was wondering if it was possible to convert a notebook to html without the default css, or at least reduce it. I used jupyter nb-convert --to html filename.ipynb This currently generates 11k lines of css, which I think is somewhat excessive.
Frank Vel
  • 1,202
  • 1
  • 13
  • 27
5
votes
2 answers

(Jupyter Notebook) nbconvert PDF via LaTeX custom date and title format

I am using Jupyter Notebook to write up reports very heavy in code and LaTeX. I wish to change the title, date, and the format of them. Precisely, I would like all the text to be in a smaller size, 12 to 14px at the largest. I've spent a few days…
Tyler
  • 51
  • 1
  • 3
5
votes
1 answer

extract all cell data from current Jupyter notebook

Within Jupyter, there's two options to export notebooks to other formats, using nbconvert either on the command-line or as a library. Both require you to pass the original notebook as input (either as a file name or JSON data). What I would like to…
blackgore
  • 157
  • 1
  • 9
5
votes
4 answers

Run Jupyter Notebook (.ipynb) from command line as if it were a .py file

I am authoring a Jupyter notebook on my local machine that will eventually be run on a remote server (which is running Ubuntu). Every time I need to make a change I must export the notebook as a .py file and then call it from the command line of…
beniam
  • 89
  • 1
  • 2
  • 5
5
votes
1 answer

Nbconvertapp doesn't exist

I'm on Ubuntu, I'm using Python 2.7.6 and Ipython 4.0.3. I'm trying to convert a ipynb file to a pdf file. It gives the following error: ipython nbconvert --to pdf mine.ipynb Traceback (most recent call last): File "/usr/bin/ipython", line 6, in…
Duygu
  • 106
  • 1
  • 5
4
votes
1 answer

nbconvert 6: How to customize Latex template

I'm trying to create a nbconvert (6.x) template that slightly modifies the default latex template. I created a "no_header" template in \Miniconda3\share\jupyter\nbconvert\templates\no_header: . +-- no_header | +-- conf.json | +--…
LcdDrm
  • 1,009
  • 7
  • 14
4
votes
1 answer

Jupyter nbconvert: extend reveal.js ; add style and script in header

As the title suggests: I'd like to extend the reveal template of jupyter's nbconvert and add some custom and blocks right before the end of the . I'm currently using Linux and…
FloE
  • 1,166
  • 1
  • 10
  • 19
4
votes
0 answers

nbconvert does not work properly with HTML conversion MacOS

First I want to point out that every time I pip3, everything goes under this PATH /Users/XXX/Library/Python/3.8/bin, that's the same for Jupyter Notebook. If I which jupyter, it will give me this PATH /Users/XXX/Library/Python/3.8/bin/jupyter I have…
Sheldon
  • 169
  • 1
  • 2
  • 12