Introduction

This is a Quarto presentation format that is consistent with The University of Warwick’s brand, especially its colours and typography.

It also features the University of Warwick logo on the title slide.

Note

To remove logo from title slide, comment out line 21 in "_extensions/Warwick-Stats-Resources/warwickpres/_extension.yml" (data-background-image: warwick-logo-white.png)

inverse class for section headings

inverse class is also useful for stressing key points.

Colours

There’s a colour for inline code such as x <- c(1, 3, 6) and {.inverse}.

There’s also a colour for short links and full ones like https://quarto.org/docs/presentations/revealjs/.

Colours

There’s a colour for inline code such as x <- c(1, 3, 6) and {.inverse}.

There’s also a colour for short links and full ones like https://quarto.org/docs/presentations/revealjs/.

  • The inline code and link colours change when the inverse class is applied.

Offline fonts

The extension contains local font files for offline use.

To use them:

  • open "_extensions/Warwick-Stats-Resources/warwickpres/_extension.yml"

  • in line 16, swap online_fonts.css for offline_fonts.css

  • uncomment lines 31 and 32:

    format-resources: 
      - offline_fonts

The offline_fonts directory will then appear in the root directory the next time you render the presentation, and the fonts will be available offline.

Code

The extension includes a custom syntax highlighting theme:

library(dplyr)
library(palmerpenguins)

penguins %>%
  mutate(
    long_flipper = case_when(
      species == "Adelie" & flipper_length_mm > 195 ~ TRUE,
      species == "Chinstrap" & flipper_length_mm > 200 ~ TRUE,
      species == "Gentoo" & flipper_length_mm > 225 ~ TRUE,
      TRUE ~ FALSE
    )
  ) %>%
  mutate(
    body_mass_kg = body_mass_g / 1000,
    bill_length_cm = bill_length_mm / 10,
    bill_depth_cm = bill_depth_mm / 10
  )

warwickplots

For plotting, the warwickpres extension goes hand-in-hand with the warwickplots R package, which provides colour palettes and a ggplot2 theme, theme_warwick(), that are also consistent with the University of Warwick’s branding.

https://warwick-stats-resources.github.io/warwickplots/

warwickplots example

library(ggplot2)
library(warwickplots)
library(palmerpenguins)

ggplot(penguins, aes(flipper_length_mm, body_mass_g, group = species)) +
  geom_point(aes(colour = species, shape = species), 
             alpha = 0.8, 
             size = 2) +
  scale_color_palette_d(warwick_palettes$primary) +
  labs(title = "Penguin Size, Palmer Station LTER",
       subtitle = "Flipper length and body mass for **<span style = 'color:#3C1053;'>Adelie</span>**, **<span style = 'color:#6DCDB8;'>Chinstrap</span>** and **<span style = 'color:#CB333B;'>Gentoo</span>** Penguins. This is based on data made available in the **palmerpenguins** R package.",
       caption = "Visualization: Ella Kaye, Data: Gorman, Williams & Fraser (2014) DOI: 10.1371/journal.pone.009008",
       x = "flipper length (mm)",
       y = "body mass (g)") +
  theme_warwick() +
  theme(legend.position = 'none')

warwickplots example

Callouts

There are custom colours for callouts:

Note

A note

Warning

A warning

Important

Something important

Tip

This is a good idea

Caution

Be careful about doing this

Callouts

There are custom colours for callouts:

Note

A note

Warning

A warning

Important

Something important

Tip

This is a good idea

Caution

Be careful about doing this

Columns with backgrounds

Box 1

Use class .col-box-{color} to apply colour box styling, e.g. .col-box-aubergine-light

Box 2

Default height is 450px

Box 3

Columns with backgrounds: tall and short

Colour box styling can be applied to entire columns

This column has class .col-box-aubergine-light-tall

Or to divs within columns to create stacks

This div has class .col-box-teal-light-short

Columns with backgrounds: tall and short

Colour box styling can be applied to entire columns

This column has class .col-box-blue-dark-tall

Or to divs within columns to create stacks

This div has class .col-box-ruby-dark-short

Non-Warwick-specific nice-to-haves

Alignment

There are classes to help with text alignment:

{.center-h} gives horizontally-centered text

{.right} gives right-aligned text

Note

For all revealjs Quarto presentations, applying {.center} to the slide title vertically centers the whole slide.

Sizing

There are classes to help size text by a given percentage:

{.smaller90}, {.smaller80}, {.smaller75} {.smaller70}, {.smaller60}, {.smaller50}

{.larger125}, {.larger150}, {.larger175}, {.larger200}, {.larger250}

More information

You can learn more about Quarto Revealjs presentations at https://quarto.org/docs/presentations/revealjs/

You can learn more about Quarto extensions at https://quarto.org/docs/extensions/

You can find these slides at https://warwick-stats-resources.github.io/warwickpres/