更改RMD摘要的行距? [英] Change line spacing for RMD abstract?

查看:86
本文介绍了更改RMD摘要的行距?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以将YAML标头中指定的摘要的行距更改为单个空格,而将文档的其余部分保留为双倍空格?我的YAML如下:

Is it possible to change the line spacing for the abstract specified in my YAML header to single space, while leaving the rest of the document in double space? My YAML is below:

output:  pdf_document
number_sections: true
title: | 
  | My Title
author: 
- Me
header-includes:
    - \usepackage{setspace}\doublespacing
    - \usepackage{float}
abstract: "My abstract"
keywords: "My keywords"
date: "`r format(Sys.time(), '%B %d, %Y')`"
geometry: margin=1in
fontsize: 12pt
spacing: double
fig_caption: yes
indent: true
---

我已经尝试过像这样包装摘要,但是没有用:

I've tried wrapping the abstract like so, but it did not work:

abstract: 
    - \usepackage{setspace}\singlespacing
"My abstract"
    - \end{singlespacing}

推荐答案

摘要是自动包装的,因此使用\singlespacing就足够了:

The abstract is automatically wrapped, so it is enough to use \singlespacing before it:

---
output:  pdf_document
number_sections: true
title: | 
  | My Title
author: 
- Me
header-includes:
    - \usepackage{setspace}\doublespacing
    - \usepackage{float}
abstract: \singlespacing My abstract which has to be long enough to take multiple
  lines otherwise one does not see the effect of single-spacing.
keywords: "My keywords"
date: "`r format(Sys.time(), '%B %d, %Y')`"
geometry: margin=1in
fontsize: 12pt
fig_caption: yes
indent: true
---


## R Markdown

This is an R Markdown document. Markdown is a simple formatting syntax for
authoring HTML, PDF, and MS Word documents. For more details on using R Markdown
see <http://rmarkdown.rstudio.com>.

结果:

这篇关于更改RMD摘要的行距?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆