YAML header in each rmd file for preview

I am wondering whether it is possible to create a YAML header in each R Markdown file for preview purpose only?
I tried the following method but rendering of the whole book does not finalize because an error is raised.
With a project organized:

  • bib/01.bib
  • bib/02.bib
  • bib/03.bib
  • index.Rmd
  • 01-introduction.Rmd
  • 02-analysis.Rmd
  • 03-conclusion.Rmd

YAML header sof 01*, 02*, 03* are set to the form:

---
bibliography: bib/0[0-3].bib
---

so that knitting a chapter in a IDE renders the bibliography (useful for preview).

However, rendering the book with bookdown::render_book yields an error because the chapters' YAML header are not ignored in the parsing process.

In other words, is there a way to use YAML headers in each chapter and ignore them when rendering the book?

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.