Hao Zhu | 9495658 | 2017-02-21 18:18:29 -0500 | [diff] [blame^] | 1 | ## ----through_pandoc------------------------------------------------------ |
Hao Zhu | e10cfd3 | 2017-02-21 16:41:14 -0500 | [diff] [blame] | 2 | library(knitr) |
| 3 | library(kableExtra) |
| 4 | dt <- mtcars[1:5, 1:2] |
| 5 | colnames(dt)[1] <- c("mpg[note]") |
| 6 | rownames(dt)[2] <- c("Mazda RX4 Wag[note]") |
| 7 | dt[3, 2] <- paste0(dt[3, 2], "[note]") |
| 8 | |
| 9 | kable(dt) %>% |
| 10 | add_footnote(c("footnote 1", "footnote 2", "footnote 3")) |
Hao Zhu | e10cfd3 | 2017-02-21 16:41:14 -0500 | [diff] [blame] | 11 | |
Hao Zhu | 9495658 | 2017-02-21 18:18:29 -0500 | [diff] [blame^] | 12 | ## ----through_latex_plain------------------------------------------------- |
Hao Zhu | e10cfd3 | 2017-02-21 16:41:14 -0500 | [diff] [blame] | 13 | kable(dt, format = "latex") %>% |
| 14 | add_footnote(c("footnote 1", "footnote 2", "footnote 3")) |
Hao Zhu | e10cfd3 | 2017-02-21 16:41:14 -0500 | [diff] [blame] | 15 | |
Hao Zhu | 9495658 | 2017-02-21 18:18:29 -0500 | [diff] [blame^] | 16 | ## ----through_latex_booktabs---------------------------------------------- |
Hao Zhu | e10cfd3 | 2017-02-21 16:41:14 -0500 | [diff] [blame] | 17 | kable(dt, format = "latex", booktabs = T) %>% |
| 18 | add_footnote(c("footnote 1", "footnote 2", "footnote 3")) |
Hao Zhu | e10cfd3 | 2017-02-21 16:41:14 -0500 | [diff] [blame] | 19 | |
Hao Zhu | 9495658 | 2017-02-21 18:18:29 -0500 | [diff] [blame^] | 20 | ## ----through_latex_longtable--------------------------------------------- |
Hao Zhu | c541563 | 2017-02-21 17:16:13 -0500 | [diff] [blame] | 21 | kable(dt, format = "latex", longtable = T, booktabs = T) %>% |
| 22 | add_footnote(c("footnote 1", "footnote 2", "footnote 3")) |
Hao Zhu | 9495658 | 2017-02-21 18:18:29 -0500 | [diff] [blame^] | 23 | |