Include Rmd appendix after references

 ̄綄美尐妖づ 提交于 2019-12-12 07:29:36

问题


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')`"

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.


回答1:


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"}
```

Credit: https://twitter.com/tjmahr/status/763435602935095296



来源:https://stackoverflow.com/questions/41532707/include-rmd-appendix-after-references

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