# Bookdown output configuration
# See https://bookdown.org/yihui/bookdown/output-formats.html

# EPUB
# See https://rdrr.io/cran/bookdown/man/epub_book.html
epub_book:
  toc: true
  toc_depth: 3
  chapter_level: 2
  cover_image: images/cover.png
  epub_version: epub3

  # Make sure to disable Pandoc's example_lists extension
  # It conflicts with bibliographical citations
  # Check ChangeLog entry from 2024-03-24 on the `ensaios` repository
  md_extensions: -example_lists

# Tufte HTML
tufte:tufte_html:
  toc: true
  toc_depth: 3
  chapter_level: 2
  cover_image: images/cover.png

  # Make sure to disable Pandoc's example_lists extension
  # It conflicts with bibliographical citations
  # Check ChangeLog entry from 2024-03-24 on the `ensaios` repository
  md_extensions: -example_lists

# Gitbook
# See https://rdrr.io/cran/bookdown/man/gitbook.html
bookdown::gitbook:
  config:
    toc:
      collapse: section
    toolbar:
    search:
      engine: fuse
    sharing: no
  fontsettings:
    theme: night
    family: sans
    size: 2
  #split_by: chapter+number
  split_by: chapter

  # Make sure to disable Pandoc's example_lists extension
  # It conflicts with bibliographical citations
  # Check ChangeLog entry from 2024-03-24 on the `ensaios` repository
  md_extensions: -example_lists

# Tufte Book 2
# See https://rdrr.io/cran/bookdown/man/pdf_book.html
bookdown::tufte_book2:
  # Using a custom Tufte Handout template due do the following issues:
  #
  # * Unable to set any other language (! Argument of \str_uppercase:n has an extra }.) #278
  #   https://github.com/Wandmalfarbe/pandoc-latex-template/issues/278
  #
  # * for newest pandoc, only use babel, never polyglossia #20
  #   https://github.com/JensErat/pandoc-scrlttr2/issues/20
  #
  # * Suggestion for improvement: selectable babel for non-pdflatex #794
  #   https://github.com/rstudio/bookdown/issues/794
  #
  # The original tufe-handout.tex template can be found at
  # https://github.com/rstudio/tufte/blob/main/inst/rmarkdown/templates/tufte_handout/resources/tufte-handout.tex
  #
  # Using the patch from
  # https://github.com/idiv-biodiversity/pandoc-cheat-sheet/pull/2
  #
  # Check also
  # https://bookdown.org/yihui/rmarkdown/pdf-document.html#custom-templates-1
  #
  # We may move back to the vanilla template once this issue is fixed upstream.
  template: vendor/bookup/templates/tufte-handout.tex

  includes:
    in_header:   vendor/bookup/structure/book/%%lang%%/00-header.tex
    before_body: vendor/bookup/structure/book/%%lang%%/00-preamble.tex
    after_body:  vendor/bookup/structure/book/%%lang%%/99-end.tex
  toc: true
  toc_depth: 3
  #toc_appendix: true
  #toc_bib: true
  number_sections: true
  keep_tex: true
  latex_engine: "xelatex"

  # The natbib package does not support translating the author separator, only "and" is supported.
  # So better to stick with pandoc-citeproc.
  #
  # Also,
  #
  # > Even if you choose natbib or biblatex for PDF output, all other output
  # > formats will be using pandoc-citeproc. If you use matching styles (e.g.,
  # > biblio-style: apa for biblatex along with csl: apa.csl for
  # > pandoc-citeproc), output to PDF and to non-PDF formats will be very
  # > similar, though not necessarily identical.
  # >
  # > -- https://bookdown.org/yihui/bookdown/citations.html
  #citation_package: "natbib"

  # Memory issues
  # https://community.rstudio.com/t/bookdown-memory-issues-upon-compilation/16829
  #pandoc_args: [ "+RTS", "-K1024m", "-RTS" ]
  #pandoc_args: [ "--variable=geometry:paperwidth=6in,paperheight=9in" ]

  # Make sure to disable Pandoc's example_lists extension
  # It conflicts with bibliographical citations
  # Check ChangeLog entry from 2024-03-24 on the `ensaios` repository
  md_extensions: -example_lists