gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-05 00:18:27 31 4
gpt4 key购买 nike

在使用创建的 ipython notebook (jupyter) 幻灯片中

ipython nbconvert presentation.ipynb --to slides --post serve

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

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

最佳答案

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

  • 从复制模板文件
    lib/python2.7/site-packages/nbconvert/templates/html/slides_reveal.tpl
    到笔记本的目录。
  • 自定义它,例如,在 Reveal.initialize({ }) 中添加
    width: '80%',
    height: '100%',
    transition: 'concave',

  • 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
  • 关于jupyter-notebook - 如何增加 ipython notebook (jupyter) 幻灯片中的页面宽度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37743144/

    31 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com