Bookdown: vertical scrollbar for code chunk?

rstudio
bookdown

#1

Hi everyone,

I'd like to show a code chunk with vertical scrolling embedded in an bookdown section. Is this possible? It appears that horizontal scrolling is automatically implemented.

Thanks!


#2

You may be able to use a knitr hook to implement it html document format. There is one example here, called output_max_height

however, you will only be able to use it for html output. You may tweak it for other format.


#3

Thanks, @cderv. It looks like output_max_height only works for code block output, and not for printing the code itself. I may need to find a css solution