This R package provides ready-to-use HTML output formats and templates for RMarkdown documents. The goal is to produce clean documents “out of the box”, with or without the RStudio IDE.
The package provides several HTML output formats. Click on any image to see an HTML output sample.
downcute chaos is a variation created by Zac Garland. It has a slightly different color theme, and defaults to dark mode. To use it, add a
downcute_theme: "chaos" option in your YAML preamble.
Adapted from the bookdown theme, with Roboto family fonts. Fully responsive with dynamic table of contents and collapsible navigation.
Format taken from the Material design theme for Bootstrap 3. Document is split into pages at each
<h1> header, and the table of contents allows an animated navigation between these pages (you can use the
cards: false preamble parameter to disable the splitting and display all the cards at once).
Adapted from the corresponding
readtheorg theme of the org-html-themes project, fully responsive with dynamic table of contents and collapsible navigation.
Simple and clean template with dynamic table of contents, very similar to the one from the great knitrBootstrap package by Jim Hester.
Simple template, no table of contents. CSS heavily inspired from the default one of the docco project.
|Responsive||Dynamic TOC||Dark mode||Thumbnails / Lightbox||Code folding||Tabsets||Bad joke|
The package also provides RStudio document templates to easily generate an empty and ready to use rmarkdown file with several configuration directives.
You can install the latest stable release from CRAN :
Or the latest development snapshot from GitHub :
install.packages(remotes) # if necessary remotes::install_github("juba/rmdformats")
Just create a new
Rmd file and add the following in your YAML preamble :
Within RStudio , you can also choose
New File... >
R Markdown..., then select
From Template. You should then be able to create a new document from one of the package templates.
Depending on the features provided by the template, you can add the following options to your YAML preamble. Look at the template function help page for a valid list :
fig_width: figures width, in inches
fig_height: figures height, in inches
fig_caption: toggle figure caption rendering
highlight: syntax highlighting
thumbnails: if TRUE, display content images as thumbnails
lightbox: if TRUE, add lightbox effect to content images
gallery: if TRUE, add navigation between images when displayed in lightbox
use_bookdown: if TRUE, will use
rmarkdownfor HTML rendering, thus providing section numbering and cross references.
TRUE(default), use local files for fonts used in the template instead of links to Google Web fonts. This leads to bigger files but ensures that the fonts are available
Example preamble :
html_doccoformat is heavily inspired from the default one of the docco project.
readthedownis adapted from the corresponding
readtheorgtheme of the org-html-themes project, which is itself inspired by the Read the docs Sphinx theme.
materialhas been taken from the Material design theme for Bootstrap 3 project and its presentation page.
robobookis directly derived from the bookdown project template.
downcuteis directly derived from the default theme of the docute project and its adaptation by John Coene for some of its projects documentation.
downcute chaostheme has been created by Zac Garland.
html_cleanstyling and features are very similar to the ones from the knitrBootstrap package by Jim Hester.