当我在latex文档中使用y2
时,表格会浮动。如何阻止它浮动?
答案 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)
```