This R package provides ready-to-use R Markdown and Quarto templates for HTML, PDF, and Microsoft Word output formats. The templates are designed for the Department of Biology, University of Hamburg (UHH), and its Data Science in Biology program, but can be used by anyone — logos and styles are easily customizable via the YAML header.
All templates ship with example text and code for formatting, equations, tables, figures with cross-references, and citations.
For thesis templates see the companion package UHHthesis or the separate Quarto extension.
Available templates
| Template | R Markdown function | Quarto template |
|---|---|---|
| HTML document |
html_doc()
|
html_doc
|
| Simple PDF document |
pdf_doc()
|
pdf_doc
|
| PDF report |
pdf_report()
|
pdf_report
|
| PDF cheat sheet |
pdf_cheatsheet()
|
pdf_cheatsheet
|
| Word document |
word_doc()
|
word_doc
|
The default font is Helvetica. PDF and Word templates also support the University’s own font TheSans UHH (available to UHH members).
Backward compatibility: The old function names
html_simple()andpdf_simple()still work as aliases.
Installation
Install from GitHub:
# Using the package 'pak' (recommended)
if (!require("pak")) install.packages("pak")
pak::pak("uham-bio/UHHformats")
# Alternatively, using 'remotes'
if (!require("remotes")) install.packages("remotes")
remotes::install_github("uham-bio/UHHformats", build_vignettes = TRUE)Required dependencies (rmarkdown, knitr, bookdown) are installed automatically.
Prerequisites
Quarto CLI
For Quarto templates, install the Quarto CLI. To render .qmd files from R, also install the quarto R package:
Pandoc
R Markdown and Quarto use Pandoc to convert documents. RStudio ships with its own Pandoc installation. If you render from the console without RStudio, you need Pandoc installed on your system:
- Installation: https://pandoc.org/installing.html
- Minimum required version: 2.17
LaTeX (for PDF output)
For PDF output you also need a LaTeX distribution. An easy cross-platform option is the tinytex R package:
For other distributions see https://www.latex-project.org/get/.
Learn more
- Getting started (EN) — quick walkthrough of all templates
- Erste Schritte (DE) — deutschsprachige Einführung
- Template gallery — screenshots and demo files for all templates
Useful resources
- R Markdown
- The official R Markdown documentation from RStudio
- R Markdown reference guide
- R Markdown cheatsheet
- The online book R Markdown: The Definitive Guide by Yihui Xie, J. J. Allaire, and Garrett Grolemund
- Quarto
- The official Quarto guide
- Quarto’s Gallery
- LaTeX
- The official LaTeX help and documentation
- The overleaf documentation
- W3Schools Online Web Tutorial for HTML and for CSS
