引用papaja中的元分析来源



我正在写一篇荟萃分析,我想在参考书目中引用荟萃分析中的论文,姓氏前加星号。我可以在引用部分使用nosite函数来包括文本中没有引用的引用,但我还需要添加星号,表示它来自MA。我看到apache包有一个名为\nocitemeta的函数,但这在这里似乎不起作用。

有没有一种简单的方法可以做到这一点?

我知道实现这一点的两种方法,它们都只适用于PDF文档(即apa6_pdf()(更新:我添加了一种pandoc-citeproc方法,建议使用该方法,因为它不需要新的语法,适用于PDF和Word文档。

1.apacite

第一种方法利用apacite封装,从而能够使用nocitemeta。这种方法的缺点是,据我所知,您需要通过设置pandoc: no来停用pandoc-citeproc。这导致常见的pandoc-citeproc引用语法(例如@R-papaja(被忽略。您需要在整个文档中使用apacite语法。

---
title             : "The title"
shorttitle        : "Title"
author: 
- name          : "First Author"
affiliation   : "1"
affiliation:
- id            : "1"
institution   : "Wilhelm-Wundt-University"
bibliography      : ["r-references.bib"]
citeproc          : no
header-includes   :
- usepackage[natbibapa]{apacite}
- bibliographystyle{apacite}
- renewcommand{APACmetastar}{ensuremath{{}^ast}}
documentclass     : "apa6"
classoption       : "man"
output            : papaja::apa6_pdf
---
```{r}
library("papaja")
```
nocitemeta{R-base}
This works: citet{R-papaja}
This doesn't work: @R-papaja
```{r create-r-references}
r_refs(file = "r-references.bib")
```
bibliography{r-references.bib}

2.biblatex

第二种方法受到这个答案的启发,依赖于biblatex,并引入了一个从apacite模仿nocitemeta的自定义命令。这里的优点是pandoc-citeproc引文语法仍然有效。

---
title             : "The title"
shorttitle        : "Title"
author: 
- name          : "First Author"
affiliation   : "1"
corresponding : yes    # Define only one corresponding author
address       : "Postal address"
email         : "my@email.com"
affiliation:
- id            : "1"
institution   : "Wilhelm-Wundt-University"
bibliography      : ["r-references.bib"]
biblio-style      : "apa"
header-includes:
- DeclareLanguageMapping{english}{english-apa}
- DeclareBibliographyCategory{asterisk}
- renewbibmacro*{begentry}{ifcategory{asterisk}{ensuremath{{}^ast}}{}}
- newcommand*{nocitemeta}[1]{nocite{#1}addtocategory{asterisk}{#1}}
output:
papaja::apa6_pdf:
citation_package: biblatex
---

```{r}
library("papaja")
```
nocitemeta{R-base}
Now this works: @R-papaja
```{r create-r-references}
r_refs(file = "r-references.bib")
```
defbibnote{asterisk}{References marked with an asterisk indicate studies included in the meta-analysis.}
printbibliography[title=References,prenote=asterisk]
renewcommand{printbibliography}{}

3.pandoc-citeproc

通过修改默认的APA CSL文件,可以在选定的书目条目前显示星号(或其他指示符(。

更新:papaja现在开箱即用地支持这种方法(请参阅手册(。对于前面的手动方法,请跳过以下内容。

至活动书目注释集annotate_references: yes

---
title             : "The title"
shorttitle        : "Title"
author:
- name          : "First Author"
affiliation   : "1"
bibliography      : ["r-references.bib"]
annotate_references: yes
nocite            : |
@R-base
output            : papaja::apa6_pdf
---
```{r}
library("papaja")
```
@R-papaja
newpage
# References
```{r create_r-references}
r_refs(file = "r-references.bib")
```
begingroup
setlength{parindent}{-0.5in}
setlength{leftskip}{0.5in}
References marked with an asterisk indicate studies included in the meta-analysis.
<div id = "refs"></div>
endgroup

编辑后的BibTeX文件r-references.bib如下所示(注意R-base:的annotation字段

@Manual{R-base,
title = {R: A Language and Environment for Statistical Computing},
author = {{R Core Team}},
organization = {R Foundation for Statistical Computing},
address = {Vienna, Austria},
year = {2018},
url = {https://www.R-project.org/},
annote = {*}
}
@Manual{R-papaja,
author = {Frederik Aust and Marius Barth},
title = {{papaja}: {Create} {APA} manuscripts with {R Markdown}},
year = {2018},
note = {R package version 0.1.0.9842},
url = {https://github.com/crsh/papaja},
}

这是旧的手动方法

在这里,我选择了BibTeX文件中的annotation字段。然后,我使用YAML前端内容中的nocite字段列出荟萃分析中包含的作品(其他条目需要用,分隔(。

---
title             : "The title"
shorttitle        : "Title"
author:
- name          : "First Author"
affiliation   : "1"
bibliography      : ["r-references.bib"]
csl               : "apa6-meta.csl"
nocite            : |
@R-base
output            : papaja::apa6_pdf
---
```{r}
library("papaja")
```
@R-papaja
newpage
# References
```{r create_r-references}
r_refs(file = "r-references.bib")
```
begingroup
setlength{parindent}{-0.5in}
setlength{leftskip}{0.5in}
References marked with an asterisk indicate studies included in the meta-analysis.
<div id = "refs"></div>
endgroup

编辑后的BibTeX文件r-references.bib如下所示(注意R-base:的annotation字段

@Manual{R-base,
title = {R: A Language and Environment for Statistical Computing},
author = {{R Core Team}},
organization = {R Foundation for Statistical Computing},
address = {Vienna, Austria},
year = {2018},
url = {https://www.R-project.org/},
annotation = {meta-analysis}
}
@Manual{R-papaja,
author = {Frederik Aust and Marius Barth},
title = {{papaja}: {Create} {APA} manuscripts with {R Markdown}},
year = {2018},
note = {R package version 0.1.0.9842},
url = {https://github.com/crsh/papaja},
}

最新更新