简体   繁体   English

如何在 bookdown 中添加参考书目/参考目录

[英]How to add bibliography/references to TOC in bookdown

I have been trying to render my thesis with the bibliography added to the TOC.我一直在尝试使用添加到 TOC 的参考书目来呈现我的论文。 After reading bookdown documentation carefully I have come to the conclusion that I must do the following:仔细阅读 bookdown 文档后,我得出的结论是,我必须执行以下操作:

bookdown::render_book(input = "index.Rmd",output_format = "bookdown::pdf_book", toc_bib = TRUE)

However, "unused argument" error is thrown in the console when I try to use it.但是,当我尝试使用它时,控制台中会抛出“未使用的参数”错误。 Now, the documentation says that the third argument of render_book is the dots (ie ... ) argument and that it gets passed to output_format , so it should work.现在,文档说render_book的第三个参数是dots (ie ... ) 参数并且它被传递给output_format ,所以它应该可以工作。

I'm confused here, why doesn't it work?我在这里很困惑,为什么它不起作用?

以下对我有用:

bookdown::render_book("index.Rmd", "bookdown::pdf_book", output_options=list(toc_bib = TRUE))

You can also add to the YAML in your thesis.Rmd file您还可以在 thesis.Rmd 文件中添加到 YAML

header_includes:
- \usepackage[nottoc,numbib]{tocbibind}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM