如何在rmakdown Rmd文件中包含摘要 [英] how to include an abstract in a rmakdown Rmd file

查看:87
本文介绍了如何在rmakdown Rmd文件中包含摘要的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在具有下面标题的.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标头是:

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

有关示例,请参见此博客文章. /p>

In a .Rmd file with the header below, I want to include an abstract, so I tried the standard LateX article form,

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

But, surprisingly (I know this seems weird), the references in my References section become badly formatted -- no spacing between references, odd indentations. So, how can I include something that looks like an abstract?

My YAML header is:

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

Edit: Thinking this over, the problem may be that pandoc-citeproc is somehow confused by something done by using \abstract{} in the document.

解决方案

The rmarkdown package now allows for including an abstract in your YAML. Like so:

abstract: "This is my abstract."

See this blog post for an example.

这篇关于如何在rmakdown Rmd文件中包含摘要的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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