如何使用Rstudio在Rmd中的引用后插入附录? [英] How to insert appendix after references in Rmd using Rstudio?
问题描述
我正在使用Rstudio,从Rmd文件创建pdf/html文档.标题看起来像这样:
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
现在,我有一些部分,然后包括参考.之后,应遵循附录,但我遇到的问题与此处所述完全相同: Pandoc插入附录参考书目之后
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
此线程中有一个固定的解决方案,但我不知道如何直接在RStudio中实现.要获取文档,我只需按下编织html"按钮,并且自己不要运行任何pandoc命令.所以我应该把
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
部分,附录rmd文件应如何显示?
part, and how should the appendix rmd file look like?
推荐答案
rmarkdown手册,您可以使用以下语法:
As noted in the rmarkdown manual, you could use this syntax:
---
output:
html_document:
includes:
after_body: appendix.md
---
这等效于将任意pandoc参数添加到Rmd文件的一般方法:
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"]
---
这篇关于如何使用Rstudio在Rmd中的引用后插入附录?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!