How to convert IPython notebooks to PDF and HTML?

前端 未结 18 1365
有刺的猬
有刺的猬 2020-12-12 10:49

I want to convert my ipython-notebooks to print them, or simply send them in html format. I have noticed that there exists a tool to do that already, nbconvert. Although I h

18条回答
  •  执念已碎
    2020-12-12 11:10

    Also pass the --execute flag to get the output

    jupyter nbconvert --execute --to html notebook.ipynb
    jupyter nbconvert --execute --to pdf notebook.ipynb
    

    The best practice is to keep the output out of the notebook for version control, see: Using IPython notebooks under version control

    But then, if you don't pass --execute, the output won't be present in the HTML, see also: How to run an .ipynb Jupyter Notebook from terminal?

    For an HTML fragment without header: How to export an IPython notebook to HTML for a blog post?

    Tested in Jupyter 4.4.0.

提交回复
热议问题