How to make scrollable slides in an ioslides presentation with rmarkdown How to make scrollable slides in an ioslides presentation with rmarkdown r r

How to make scrollable slides in an ioslides presentation with rmarkdown


Self-answer:

The bit of CSS that will make the slide scrollable (both horizontally and vertically but you just have to remove one line if only vertical scrolling is needed) is:

slides > slide {  overflow-x: auto !important;  overflow-y: auto !important;}

Note that the slide gets a height from ioslide so there is no need to specify a height (and in fact it seems to introduce visual glitches if you do). Using auto instead of scroll makes sure a scrollbar only appears when there is a need.

You can either add this CSS directly in the Rmd in between <style> tags or put the CSS in a separate file (e.g. scrollable_slides.css).

The CSS file can then be added to the Rmd like this (assuming scrollable_slides.css is in the same directory as the Rmd):

---title: "..."output:   ioslides_presentation:    css: 'scrollable_slides.css'runtime: shiny---