R Markdown : place an Appendix after the "References" section?

标签 r r-markdown

我正在用 R Markdown 编写一份报告,其中包含引用资料。问题是 R markdown 会自动在报告末尾放置引用。我想在引用文献后面放一个附录,有什么办法吗?我看到 a child document 是可能的但我想把所有东西都放在一个独特的 .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}
}

任何的想法 ?

最佳答案

这在 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 
    

    关于R Markdown : place an Appendix after the "References" section?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58187514/

    相关文章:

    r - 在每组数据之后插入空白行

    r - 带有 ifelse 和两个对象的自定义函数需要以动态方式从正确的列中读取 R

    latex - 在编译为 PDF 和 HTML 的 R Markdown 文件中使用高级引用命令(例如,来自 biblatex/natbib 的 citetitle、citeauthor、footcite)

    r - 双语 Rmarkdown -> LaTeX 文档的自动对齐文本

    r - 在 Shiny /rmarkdown 演示文稿中不显示幻灯片编号?

    r - ggplot2 参数如何工作?

    r - R 中以第一列作为字符求和列联表

    r - Shiny Dashboard 中的数据抑制

    r - 文章中的交叉引用

    r - kable kableExtra,带有超链接的单元格