1

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

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

4

1 回答 1

2

我知道实现这一点的两种方法,都只适用于 PDF 文档(即apa6_pdf())。更新:我在pandoc-citeproc下面添加了一种我推荐的方法,因为它不需要新的语法并且适用于 PDF 和 Word 文档。

1.apacite

第一种方法利用apacite包,从而能够使用\nocitemeta. 这种方法的缺点是,据我所知,您需要pandoc-citeproc通过设置停用pandoc: no。这会导致常见的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并引入了一个自定义命令,该命令模仿\nocitemeta来自apacite. 这里的优点是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如下所示(annotation注意R-base:

@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},
}

这是旧的手动方法

在这里,我选择了annotationBibTeX 文件中的字段。然后我使用nociteYAML front matter 中的字段来列出元分析中包含的作品(其他条目需要用 分隔,)。

---
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如下所示(annotation注意R-base:

@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},
}
于 2018-11-06T00:41:03.543 回答