【问题标题】:Inserting title page with image in Rmarkdown to render a pdf document在 Rmarkdown 中插入带有图像的标题页以呈现 pdf 文档
【发布时间】:2015-03-10 11:33:19
【问题描述】:

在Rmarkdown中,以下设置生成pdf文档的上下文:

---
title: "My Report"
author: NDE
output:
  pdf_document:
  fig_caption: true
  toc: true
  highlight: kate
---

我想在打印目录之前插入带有图像的标题页。有什么方法可以实现吗?

【问题讨论】:

  • 检查答案here是使用LaTeX的解决方案

标签: r pdf markdown r-markdown


【解决方案1】:

对我来说,它使用 LaTeX 命令 \clearpage\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\raggedright 命令以使图像在标题页而不是文本居中。

希望对你有用。

【讨论】:

  • @Next Door Engineer:你有没有想过这个问题?
  • @Anna,不。还没有得到这条路线的工作。
猜你喜欢
  • 2016-03-07
  • 2017-01-29
  • 2015-06-06
  • 2016-03-03
  • 2018-08-18
  • 1970-01-01
  • 2010-10-09
  • 1970-01-01
相关资源
最近更新 更多