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

前端 未结 2 385
-上瘾入骨i
-上瘾入骨i 2020-12-17 04:02

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 t
2条回答
  •  暖寄归人
    2020-12-17 04:28

    I found several places which mentioned including HTML code for the page break in a markdown cell. I got this to work, but only by:

    1. Include HTML for a page break in a markdown cell. The code used was

    2. Export it to HTML with nbconvert. For this, the command line would be jupyter nbconvert --to html YourNotebook.ipynb
    3. I could then open that static HTML file with Chrome.
    4. Finally, choose print from within Chrome and choose save as PDF.

    I tried other methods such as print when viewing the .ipynb file or using nbconvert to go straight to PDF, but none of that worked. Exporting to HTML and then opening the html and saving as PDF did work.

提交回复
热议问题