如何在rmakdown Rmd文件中包含一个抽象

时间:2016-04-02 13:35:08

标签: r rstudio knitr r-markdown pandoc

在带有下面标题的.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.}

但是,令人惊讶的是(我知道这看起来很奇怪),我的References部分中的引用变得格式错误 - 引用之间没有间距,奇怪的缩进。那么,我怎样才能包含一些看似抽象的东西呢?

我的YAML标题是:

---
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{}所做的事情所迷惑。

1 个答案:

答案 0 :(得分:10)

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

abstract: "This is my abstract."

有关示例,请参阅this blog post