【问题标题】:How to increase the page width in ipython notebook (jupyter) slides如何在 ipython 笔记本(jupyter)幻灯片中增加页面宽度
【发布时间】:2016-06-10 08:09:38
【问题描述】:

在使用

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

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

我找到了部分答案 here 但这需要手动执行“--post serve”部分,我找不到任何文档。

【问题讨论】:

    标签: jupyter-notebook reveal.js nbconvert


    【解决方案1】:

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

    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
      

    【讨论】:

    • 真的很酷!我花了很长时间才弄清楚问题出在哪里——最后你提供了(据我所知只有一个)解决方案!非常感谢!
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-11-01
    • 2016-05-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多