How to insert appendix after references in Rmd usi

2019-02-09 21:46发布

问题:

I am using Rstudio, to create a pdf / html document from an Rmd file. The header looks sth like this:

title: "Title"
author: "Me"
date: "`r format(Sys.time(), '%B %d, %Y')`"
bibliography: bibliography.bib
output:
  html_document:
    toc: true
    number_sections: true

Now, I have some sections, and then include the references. After that, an appendix should follow, but I encounter the exact same problem as described here: Pandoc insert appendix after bibliography

There is a fixed solution in this thread, but I have no idea how I can do that within RStudio directly. To get the document, I just press the "Knit html" button, and do not run any pandoc commands myself. So where should I put the

--include-after-body

part, and how should the appendix rmd file look like?

回答1:

As noted in the rmarkdown manual, you could use this syntax:

---
output:
  html_document:
    includes:
      after_body: appendix.md
---

This is equivalent to the general way to add arbitrary pandoc arguments to a Rmd file:

---
output:
  html_document:
    pandoc_args: ["--include-after-body=appendix.md"]
---