首页 > 解决方案 > R Markdown:在“参考”部分之后放置一个附录?

问题描述

我正在用 R Markdown 写一份报告,其中包括参考资料。问题是 R markdown 会自动将引用放在报告的末尾。我想在参考文献后面加一个附录,有什么办法吗?我看到可以使用子文档,但我希望将所有内容都放在一个唯一的.Rmd文件中。

下面是一个可重现的例子:

---
title:
author:
date: 
abstract: 

output: 
  pdf_document:
    template: NULL
    number_sections: true
    citation_package: biblatex
bibliography: references.bib
biblio-style: bwl-FU
---

# Partie 1

\cite{greenwood_financial_1989}

<!-- where I would like the references to be -->

# Appendix

bla bla 

这是references.bib文件的内容:

@article{greenwood_financial_1989,
  title = {Financial Development, Growth and the Distribution of Income},
  url = {https://www.nber.org/papers/w3189},
  number = {3189},
  journaltitle = {NBER Working Paper Series},
  date = {1989},
  author = {Greenwood, Jeremy and Jovanovic, Boyan}
}

任何的想法 ?

标签: rr-markdown

解决方案


R Markdown Cookbook(第 3.5.4 节)对此进行了解释。我们可以通过以下方式强制将参考书目打印在特定位置:

# References

<div id="refs"></div>

# Appendix

注意:

  • 如果我们用@id_of_paper(这是 R Markdown 中推荐的方式)引用论文而不是用\cite{id_of_paper}.
  • citation_package: biblatex如果我们在 YAML 中使用,这不起作用

这是我改编的例子:

---
title:
author:
date: 
abstract: 
output: 
  pdf_document:
    template: NULL
    number_sections: true
bibliography: references.bib
biblio-style: bwl-FU
---

# Partie 1

@greenwood_financial_1989


# References

<div id="refs"></div>


# Appendix

bla bla 

推荐阅读