Questions tagged [nbconvert]

nbconvert tool is Jupyter Notebook Conversion

nbconvert tool is Jupyter Notebook Conversion

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/

225 questions
194
votes
11 answers

How to run an .ipynb Jupyter Notebook from terminal?

I have some code in a .ipynb file and got it to the point where I don't really need the "interactive" feature of IPython Notebook. I would like to just run it straight from a Mac Terminal Command Line. Basically, if this were just a .py file, I…
Vincent
  • 5,422
  • 9
  • 31
  • 55
61
votes
13 answers

convert json ipython notebook(.ipynb) to .py file

How do you convert an IPython notebook file (json with .ipynb extension) into a regular .py module?
Nitesh Selkari
  • 727
  • 2
  • 6
  • 10
58
votes
6 answers

export notebook to pdf without code

I have a large notebook with a lot of figures and text. I want to convert it to a html file. However, I don't want to export the code. I am using the following command ipython nbconvert --to html notebook.ipynb But this option also exports the…
aloha
  • 3,504
  • 5
  • 26
  • 35
36
votes
1 answer

Jupyter (IPython) notebook: Convert an HTML notebook to ipynb

I have converted a Jupyter/IPython notebook to HTML format and subsequently lost the original ipynb file. Is there a simple way to generate the original notebook file from the converted HTML file?
foglerit
  • 6,338
  • 6
  • 37
  • 57
29
votes
3 answers

How to remove heading numbers in Jupyter during pdf conversion?

When I use the heading tags (# ##, etc) using markdown, they are always converted to numbered sections during pdf-latex conversion. How to indicate unnumbered headings in markdown in Jupyter Notebook (IPython)? I realize this can be done by adding a…
Ébe Isaac
  • 8,387
  • 11
  • 48
  • 79
18
votes
2 answers

Stop jupyter notebook wrapping cell contents in pandas html table output

The pandas option max_colwidth controls how many characters will be included in the repr of a dataframe: import string, random import pandas as pd df = pd.DataFrame([''.join(random.choice(string.ascii_lowercase + ' ') for j in range(1000)) for i in…
mike
  • 3,496
  • 1
  • 13
  • 18
10
votes
1 answer

Output widget appears outside tab widget when using nbconvert on jupyter notebook with ipywidgets

I created a notebook which should display plots in a tab widget. As far as I understand, to include something like plots in the tab widget, I need to wrap it in the output widget. In the notebook itself it works but when I convert it to html via…
Benedikt
  • 105
  • 7
10
votes
2 answers

Jupyter notebook matplotlib figures missing in exported pdf

When generating a pdf in jupyter notebook, everything works great, but I would like to keep the inline figures inside the pdf, as well as the notebook. Here is my code: %matplotlib notebook import matplotlib.pyplot as plt import numpy as np from…
9
votes
0 answers

Add newcommand to jupyter which works as markdown AND nbconvert

There are hacks for defining \newcommand in a jupyter markdown cell (just include $\newcommand\whatever$ inside a markdown cell. This doesn't render the code but the new command is active throughout the notebook.) OR when using nbconvert (just…
weymouth
  • 469
  • 5
  • 14
9
votes
3 answers

execute jupyter notebook and keep attached to existing kernel

I know about nbconvert and use it to generate static html or ipynb files with the results output. However, I want to be able to generate a notebook that stays attached to a kernel that I already have running, so that I can do further data…
unsorted
  • 2,614
  • 2
  • 25
  • 37
8
votes
2 answers

Remove cells from Jupyter Notebook with nbconvert

Recommendations mentioned in How to hide one specific cell (input or output) in IPython Notebook? don't work. On Windows I do the following jupyter nbconvert a.ipynb --TagRemovePreprocessor.remove_cell_tags="{'remove_cell'}" but get an…
user764640
  • 131
  • 2
  • 4
8
votes
3 answers

'Missing $ inserted' error message when converting jupyter notebook to pdf with nbconvert

When attempting to convert a jupyter notebook to pdf with the following command: jupyter nbconvert --to pdf "Search and Other Content Finding Features.ipynb" I'm getting an error message: ! Missing $ inserted.
fraxture
  • 4,346
  • 3
  • 32
  • 70
7
votes
4 answers

No template sub-directory with name 'lab' found in the following paths

I am running a python azure function which is running a jupyter notebook via the nbconvert API. This was working for a time, although without deploying new code I have started to get the following error: No template sub-directory with name 'lab'…
Liam Ferris
  • 1,604
  • 15
  • 33
7
votes
1 answer

Nbconvert doesn't display styler dataframe from jupyter notebook

I'm using jupyter nbconvert --to pdf --TemplateExporter.exclude_input=True Scorecard.ipynb to export my notebook to a pdf. Everything runs fine, but when looking in the pdf the dataframes are shown as
user11924246
  • 134
  • 5
7
votes
1 answer

How to Convert a Jupyter Notebook to an Academic Paper Format?

I have a Jupyter notebook containing all of the content I would like to put in an academic paper (text, equations, and plots), together with code which I would like hidden. Does there exist a way to programmatically convert the notebook into a form…
Jason
  • 1,109
  • 2
  • 11
  • 11
1
2 3
14 15