blob: 2c489a3261c03659db94c0dee0039981f941ce68 [file] [log] [blame]
Hao Zhue10cfd32017-02-21 16:41:14 -05001---
2title: add_footnote - PDF
3output: pdf_document
4---
5
6# Through Pandoc
7```{r through_pandoc}
8library(knitr)
9library(kableExtra)
10dt <- mtcars[1:5, 1:2]
11colnames(dt)[1] <- c("mpg[note]")
12rownames(dt)[2] <- c("Mazda RX4 Wag[note]")
13dt[3, 2] <- paste0(dt[3, 2], "[note]")
14
15kable(dt) %>%
16 add_footnote(c("footnote 1", "footnote 2", "footnote 3"))
17```
18
19# Through LaTeX
20## Plain LaTeX
21```{r through_latex_plain}
22kable(dt, format = "latex") %>%
23 add_footnote(c("footnote 1", "footnote 2", "footnote 3"))
24```
25
26## LaTeX + booktabs
27```{r through_latex_booktabs}
28kable(dt, format = "latex", booktabs = T) %>%
29 add_footnote(c("footnote 1", "footnote 2", "footnote 3"))
30```
31
32## LaTeX + longtable
33```{r through_latex_longtable}
34kable(dt, format = "latex", longtable = T)
35
36# %>%
37# add_footnote(c("footnote 1", "footnote 2", "footnote 3"))
38```