[R] rmarkdown and font size

MacQueen, Don macqueen1 at llnl.gov
Thu Jun 8 01:57:51 CEST 2017


Suppose I have a file (named "tmp.rmd") containing:


---
title: Test
---

```{r example, echo=FALSE, results='asis'}
tmp <- data.frame(a=1:5, b=letters[1:5])
print( knitr::kable(tmp, row.names=FALSE))
```



And I render it with:

rmarkdown::render('tmp.rmd', output_format=c('html_document','pdf_document'))

I get two files:
  tmp.pdf
  tmp.html

Is there a way to control (change or specify) the font size of the table in the pdf output?
(or of the entire document, if it can't be changed for just the table)

With my actual data, the table is too wide to fit on a page in the pdf output; perhaps if I reduce the font size I can get it to fit.

I would like the html version to still look decent, but I don't care very much what happens to its font size.

Thanks!
-Don

-- 
Don MacQueen

Lawrence Livermore National Laboratory
7000 East Ave., L-627
Livermore, CA 94550
925-423-1062




More information about the R-help mailing list