Hao Zhu | 971d89f | 2017-06-07 19:22:47 -0400 | [diff] [blame] | 1 | --- |
| 2 | title: "Untitled" |
Hao Zhu | a31e97f | 2017-06-08 14:55:41 -0400 | [diff] [blame] | 3 | output: |
| 4 | pdf_document: |
| 5 | keep_tex: true |
Hao Zhu | 971d89f | 2017-06-07 19:22:47 -0400 | [diff] [blame] | 6 | --- |
| 7 | |
| 8 | ```{r setup, include=FALSE} |
| 9 | knitr::opts_chunk$set(echo = TRUE) |
| 10 | ``` |
| 11 | |
| 12 | ```{r} |
| 13 | library(tidyverse) |
| 14 | library(knitr) |
| 15 | library(kableExtra) |
| 16 | |
| 17 | dt <- rbind(mtcars, mtcars) |
| 18 | |
Hao Zhu | 7d4a3e3 | 2017-06-08 21:29:13 -0400 | [diff] [blame] | 19 | # kable(dt, "latex", longtable = T, caption="test table") %>% |
| 20 | # add_header_above(c(" ", "a" = 6, "b" = 5)) %>% |
| 21 | # kable_styling(latex_options = "repeat_header") |
Hao Zhu | 971d89f | 2017-06-07 19:22:47 -0400 | [diff] [blame] | 22 | ``` |
Hao Zhu | a31e97f | 2017-06-08 14:55:41 -0400 | [diff] [blame] | 23 | |
| 24 | ```{r} |
Hao Zhu | 7d4a3e3 | 2017-06-08 21:29:13 -0400 | [diff] [blame] | 25 | kable(dt, "latex", longtable = T, caption = "test", booktabs = T) %>% |
| 26 | kable_styling(latex_options = c("striped", "repeat_header"), repeat_header_text = "(...)") |
Hao Zhu | fdec184 | 2017-06-08 17:06:04 -0400 | [diff] [blame] | 27 | ``` |
| 28 | |
| 29 | ```{r} |
| 30 | kable(dt, "latex", longtable = T, booktabs = T) %>% |
| 31 | add_header_above(c(" ", "a" = 6, "b" = 5)) %>% |
| 32 | kable_styling(latex_options = "repeat_header", repeat_header_text = "(cont.)") |
Hao Zhu | a31e97f | 2017-06-08 14:55:41 -0400 | [diff] [blame] | 33 | ``` |