有人知道如何将标题页和内容表分开吗?从这个代码中:
---
title: "Title Page"
output:
pdf_document:
toc: true
number_sections: true
---上面的几行代码创建了标题和内容表,但标题封面页和内容表之间没有分离。
我通过添加乳胶符号\newpage和\tableofcontents找到了另一种选择
---
title: "Title Page"
output:
pdf_document
---
\centering
\raggedright
\newpage
\tableofcontents
# header 1
```{r}摘要(Cars)
## header 2
```{r, echo=FALSE}阴谋(汽车)
## header 3
lore ipsum
# header 4
lore ipsum是否有一种无需在以下块中使用乳胶\newpage和\tableofcontents并使用rmarkdown的方法:
---
title: "Title Page"
output:
pdf_document:
toc: true
---发布于 2016-05-18 21:18:52
我在includes:下的选项中使用了三个胶乳文件
---
title: "Title Page"
output:
pdf_document:
toc: true
number_sections: true
includes:
in_header: latex/header.tex
before_body: latex/before_body.tex
after_body: latex/after_body.tex
---before_body文件包含在\begin{document}和标题选项之后,但在开始编写文档正文之前所需的所有选项。在该文件中,只需放置一个\newline,如下所示:
\newpage就是这样!在before_body.tex文件中没有其他内容。那应该管用。
现在,如果我能垂直居中标题页.
发布于 2022-08-02 14:56:18
为了避免干扰tex文件,
首先关闭YAML元数据中的自动toc插入。
---
title: "myTitle"
date: "`r Sys.Date()`"
output:
pdf_document:
toc: no
number_sections: true
urlcolor: blue
editor_options:
chunk_output_type: console
documentclass: report
---然后,在文档中的任何地方添加toc。
{=乳胶}
setcounter{tocdepth}{4}
表中
然后,您可以使用诸如\newpage或\hfill\break等胶乳宏将这个toc放置在任何地方。
---
title: "myTitle"
date: "`r Sys.Date()`"
output:
pdf_document:
toc: no
number_sections: true
urlcolor: blue
editor_options:
chunk_output_type: console
---
\newpage
```{=latex}setcounter{tocdepth}{4}
表中
\newpage

注意:元数据中的documentclass: report将自动将toc与标题分开,但不允许将其与文档的其余部分分开。
https://stackoverflow.com/questions/30972442
复制相似问题