4.3 KiB
binb
Binb is not Beamer: Stylish pdf Presentation from RMarkdown
Motivation
The Beamer package is very popular for making pdf presentation from LaTeX, and also supported from Markdown and RMarkdown. This package provides two custom (LaTeX) themes for Beamer adapted for RMarkdown use:
- Metropolis (formerly
mtheme
) by Matthias Vogelgesang - IQSS by Ista Zahn
The original LaTeX styles been converted to be directly useable from RMarkdown
Example
Metropolis
Consider the following minimal example, adapted from the original minimal example at the bottom of the Metropolis page:
---
title: A minimal example
author: Matthias Vogelgesang
date: \today
institute: Centre for Modern Beamer Themes
output: binb::metropolis
---
# First Section
## First Frame
Hello, world!
It creates a three-page pdf file which we converted into this animated gif (which loses font crispness, sadly):
IQSS
Similarly, for IQSS we use the following input adapting the example above but showing sections and subsections for the nice headings it generates:
---
title: A minimal example
author: Ista Zahn
date: \today
institute: IQSS
output: binb::iqss
---
# First Section
## First Sub-Section
### First Frame
Hello, world!
# Second Section
## Second Subsection
### Second Frame
Another planet!
This creates this pdf file which we converted into this animated gif (also losing font crispness):
Status
The package is (currently) fairly new and not yet on CRAN.
Usage
As the package is not yet CRAN, you must install from GitHub e.g. via
install.packages("remotes") # if needed
remotes::install_github("eddelbuettel/binb")
to install it from CRAN, and then use as a Markdown template via RStudio, or use code such as
library(rmarkdown)
draft("myslides.Rmd", template="metropolis", package="binb", edit=FALSE)
setwd("myslides") ## template creates a new subdir
render("myslides.Rmd")
to create a first draft of a new myslides.Rmd
.
Once installed, the above code examples should work as expected.
Requirements
Beyond the R package dependencies, a working pandoc
binary is needed. RStudio installs
its own copy, otherwise do what is needed on your OS (i.e., something like sudo apt-get install pandoc pandoc-citeproc
).
The Metropolis LaTeX package is used, but we assume that is is installed via TeXLive, MikTeX or another LaTeX bundle. The LaTeX code for the IQSS Beamer Theme is included (adapted for RMarkdown use).
These themse use additional fonts you may need to install:
- Metropolis wants Fira Sans but can proceed with alternate fonts;
- IQSS Beamer Theme really requires Libertinus, see the IQSS Beamer Theme page for details.
If you use Debian or Ubuntu, you can use the informal font packages I created for Fira and Fira Sans and Libertinus, respectively.
Authors
Dirk Eddelbuettel wrote this package. Ista Zahn authored the included IQSS Beamer Theme.
License
GPL-2 for this package.