YAML 标头:
---
subtitle: "subtitle"
title: "title"
output:
pdf_document:
toc: true
toc_depth: 2
number_sections: true
---
Run Code Online (Sandbox Code Playgroud)
这会将目录放在文档的最开头,但我希望将其放在前两页之后。
有谁知道如何管理这个?我不想使用太多的 LaTeX。
我正在运行一个奇怪的结果。我在 Rmarkdown 的文档中插入了一些表格。这是 YAML:
---
output:
pdf_document:
toc: true
toc_depth: 2
number_sections: true
header-includes:
\usepackage{float}
\floatplacement{figure}{H}
\floatplacement{table}{H}
---
Run Code Online (Sandbox Code Playgroud)
第一个块:
{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE,
fig.pos = "H",
fig.width=8,
fig.height=7,
tab.pos = "H",
collapse = TRUE,
message = FALSE,
warning = FALSE,
comment = "#>"
)
knitr::opts_knit$set(root.dir = rprojroot::find_rstudio_root_file())
options(knitr.kable.NA = "-")
Run Code Online (Sandbox Code Playgroud)
表的插入方式如下:
kable(tableX, caption = "Caption", booktabs = TRUE) %>%
row_spec(0, bold=TRUE) %>%
kable_styling(bootstrap_options = "condensed") %>%
column_spec(1, italic = TRUE)
Run Code Online (Sandbox Code Playgroud)
现在,大多数表格都已正确插入,但只有一个表格用乳胶代码打印,\begin{table},然后是\caption{},然后是表格,最后是\end{table}。怎么可能以这种方式打印一张表格,并且代码相同?
谢谢