在引用后包括Rmd附录 [英] Include Rmd appendix after references
问题描述
我的问题与此一.我希望在引用后包含附录,因此我在yaml中使用after_body
标记,但是我需要能够knit
我的appendix.Rmd
文件.我尝试了以下方法:
My question is linked to this one. I wish to include my appendix after my references so I am using the after_body
tag in my yaml, however I need to be able to knit
my appendix.Rmd
file. I have tried the following:
after_body: "`r knitr::knit('appendix.Rmd')`"
但是,这会尝试在实际报告之前编织appendix.Rmd
文件,因此失败,因为它在内存中没有必需的库或对象.
however this attempts to knit the appendix.Rmd
file before the actual report and therefore fails as it does not have the required libraries or objects in memory.
推荐答案
为了在引用之后添加附录 ,您只需添加一个id为"refs"的div即可,该div告诉pandoc在哪里包含参考部分.例如:
In order to have appendices after the references, you simply include a div with id="refs" which tells pandoc where to include the references section. For example:
```{r, child = "08_discussion.Rmd"}
```
# References
<div id="refs"></div>
```{r, child = "09_appendix.Rmd"}
```
信用: https://twitter.com/tjmahr/status/763435602935095296
这篇关于在引用后包括Rmd附录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!