有没有一种打印jupyter/ipython笔记本幻灯片演示文稿的方法? [英] Is there a way to print a jupyter/ipython notebook slide presentation?
问题描述
是否可以打印出jupyter/ipython笔记本幻灯片的幻灯片?是否可以从nbviewer网站( http://nbviewer.ipython.org )执行操作?
Is there a way to print out a slide deck of a jupyter/ipython notebook slides? Is it possible to do from the nbviewer site (http://nbviewer.ipython.org) ?
我知道我可以打印笔记本的pdf,但是当我这样做时,它没有相同的分页符,也不会跳过我想跳过的所有代码(例如,我不必导入).我想将其作为备份或可打印的讲义.
I know that I can print a pdf of my notebook, but when I do, it doesn't have the same page breaks and doesn't skip all the code that I would like skipped (for example, the libraries I've imported aren't necessary). I'd like to have it as a backup or a printable handout.
推荐答案
您可以尝试以下操作:
jupyter nbconvert --to slides --post serve /path/to/your/notebook.ipynb
这应该启动您的浏览器并提供演示文稿(例如,在http://127.0.0.1:8000/<some-title>.slides.html#/
处)
This should fire up your browser and serve the presentation (e.g at http://127.0.0.1:8000/<some-title>.slides.html#/
)
将网址更改为
http://127.0.0.1:8000/<some-title>.slides.html?print-pdf
如果现在从浏览器中打开打印"对话框,则幻灯片的格式应正确.
If you now open the print dialog from your browser, the slides should have the right formatting.
您应该可以选择从打印机菜单中写入pdf文件,而不是发送至打印机.
Instead of sending to a printer you should be able to choose to write to a pdf file from the printer menu.
我在OSX上的Chrome中对此进行了测试.我认为它可以在所有系统上运行,但是我没有进行测试.
I tested this in chrome on OSX. I assume it works on all systems, but I did not test.
这篇关于有没有一种打印jupyter/ipython笔记本幻灯片演示文稿的方法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!