当我在乳胶文档中使用knitr::kable
时,表格将浮动。如何阻止它漂浮?
最佳答案
在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)
```