当我在乳胶文档中使用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)
```

08-19 22:19