Switching off file_scope in rmarkdown v23

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.