blob: 86bb0af6725125c8ecb2fbd497f7549672f2caa9 [file] [log] [blame]
---
title: "add_footnote - PDF"
output: pdf_document
---
# Through Pandoc
```{r through_pandoc}
library(knitr)
library(kableExtra)
dt <- mtcars[1:5, 1:2]
colnames(dt)[1] <- c("mpg[note]")
rownames(dt)[2] <- c("Mazda RX4 Wag[note]")
dt[3, 2] <- paste0(dt[3, 2], "[note]")
kable(dt) %>%
add_footnote(c("footnote 1", "footnote 2", "footnote 3"))
```
# Through LaTeX
## Plain LaTeX
```{r through_latex_plain}
kable(dt, format = "latex") %>%
add_footnote(c("footnote 1", "footnote 2", "footnote 3"))
```
## LaTeX + booktabs
```{r through_latex_booktabs}
kable(dt, format = "latex", booktabs = T) %>%
add_footnote(c("footnote 1", "footnote 2", "footnote 3"))
```
## LaTeX + longtable + booktabs
Centered Table + page footnotes
```{r through_latex_longtable}
kable(dt, format = "latex", longtable = T, booktabs = T) %>%
add_footnote(c("footnote 1", "footnote 2", "footnote 3"))
```
## LaTeX + longtable
Centered Table + page footnotes
```{r}
kable(dt, format = "latex", longtable = T) %>%
add_footnote(c("footnote 1", "footnote 2", "footnote 3"))
```
```{r}
kable(dt, format = "latex", booktabs = T, longtable = T) %>%
add_footnote(c("Footnote 1", "Have a good day."), notation = "alphabet")
```