9.2 The rmdformats package

Thermdformats package(Barnier 2022) provides several HTML output formats of unique and attractive styles, including:

  • material: A format based on theMaterial design theme for Bootstrap 3. With this format, every first-level section will become a separate page. See Figure9.2 for what this format looks like (“Introduction” and “Including Plots” are two first-level sections).

  • readthedown: It features a sidebar layout. The table of contents is displayed in the sidebar on the left. As you scroll on the page, the current section header will be automatically highlighted (and expanded if necessary) in the sidebar.

  • html_clean: A simple and clean HTML template, with a dynamic table of contents at the top-right of the page.

  • html_docco: A simple template inspired bythe Docco project.

Do not forget thermdformats:: prefix when you use these formats, e.g.,

---output: rmdformats::material---
The Material Design theme in the rmdformats package.

FIGURE 9.2: The Material Design theme in the rmdformats package.

These output formats have some additional features such as responsiveness and code folding. Please refer to the GitHub repository of thermdformats package for more information:https://github.com/juba/rmdformats.

References

Barnier, Julien. 2022.Rmdformats: HTML Output Formats and Templates for Rmarkdown Documents.https://github.com/juba/rmdformats.