I am working on a multi-author bookdown and the authors will have their own bib files. I think it would be annoying to name them one by one in the index.Rmd file.
I will be putting all the bib files in one folder and I wonder if I can somehow concisely add all bib files from a directory to bookdown in the index.Rmd file.
EDIT: This is not a question asking about multiple bib file. I will tend to have many bib files and I do not want to list all their names by hand.
Thanks in advance for your help.
It may be difficult to add multiple bibs from a folder because pandoc does the heavy lifting when making the bibliography, and pandoc is very finicky about paths. It would be easier to have the bib files in your project folder (i.e., alongside your index.Rmd).
If you can do that then the following would accomplish your goal of not having to list the bib files by name. Simply put this in your index.Rmd yaml:
bibliography: "`r list.files(pattern = '^.+\\.bib$')`"
Additionally, you might want to list all the entries across the bib files whether you cited them or not. If so also add this line to your index.Rmd yaml:
nocite: '@*'