在引用后包括Rmd附录 [英] Include Rmd appendix after references

查看:56
本文介绍了在引用后包括Rmd附录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的问题与一.我希望在引用后包含附录,因此我在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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆