我一直在Mac上通过RStudio成功使用RMarkdown。
最近升级到RStudio 1.2.5019和tinytex_0.18,现在我的“标题栏”和“第一个正文/标题”之间的垂直间距增加了。
一个简单的示例(故意排除author:
和date:
)是:
---
output:
pdf_document
title: "Example of Title to Body Text"
subtitle: Subtitle Places Here
---
This is the first paragraph (or heading if specified as such). It is quite a way down from the title of the document. How can this be reduced to a "single line" vertical space?
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt.
然后,我尝试使用“ titlesec”包,但无法确定要使用哪个命令来实现所需的结果。尝试的示例是:
---
output:
pdf_document
subparagraph: yes
header-includes: |
\usepackage{titlesec}
\titlespacing{\title}{0pt}{\parskip}{-\parskip}
title: "Example of Title to Body Text"
subtitle: Subtitle Places Here
---
This is the first paragraph (or heading if specified as such). It is quite a way down from the title of the document. How can this be reduced to a "single line" vertical space?
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt.
这就是当前呈现为PDF的外观。
这就是我希望PDF看起来更像的东西(从图形程序编辑)。
那么,如何减小标题栏和文档正文开头之间的垂直间距?
提前致谢。
你可以通过\vspace{}
在第一段之前添加来自LaTeX的命令来减少(副标题)与第一段之间的间隔。
---
output:
pdf_document
subparagraph: yes
header-includes: |
\usepackage{titlesec}
\titlespacing{\title}{0pt}{\parskip}{-\parskip}
title: "Example of Title to Body Text"
subtitle: Subtitle Places Here
---
\vspace{-5truemm}
This is the first paragraph (or heading if specified as such). It is quite a way down from the title of the document. How can this be reduced to a "single line" vertical space?
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt.
我想说一声谢谢!正如我需要的那样,这已经奏效。
很高兴听到您的成功!好吧,别忘了投票,哈哈哈