blob: 54aa8442ed71d34c74ebe825d141b8be031d1af5 [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) %>%
kable_styling(full_width = T) %>%
add_footnote(c("Footnote 1", "Have a good day.", "sss"), notation = "alphabet")
```