My RMarkdown book contains sections with the same name (e.g., Questions) in several Chapters.
When I build this book with bookdown (0.20) and rmarkdown 2.3 to a gitbook (in RStudio 1.3.959), the pandoc command contains the --file-scope argument. As a consequence, the automatically generated HTML anchors of the sections only add sequence numbers (e.g., #questions-1, #questions-2) within a chapter (hmtl file), not across chapters. All entries in the table of contents to a Questions Section in a later chapter of the book refer to the first Questions Section in the first chapter. I guess this is an unintended side-effect of introducing the file_scope option in rmarkdown 2.3.
Note that this problem does not occur if I build the book with rmarkdown 2.2.
How can I turn the file_scope option off? I did not succeed in turning it off via file_scope: false in _output.yml, _bookdown.yml, or via the YAML of index.RMD.
Thanks, cderv, for the quick response. Apologies for not checking out the bookdown development pages first.
With rmarkdown v2.3 and bookdown v0.20, I can't get options(bookdown.render.file_scope = FALSE) to work if I add it to the first R code chunk in index.Rmd. The --file-scope argument is still added to the pandoc command.
The bookdown development version (0.20.6) does not use the --file-scope argument, as intended. Great!
I think you need to set this option in your R session, before rendering. This is not read from you rmarkdown document when rendering - This is rather an option about bookdown rendering that needs to be set before using bookdown.