gpt4 book ai didi

yaml - 更改 RMD 摘要的行距?

转载 作者:行者123 更新时间:2023-12-02 22:20:30 29 4
gpt4 key购买 nike

是否可以将 YAML header 中指定的摘要的行距更改为单倍行距,同时将文档的其余部分保留为双倍行距?我的 YAML 如下:

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
---

我尝试像这样包装摘要,但它不起作用:

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

最佳答案

摘要会自动换行,因此在其前面使用 \singlespacing 就足够了:

---
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>.

结果:

enter image description here

关于yaml - 更改 RMD 摘要的行距?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52118202/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com