How to insert appendix after references in Rmd using Rstudio?

纵然是瞬间 提交于 2019-11-29 19:30:42

问题


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"]
---


来源:https://stackoverflow.com/questions/33148325/how-to-insert-appendix-after-references-in-rmd-using-rstudio

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!