| --- |
| title: "Untitled" |
| output: |
| pdf_document: |
| keep_tex: true |
| --- |
| |
| ```{r setup, include=FALSE} |
| knitr::opts_chunk$set(echo = TRUE) |
| ``` |
| |
| ```{r} |
| library(tidyverse) |
| library(knitr) |
| library(kableExtra) |
| |
| dt <- rbind(mtcars, mtcars) |
| |
| # kable(dt, "latex", longtable = T, caption="test table") %>% |
| # add_header_above(c(" ", "a" = 6, "b" = 5)) %>% |
| # kable_styling(latex_options = "repeat_header") |
| ``` |
| |
| ```{r} |
| kable(dt, "latex", longtable = T, caption = "test", booktabs = T) %>% |
| kable_styling(latex_options = c("striped", "repeat_header"), repeat_header_text = "(...)") |
| ``` |
| |
| ```{r} |
| kable(dt, "latex", longtable = T, booktabs = T) %>% |
| add_header_above(c(" ", "a" = 6, "b" = 5)) %>% |
| kable_styling(latex_options = "repeat_header", repeat_header_text = "(cont.)") |
| ``` |