尽管有 .bib 文件,但 PDF R Markdown 输出中没有参考书目

No bibliography in PDF R Markdown output despite .bib file

我在 R Markdown 中编写文档并想使用 Citava 创建的 .bib 文件添加参考书目。我的基本文件如下:

---
title: "Some text"
bibliography: Test4.bib
---

Some Text

# References

如果我编织我的文档,pdf 输出中文档末尾的引用丢失。我的错误在哪里?

R Markdown 默认只显示文中引用项目的参考书目,如图 here.

如本 GitHub issue 中所述,您可以使用 nocite: '@*' 强制显示参考书目中的所有项目。以下可重现的示例创建了一个包含两个参考书目条目的示例 test.bib,并且没有直接在文本中引用这些条目:

---
title: "Untitled"
output: pdf_document
bibliography: test.bib
---

```{r, include = FALSE}
knitr::write_bib(x = c("rmarkdown", "knitr"), file = "test.bib")
```

Text in which I make no reference to any bibliography.

# References

---
nocite: '@*'
...