【问题标题】:how to include an abstract in a rmakdown Rmd file如何在 rmakdown Rmd 文件中包含摘要
【发布时间】:2016-07-22 07:13:29
【问题描述】:

在一个.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{} 所做的事情弄糊涂了。

【问题讨论】:

    标签: r rstudio knitr r-markdown pandoc


    【解决方案1】:

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

    abstract: "This is my abstract."
    

    有关示例,请参阅 this blog post

    【讨论】:

    • 这很完美,即使在 YAML 标头中出现摘要令人惊讶。也感谢史蒂夫米勒的博客文章的链接——非常有帮助。
    • 您知道是否有办法将文档中出现的“摘要”一词更改为其他内容(即翻译成另一种语言)?
    • 如果您要生成 HTML 输出,我认为您需要修改模板:请参阅 rmarkdown.rstudio.com/html_document_format.html 中的“自定义模板”。对于 LaTeX 输出,请参阅此页面:tex.stackexchange.com/questions/82993/…
    • 博文中的模板不需要包含摘要。只需将该行放在您的 YAML 中就足够了。
    • 注意: 我注意到当摘要中有逗号并且摘要文本不在引号中时,摘要文本会在逗号处被截断。解决方案当然是将摘要文本放在引号中。这个答案可以做到这一点,但如果你遇到这个,你知道该怎么做。
    猜你喜欢
    • 2016-05-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-11-07
    • 2021-03-26
    • 2016-01-04
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多