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

佐手、 提交于 2019-11-30 15:57:41
Will Holmes

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 <p style="page-break-after:always;"></p>
  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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!