2
votes

I have been trying to render my thesis with the bibliography added to the TOC. After reading bookdown documentation carefully I have come to the conclusion that I must do the following:

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 (i.e. ...) argument and that it gets passed to output_format, so it should work.

I'm confused here, why doesn't it work?

2
Have you tried list(toc_bib = TRUE)?Frans Rodenburg
Yep. It says: Error in dirname(output_file) : a character vector argument expectedAdrian
Well then, you can turn it into a character vector with quotation marks, like this: bookdown::render_book(input = "index.Rmd",output_format = "bookdown::pdf_book", "toc_bib = TRUE").Frans Rodenburg
No, I'm afraid that won't work. Error: Failed to compile toc_bib = TRUE.tex. See toc_bib = TRUE.log for more info. It treats it like a new tex file.Adrian
Interesting, how about changing the second argument to output_format = "bookdown::pdf_book(toc_bib = TRUE)"?Frans Rodenburg

2 Answers

1
votes

The following works for me:

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

You can also add to the YAML in your thesis.Rmd file

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