如何解决使用Knitr从Rmarkdown创建PDF时减少上边距
我正在使用knitr和Rmarkdown创建PDF文档,但徽标和标题距离文档顶部远。
如何减少首页的页边距?预先非常感谢。
这是我的代码:
---
title: "Title come here (there is a logo before the title)"
output:
pdf_document:
header-includes:
- \usepackage{titling}
- \pretitle{\begin{center}
- \includegraphics[width=1.5in,height=1.5in]{logo.png}\LARGE\\}
---
解决方法
我找到了一个可行的解决方案(不确定它是否是“干净的”解决方案,但确实可以完成工作):我在- \setlength{\droptitle}{-1.1in}
中添加了负值
---
title: "\\vspace{0.5in} Title here"
output:
pdf_document:
header-includes:
- \usepackage{titling}
- \setlength{\droptitle}{-1.1in}
- \pretitle{\begin{center}
- \includegraphics[height=1.5in]{logo.png}\LARGE\\}
---
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。