It would be convenient to be able to use a macro to display R output that's long or wide with scroll bars. For example, the head of a data frame with more columns than horizontally fits onto the slide.
To me this sounds like it would be better suited as a feature request to remark which would make it available in xaringan, too, eventually.
It is easy for the content to scroll horizontally, e.g., you can set the max width of pre to 100%, and use the overflow-x property: https://www.w3schools.com/CSSref/css3_pr_overflow-x.asp
Vertical scroll will be tricky, because the available height is usually unknown and you cannot set a fixed height.
Anyway, I think this is more like a question, so please try to ask on StackOverflow instead (with at least tags remarkjs, xaringan and css).
For the record: https://stackoverflow.com/q/50919104/559676
The sydney-xaringan theme defines several classes to support vertical scrolling of code output: https://github.com/garthtarr/sydney_xaringan
I have this working in a custom .css theme, but I also just tested it using the xaringan default with a minimal my-theme.css that just includes the scrolling classes from https://github.com/garthtarr/sydney_xaringan/blob/master/assets/sydney.css. The vertical and horizontal scrolling slide is then (from the sydney example presentation):
.scroll-output[
I tend to think it's best to format the slide such that everything you want to show is visible, however there can be times when the R output is extensive, and it's not important that the whole lot is printable (i.e. won't appear on the pdf version of the slides), but you might want to be able to scroll down interactively during the presentation. This can be done using the .scroll-output[] class.
{r}
step(lm(Fertility~.,data = swiss))
]
There are classes to scroll a smaller number of lines as well (e.g., .scroll-box-8).
Most helpful comment
The sydney-xaringan theme defines several classes to support vertical scrolling of code output: https://github.com/garthtarr/sydney_xaringan
I have this working in a custom .css theme, but I also just tested it using the
xaringandefault with a minimal my-theme.css that just includes the scrolling classes from https://github.com/garthtarr/sydney_xaringan/blob/master/assets/sydney.css. The vertical and horizontal scrolling slide is then (from the sydney example presentation):.scroll-output[
I tend to think it's best to format the slide such that everything you want to show is visible, however there can be times when the R output is extensive, and it's not important that the whole lot is printable (i.e. won't appear on the pdf version of the slides), but you might want to be able to scroll down interactively during the presentation. This can be done using the
.scroll-output[]class.{r} step(lm(Fertility~.,data = swiss))]
There are classes to scroll a smaller number of lines as well (e.g., .scroll-box-8).