I'd like to have more control over the font size and line spacing used for code chunks and R output via LaTeX. Using the default render_latex(), I see I can set both globally using (in my premable)
\renewenvironment{knitrout}{\small\renewcommand{\baselinestretch}{.85}}{}
...
\begin{document}
But, say there are chunks I'd like to print in \footnotesize, or customize in some other way. I know I can do this with a LaTeX group, but not with the knitrout environment:
{\small
\renewcommand{\baselinestretch}{.85}
<<arth-csv, eval=FALSE, results='asis'>>=
ID,Treatment,Sex,Age,Improved
57,Treated,Male,27,Some
46,Treated,Male,29,None
...
71,Placebo,Female,68,Some
1,Placebo,Female,74,Marked
@
}
Would it be easier to do this using render_listings() and the listings package?
Can I use custom chunk options and chunk hooks to achieve better control?