"size" option with highlight in pdf

34 views
Skip to first unread message

Carl Boettiger

unread,
May 27, 2015, 2:52:35 PM5/27/15
to knitr, Melissa Monk
Hi folks,

Does knitr still support the 'size' option in chunk options in .Rmd, or does this only work in .Rnw files?  (see described on Yihui's knitr page, which is a bit unclear as to where this applies) http://yihui.name/knitr/options/

Even with the highlight package installed (suspicious that the feature is deprecated since highlight is not even suggested by knitr anymore), I don't see any effect in my pdf output when using the 'size' option in a .Rmd that is rendered to pdf by rmarkdown.  (Haven't tried a .Rnw)

If not, is there a different way to control the font size of a code chunk in pdf output that anyone can recommend?

Thanks!

Yihui Xie

unread,
May 27, 2015, 3:22:31 PM5/27/15
to Carl Boettiger, knitr, Melissa Monk
Sorry, but the 'size' option only applies to .Rnw (LaTeX) documents.
I'll update the doc shortly.

For R Markdown v2, you probably need to redefine a certain LaTeX
environment that Pandoc uses, and put the definition in the LaTeX
preamble via the in_header option in YAML:
http://rmarkdown.rstudio.com/pdf_document_format.html

Regards,
Yihui
--
Yihui Xie <xiey...@gmail.com>
Web: http://yihui.name
Reply all
Reply to author
Forward
0 new messages