在 Rmarkdown 中,以下设置生成 pdf 文档的上下文:
---
title: "My Report"
author: NDE
output:
pdf_document:
fig_caption: true
toc: true
highlight: kate
---
我想在打印目录之前插入带有图像、标题的标题页。我有办法实现它吗?
对我来说,它可以使用 LaTeX 命令\clearpage
and \tableofcontents
:
---
title: "image before toc"
output: pdf_document
---
\centering
![Caption](folder/image.png)
\raggedright
\clearpage
\tableofcontents
# header 1
lore ipsum
## header 2
lore ipsum
## header 3
lore ipsum
# header 4
如果您想要标题页上的目录,只需留下\clearpage
命令出来。
包括我\centering
and \raggedright
命令使图像在标题页上居中,但不在文本上居中。
希望这对你有用。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)