Hao Zhu | bacd2f3 | 2017-10-11 14:06:36 -0400 | [diff] [blame] | 1 | --- |
| 2 | title: "cell_formatter_pdf" |
| 3 | author: "Hao" |
| 4 | date: "10/11/2017" |
| 5 | output: pdf_document |
| 6 | --- |
| 7 | |
| 8 | ```{r, include=F} |
| 9 | library(knitr) |
| 10 | library(kableExtra) |
| 11 | library(dplyr) |
| 12 | ``` |
| 13 | |
| 14 | ```{r} |
Hao Zhu | 457acb4 | 2017-10-14 17:37:02 -0400 | [diff] [blame^] | 15 | iris[1:10, 1:4] %>% |
| 16 | mutate_all(function(x){ |
| 17 | cell_spec(x, "latex", |
| 18 | background = spec_color(x), |
| 19 | font_size = spec_font_size(x), |
| 20 | color = "white", bold = T) |
| 21 | }) %>% |
| 22 | kable("latex", escape = F, booktabs = T, linesep = "", align = "c") |
Hao Zhu | bacd2f3 | 2017-10-11 14:06:36 -0400 | [diff] [blame] | 23 | ``` |