This output format function ported a style provided by GitBook (https://www.gitbook.com) for R Markdown. To read more about this format, see: https://bookdown.org/yihui/bookdown/html.html#gitbook-style
Usage
gitbook(
fig_caption = TRUE,
number_sections = TRUE,
self_contained = FALSE,
anchor_sections = TRUE,
lib_dir = "libs",
global_numbering = !number_sections,
pandoc_args = NULL,
extra_dependencies = list(),
...,
template = "default",
split_by = c("chapter", "section", "0", "1", "2", "3", "4", "5", "6", "chapter+number",
"section+number", "0+number", "1+number", "2+number", "3+number", "4+number",
"5+number", "6+number", "rmd", "none"),
split_bib = TRUE,
config = list(),
table_css = TRUE,
code_folding = c("none", "show", "hide")
)Arguments
- fig_caption, number_sections, self_contained, anchor_sections, lib_dir, pandoc_args, code_folding, extra_dependencies, ...
Arguments to be passed to
rmarkdown::html_document()(...not includingtoc, andtheme).- global_numbering
If
TRUE, number figures and tables globally throughout a document (e.g., Figure 1, Figure 2, ...). IfFALSE, number them sequentially within sections (e.g., Figure 1.1, Figure 1.2, ..., Figure 5.1, Figure 5.2, ...). Note thatglobal_numbering = FALSEwill not work withnumber_sections = FALSEbecause sections are not numbered.- template
Pandoc template to use for rendering. Pass
"default"to use the bookdown default template; pass a path to use a custom template. The default template should be sufficient for most use cases. In case you want to develop a custom template, we highly recommend to start from the default template: https://github.com/rstudio/bookdown/blob/master/inst/templates/gitbook.html.- split_by
How to name the HTML output files from the book:
rmduses the base filenames of the input Rmd files to create the HTML filenames, e.g. generatechapter1.htmlforchapter1.Rmd;noneor"0"means do not split the HTML file (the book will be a single HTML file);chapteror"1"means split the file by the first-level headers;sectionor"2"means the second-level headers,"3"-"6"means split the file by the [3-6]-level headers. Forchapter,sectionand"1"-"6", the HTML filenames will be determined by the header ID's, e.g. the filename for the first chapter with a chapter title# Introductionwill beintroduction.html; for"chapter+number","section+number"and"[1-6]+number"the chapter/section (and higher level section) numbers will be prepended to the HTML filenames, e.g.1-introduction.htmland2-1-literature.html.- split_bib
Whether to split the bibliography onto separate pages where the citations are actually used.
- config
A list of configuration options for the gitbook style, such as the font/theme settings.
- table_css
TRUEto load gitbook's default CSS for tables. ChooseFALSEto unload and use customized CSS (for example, bootstrap) via thecssoption. Default isTRUE.
