Anyone have any idea how to separate Title Page and Table of Content page? From this code:
任何人都知道如何分离标题页和目录页面?从这段代码:
---
title: "Title Page"
output:
pdf_document:
toc: true
number_sections: true
---
The few line of code above creates the Title and Table of Content, but there is no separation between the Title Cover Page and Table of Content.
上面的几行代码创建了标题和内容表,但标题封面和内容列表之间没有分离。
I have found an alternative by adding latex symbols \newpage
and \tableofcontents
:
我通过添加latex symbols \ newpage和\ tableofcontents找到了另一种选择:
---
title: "Title Page"
output:
pdf_document
---
\centering
\raggedright
\newpage
\tableofcontents
# header 1
```{r}
summary(cars)
```
## header 2
```{r, echo=FALSE}
plot(cars)
```
## header 3
lore ipsum
# header 4
lore ipsum
Is there a way without having to use latex \newpage
and \tableofcontents
and use rmarkdown
somewhere in the following block:
有没有办法不必使用latex \ newpage和\ tableofcontents并在以下块中的某处使用rmarkdown:
---
title: "Title Page"
output:
pdf_document:
toc: true
---
1 个解决方案
#1
6
I used a trifecta of latex files in the options under 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
---
The before_body
file contain all of the options you would want AFTER the \begin{document}
and the title options, but BEFORE you start writing the body of your document. In that file, simply place a \newline
, like so:
before_body文件包含\ begin {document}和title选项之后你想要的所有选项,但是在你开始编写文档正文之前。在该文件中,只需放置\ newline,如下所示:
\newpage
That's it! Nothing else in the before_body.tex
file. That should work.
而已! before_body.tex文件中没有其他内容。这应该工作。
Now, if only I could vertically center the title page...
现在,如果只有我可以垂直居中标题页...
#1
6
I used a trifecta of latex files in the options under 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
---
The before_body
file contain all of the options you would want AFTER the \begin{document}
and the title options, but BEFORE you start writing the body of your document. In that file, simply place a \newline
, like so:
before_body文件包含\ begin {document}和title选项之后你想要的所有选项,但是在你开始编写文档正文之前。在该文件中,只需放置\ newline,如下所示:
\newpage
That's it! Nothing else in the before_body.tex
file. That should work.
而已! before_body.tex文件中没有其他内容。这应该工作。
Now, if only I could vertically center the title page...
现在,如果只有我可以垂直居中标题页...