How to convert IPython notebooks to PDF and HTML?

前端 未结 18 1389
有刺的猬
有刺的猬 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条回答
  •  旧时难觅i
    2020-12-12 11:15

    Only this answer would be useful to you if you have math, scientific formulae in your document. Even if you don't have them it works fine.

    • Install LaTeX
    • Install nbconvert

    GUI way

    • open the jupyter notebook
    • Go to Files > Download as > HTML or PDF via LaTeX

    • Then check your Downloads folder for the file. PS: If LaTeX had any errors while compiling the PDF, it will fail. If this happens, download the HTML file and then use http://webpagetopdf.com/ or any other similar service to convert the HTML to PDF.

    Command-Line way

    • Open the terminal
    • Navigate to the folder containing the jupyter notebook
    • type "jupyter nbconvert --to pdf your_jupyter_notebook.ipynb " PS: If it fails, try Yogesh's answer

提交回复
热议问题