2016-06-10 83 views
2

在IPython的筆記本(jupyter)幻燈片與如何增加頁面寬度IPython的筆記本(jupyter)滑到

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

圖像創建的質量很差,因爲他們似乎被縮小到頁面寬度。如何增加頁面寬度/在演示文稿中顯示更大的圖像?

我找到了部分答案here,但這需要手動執行「--post serve」部分,我找不到任何文檔。

回答

3

經過長時間的搜尋,我發現自己的答案後:在筆記本的目錄從

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

  1. 複製模板文件。

  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 
    
相關問題