How to increase the page width in ipython notebook (jupyter) slides
Asked Answered
V

1

7

In an ipython notebook (jupyter) slideshow created with

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

images are of poor quality because they seem to be scaled down to the page width. How can I increase the page width / display larger images in the presentation?

I found a partial answer here but this requires doing the "--post serve" part manually which I can find no documentation for.

Voigt answered 10/6, 2016 at 8:9 Comment(0)
V
11

After a long search I found the answer myself :

  1. Copy template file from

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

    to the directory of the notebook.

  2. Customize it, for example, in Reveal.initialize({ }) add

    width: '80%',
    height: '100%',
    transition: 'concave',
    
  3. Run

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

    or just

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

    then open presentation.slides.html directly in the browser. Alternatively:

    python -m SimpleHTTPServer
    

    and navigate the browser to

    http://127.0.0.1:8000/presentation.slides.html
    
Voigt answered 14/6, 2016 at 6:49 Comment(1)
Really cool! It took me a long time to figure out where the problem is - and finally you provided the (only one - as far as I know) solution! Many thanks!Erlene

© 2022 - 2024 — McMap. All rights reserved.