如何在ipython notebook(jupyter)幻灯片中增加页面宽度

时间:2016-06-10 08:09:38

标签: jupyter-notebook reveal.js nbconvert

在使用

创建的ipython notebook(jupyter)幻灯片中
ipython nbconvert presentation.ipynb --to slides --post serve

图像质量很差,因为它们似乎缩小到页面宽度。如何在演示文稿中增加页面宽度/显示较大的图像?

我找到了部分回答here,但这需要做" - post post"手动部分,我找不到任何文档。

1 个答案:

答案 0 :(得分:4)

经过长时间的搜索,我自己找到了答案:

  1. 复制模板文件

    lib/python2.7/site-packages/nbconvert/templates/html/slides_reveal.tpl

    到笔记本的目录。

  2. 例如,在Reveal.initialize({ })添加

    中自定义它
    width: '80%',
    height: '100%',
    transition: 'concave',
    
  3. 运行

    jupyter nbconvert presentation.ipynb --to slides --template slides_reveal.tpl --post serve
    

    或只是

    jupyter nbconvert presentation.ipynb --to slides --template slides_reveal.tpl
    

    然后直接在浏览器中打开presentation.slides.html。可替换地:

    python -m SimpleHTTPServer
    

    并浏览浏览器

    http://127.0.0.1:8000/presentation.slides.html
    
相关问题