【发布时间】:2019-06-10 20:37:57
【问题描述】:
我正在写一份数据分析报告。在我的封面上,我想在标题下方和作者上方的空白处插入一张图片。
我的代码如下所示。
---
title: \vspace{1in}"Title"
header-includes:
- \usepackage{fancyhdr}
- \usepackage{titling}
- \pretitle{\begin{center}\LARGE\includegraphics[width=2cm, height=3cm]{logo.png}\\[\bigskipamount]}
- \posttitle{\end{center}}
- \fancyfoot[C]{Insert Department Name Here}
- \fancypagestyle{plain}{\pagestyle{fancy}}
author:
- \vspace{4in}
- \emph{Author}
- \emph{optional Author 2 or contact information}
date: \vspace{1in}\emph{Date}
geometry: left=.5in,right=.5in,top=1in,bottom=1in
mainfont: Times New Roman
output:
pdf_document:
highlight: tango
toc: true
toc_depth: 4
number_sections: true
fig_caption: true
df_print: kable
fontsize: 11pt
---
它生成以下输出:
由于我已成功添加徽标,因此我尝试将相同行的副本放在我的代码中的不同位置,但我要么收到错误提示它无法编译(当我尝试编织到 pdf 时)或者图像不显示。
【问题讨论】:
标签: r pdf latex yaml r-markdown