Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

bs4_book

HTML book built with bootstrap4


Description

This output format is built with bootstrap, using carefully craft features to provide a clean reading experience whether your on a phone, tablet, or desktop.

Some of the main features:

  • Easy customisation of colours and fonts with bslib

  • Built in search (broken down by section) that helps you quickly find what you're looking for.

  • A sidebar containing a within-chapter table of contents that makes navigation easy and helps provide context about your current position within the chapter.

  • Thoughtful typography to make the contents as easy as possible to read, regardless of the size of your device. A sticky header gets out of your way when reading, but is easily accessible if you need it.

  • In-line footnotes mean you can read asides next to the next they refer to. This theme is best paired with a reference style that generates footnotes.

  • R syntax highlighting and autolinking by downlit is paired with a accessible colour scheme designed by Alison Hill.

This theme is designed for books that use one chapter per page.

Usage

bs4_book(
  theme = bs4_book_theme(),
  repo = NULL,
  ...,
  lib_dir = "libs",
  pandoc_args = NULL,
  extra_dependencies = NULL
)

bs4_book_theme(primary = "#0068D9", ...)

Arguments

theme

A named list or bslib::bs_theme() object. The default, bs4_book_theme(), resets the base font size to 1rem to make reading easier and uses a primary colour with greater constrast against the background.

repo

Link to repository where book is hosted, used to generate view source and edit buttons. Currently assumes GitHub and that the book is in the root directory of the repo.

lib_dir, pandoc_args, extra_dependencies, ...

Passed on to rmarkdown::html_document().

primary

Primary colour: used for links and background of footer.


bookdown

Authoring Books and Technical Documents with R Markdown

v0.22
GPL-3
Authors
Yihui Xie [aut, cre] (<https://orcid.org/0000-0003-0645-5666>), JJ Allaire [ctb], Albert Kim [ctb], Alessandro Samuel-Rosa [ctb], Andrzej Oles [ctb], Atsushi Yasumoto [ctb] (<https://orcid.org/0000-0002-8335-495X>), Aust Frederik [ctb] (<https://orcid.org/0000-0003-4900-788X>), Bastiaan Quast [ctb], Ben Marwick [ctb], Chester Ismay [ctb], Christophe Dervieux [ctb], Clifton Franklund [ctb], Daniel Emaasit [ctb], David Shuman [ctb], Dean Attali [ctb], Drew Tyre [ctb], Ellis Valentiner [ctb], Frans van Dunne [ctb], Hadley Wickham [ctb], Jeff Allen [ctb], Jennifer Bryan [ctb], Jonathan McPhers [ctb], JooYoung Seo [ctb] (<https://orcid.org/0000-0002-4064-6012>), Joyce Robbins [ctb], Junwen Huang [ctb], Kevin Cheung [ctb], Kevin Ushey [ctb], Kim Seonghyun [ctb], Kirill Muller [ctb], Luciano Selzer [ctb], Matthew Lincoln [ctb], Maximilian Held [ctb], Michael Sachs [ctb], Michal Bojanowski [ctb], Nathan Werth [ctb], Noam Ross [ctb], Peter Hickey [ctb], Pedro Rafael D. Marinho [ctb] (<https://orcid.org/0000-0003-1591-8300>), Romain Lesur [ctb] (<https://orcid.org/0000-0002-0721-5595>), Sahir Bhatnagar [ctb], Shir Dekel [ctb] (<https://orcid.org/0000-0003-1773-2446>), Steve Simpson [ctb], Thierry Onkelinx [ctb] (<https://orcid.org/0000-0001-8804-4216>), Vincent Fulco [ctb], Yixuan Qiu [ctb], Zhuoer Dong [ctb], RStudio, PBC [cph], Bartek Szopka [ctb] (The jQuery Highlight plugin), Zeno Rocha [cph] (clipboard.js library), jQuery Foundation [cph] (jQuery library), jQuery contributors [ctb, cph] (jQuery library; authors listed in inst/resources/AUTHORS), MathQuill contributors [ctb] (The MathQuill library; authors listed in inst/resources/AUTHORS), FriendCode Inc [cph, ctb] (The gitbook style, with modifications)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.