blob: 382e81eaa8136af85a265a322ac051516817aa63 [file] [log] [blame]
Hao Zhu971d89f2017-06-07 19:22:47 -04001---
2title: "Untitled"
Hao Zhua31e97f2017-06-08 14:55:41 -04003output:
4 pdf_document:
5 keep_tex: true
Hao Zhu971d89f2017-06-07 19:22:47 -04006---
7
8```{r setup, include=FALSE}
9knitr::opts_chunk$set(echo = TRUE)
10```
11
12```{r}
13library(tidyverse)
14library(knitr)
15library(kableExtra)
16
17dt <- rbind(mtcars, mtcars)
18
Hao Zhua31e97f2017-06-08 14:55:41 -040019kable(dt, "latex", longtable = T, caption="test table") %>%
Hao Zhu971d89f2017-06-07 19:22:47 -040020 add_header_above(c(" ", "a" = 6, "b" = 5)) %>%
21 kable_styling(latex_options = "repeat_header")
22```
Hao Zhua31e97f2017-06-08 14:55:41 -040023
24```{r}
Hao Zhufdec1842017-06-08 17:06:04 -040025aaa <- kable(dt, "latex", longtable = T, caption="table2", booktabs = T) %>%
Hao Zhua31e97f2017-06-08 14:55:41 -040026 add_header_above(c(" ", "a" = 6, "b" = 5)) %>%
Hao Zhufdec1842017-06-08 17:06:04 -040027 kable_styling(latex_options = "repeat_header", repeat_header_text = "(...)")
28```
29
30```{r}
31kable(dt, "latex", longtable = T, booktabs = T) %>%
32 add_header_above(c(" ", "a" = 6, "b" = 5)) %>%
33 kable_styling(latex_options = "repeat_header", repeat_header_text = "(cont.)")
Hao Zhua31e97f2017-06-08 14:55:41 -040034```