A minimal and elegant presentation theme
08 September, 2024
Before we dive a bit deeper, here is a simple example of the clean theme in action.
Next, we’ll take a brief tour of some theme components.
R libraries
While the clean theme is language agnostic, we will use several R coding examples in this demo to highlight some advanced theme features.
You will need the following libraries if you’d like to render the template “as-is”:
TinyTex
While reveal.js presentations are HTML format, we will show an example of how to embed LaTeX tables as images. This requires a working Tex distribution, of which TinyTex provides by far the easiest and lightest integration with Quarto. More details here.
Here we have an unordered list.
And next we have an ordered one.
To emphasize specific words or text, you can:
.alert
class, e.g. important note..fg
class for custom colour, e.g. important note..bg
class for custom background, e.g. important note..fragment
Fragments are a way to animate elements onto the slide.
Fade in
Semi fade out
Fade out
Highlight red
Fragments can also be nested.
Fade in > Highlight red > Highlight blue > Semi fade out
Fade in > Highlight red > Semi fade out
To cross-reference, you have several options, for example:
.button
class provided by this theme, e.g. AppendixCitations follow the standard Quarto format and be sourced from BibLaTex, BibTeX, or CLS files. For example:
Topic 1: Spatial Frictions (Fajgelbaum et al. 2018; Hsieh and Moretti 2019; Moretti 2011)
Topic 2: Blah (Suárez Serrato and Zidar 2016)
Quarto provides dedicated environments for theorems, lemmas, and so forth.
But in presentation format, it’s arguably more effective just to use a Callout Block.
Regression Specification
The main specification is as follows:
\[ y_{it} = X_{it} \beta + \mu_i + \varepsilon_{it} \]
Here is a long sentence that will wrap onto the next line as it hits the column width, and continue this way until it stops.
Some other text in another column.
A second paragraph.
Multicolumn support is very flexible and we can continue with a single full span column in the same slide.
Note that sub- and multi-panel figures are also natively supported by Quarto. See here.
tabset
Quarto offers excellent table support, with further customization via user libraries. Let’s illustrate with a regression example:
#| echo: true
library(fixest)
mods = feols(
rating ~ complaints + privileges + learning + csw0(raises + critical) + advance,
data = attitude
)
dict = c("rating" = "Overall Rating",
"complaints" = "Handling of Complaints",
"privileges" = "No Special Priviledges",
"learning" = "Opportunity to Learn",
"raises" = "Performance-Based Raises",
"critical" = "Too Critical",
"advance" = "Advancement")
If you use modelsummary
with this Quarto theme, we advise setting the gt
backend for a cleaner aesthetic. More details here.
fixest
’s powerful native tabling functions were designed for LaTeX output. But we can use the markdown = TRUE
option to make them work with this theme too. (Details here.) Quick notes:
tinytex
& pdftools
packages first.output: asis
.You can use the {.background-image}
container environment to completely fill the slide background with an image.
Ideally, your figure will be the same aspect ratio as the screen that you’re presenting on.
#| out-width: 75%
library(threejs)
# Approximate locations as factors
data(flights)
dest = factor(sprintf("%.2f:%.2f", flights[,3], flights[,4]))
# A table of destination frequencies
freq = sort(table(dest), decreasing=TRUE)
# The most frequent destinations in these data
frequent_destinations = names(freq)[1:10]
# Subset the flight data by destination frequency
idx = dest %in% frequent_destinations
frequent_flights = flights[idx, ]
# Lat/long and counts of frequent flights
ll = unique(frequent_flights[, 3:4])
# Plot frequent destinations as bars, and the flights to and from
# them as arcs. Adjust arc width and color by frequency.
globejs(lat=ll[, 1], long=ll[, 2], arcs=frequent_flights,
# bodycolor="#aaaaff", arcsHeight=0.3, arcsLwd=2,
bodycolor="#fff", arcsHeight=0.3, arcsLwd=2,
arcsColor="#ffff00", arcsOpacity=0.15,
atmosphere=TRUE, color="#fff", pointsize=0.5)
Note: Simple flight data example using threejs
. There are many interactive plotting options beyond this. (More details.)
The Quarto reveal.js clean theme aims to be a minimal and elegant presention theme.
We have highlighted some theme-specific components. But all of the regular reveal.js functionality is supported (chalkboard, etc.)
Install the theme:
Use these demo slides as a template: