Knitr无法正确对齐标题​​和表格

时间:2020-05-19 20:01:42

标签: r-markdown

在rmarkdown中考虑以下reprex

---
title: "Test"
author: "TestUser"
date: "19/05/2020"
output: pdf_document
---

#### **test table**
```{r, eval=TRUE, warning=FALSE, message=FALSE}
library(kableExtra)
library(tidyverse)
head(mtcars) %>%
  kable(format = "latex")
```

This gives the following results

如何防止代码块上方的标题显示在表旁边?

1 个答案:

答案 0 :(得分:0)

想通了

只需放入kable_styling(latex_options = "hold_position")