Gregor Sturm
Gregor Sturm

Reputation: 2910

What's the difference between `_bookdown.yml`, `_output.yml` and yaml header of the first document?

When authoring a document with bookdown, I am aware of four options to put configuration options:

Now my question:

Upvotes: 4

Views: 1502

Answers (1)

Floris Padt
Floris Padt

Reputation: 906

so far I know...hope others can complete this

First have a look at this high level explanation R markdown next use the hyperlinks provided below which all point to the documentation details

YAML header of the first *.Rmd file

  • can contain additional pandoc parameters as described here.
  • It must contain the following line: site: bookdown::bookdown_site
  • may contain multiple output formats specified by

    output: 
      bookdown::gitbook:
      bookdown::pdf_book:
      bookdown::epub_book:  
    

... but these can also be in the _output.yml as described here all formats should be at the top level, instead of under an output field.

Example

_bookdown.yml

All _bookdown.yml parameters used for generating the book and save the results.

Example

    book_filename: "_book_example"
    repo: https://github.com/<user>/<repo>/ 
    before_chapter_script: ["script1.R"]
    after_chapter_script:  ["script2.R"]
    output_dir: "_book"
    clean: ["deleteme.Rmd"]
    rmd_files: ["index.Rmd", "02-literature.Rmd", "01-intro.Rmd"]
    delete_merged_file: true
    language:
      label: 
        fig: "FIGURE " 
        tab: "TABLE " 
      ui:
        edit: "Edit"
        chapter_name: "Chapter "
    rmd_subdir: ["content/"]

Upvotes: 6

Related Questions