如何在 rmakdown Rmd 文件中包含摘要

how to include an abstract in a rmakdown Rmd file

在下面 header 的 .Rmd 文件中,我想包含一个摘要,所以我尝试了标准的 LateX 文章形式,

\abstract{This paper explores a variety of topics related to the question of testing the equality of
covariance matrices in multivariate linear models, particularly in the MANOVA setting. 
The main focus is on graphical methods that can be used to understand features of data related
to this question.}

但是,令人惊讶的是(我知道这看起来很奇怪),我的“参考”部分中的参考文献变得格式错误——参考文献之间没有间距,奇怪的缩进。那么,我怎样才能包含看起来像抽象的东西呢?

我的 YAML header 是:

---
title: "Notes on Testing Equality of Covariance Matrices"
author: "Michael Friendly"
date: '`r format(Sys.time(), "%B %d, %Y")`'
output:
  pdf_document:
    fig_caption: yes
    keep_tex: yes
    number_sections: yes
    includes:
        in_header: mystyles.tex
 csl: apa.csl
bibliography: 
  - "C:/Users/friendly/Dropbox/localtexmf/bibtex/bib/statistics.bib"
  - "C:/Users/friendly/Dropbox/localtexmf/bibtex/bib/graphics.bib"
---

编辑:仔细想想,问题可能是 pandoc-citeproc 在某种程度上被文档中使用 \abstract{} 所做的事情弄糊涂了。

rmarkdown 包现在允许在 YAML 中包含摘要。像这样:

abstract: "This is my abstract."

有关示例,请参阅 this blog post