如何让knitr :: kable表停止浮动?

时间:2017-03-13 12:48:11

标签: r knitr

当我在latex文档中使用y2时,表格会浮动。如何阻止它浮动?

1 个答案:

答案 0 :(得分:7)

longtable = T中使用参数knitr::kable()并在YAML标题中添加\ usepackage{longtable}

---
title: "Using longtable in RMD"
output: pdf_document
date: "`r format(Sys.time(), '%d %B %Y')`"
author: Author
header-includes: 
- \usepackage{longtable}
---

```{r}
knitr::kable(cars, longtable = T)
```