After trying to build a PDF that worked ~2 weeks ago, no fuss, on a new machine with a fresh install of R, R studio, bookdown, etc, I have this error:
bookdown
Just something complementary to Yihui's answer. If I added the line options(bookdown.render.file_scope = FALSE) to the R markdown file, it did not work. It worked great if this line was added to the ~/.Rprofile file.
options(bookdown.render.file_scope = FALSE)
~/.Rprofile