Can't print jupyter notebook properly

Viewed 75

I am working on my office computer, which due to security restriction do not allow me to install program (like miktex, ....). So i decided to export my notebook to .html.

As you can see the rendering is not good:

  • Some code is cutted
  • A lot of space is spoiled, there is large blank margin that i would like to see disapear completely, and i do not need the "IN[1]" in front of cell to allow the code to be more visible

How would you do to get an html whose printing display is good ? enter image description here

1 Answers

I'm not sure if following steps meet your requirements.

(Open the terminal in the corresponding path and then execute the command)

Following command exports the .ipynb file to .html file, and by specifying args(TemplateExporter.exclude_input_prompt and TemplateExporter.exclude_out_prompt), the in[] and out[] is ommitted.

jupyter nbconvert --to html --TemplateExporter.exclude_input_prompt=True --TemplateExporter.exclude_output_prompt=True <your_file>.ipynb

TemplateExporter.exclude_input_prompt=True removes the in[] while TemplateExporter.exclude_output_prompt=True removes the out[] from the generated .html file.

Related