Generating slides through quarto

Review of quarto basics

Anatomy of a quarto file

Lines 1–5: “YAML” header - this is the space to add information about your file (title, author, date, additional details).

  • Demarcated by three dashes (---)
  • Always appear in key: value format
  • Lots of possible options – see this guide for details.
    • No need to get overwhelmed by the options for now - but good to keep in mind for future projects.

Lines 7–15: R code chunk

  • Demarcated by three ticks, followed by the programming language name (```{r} {code} ```)
  • Lines 8–9 are options for the R code chunk - these control, e.g. whether the code is run or not, how big figures are, etc.
  • Lines 11–15 are standard R code

Lines 16–20: Text in Markdown

  • This is text meant to be read by humans
  • Can customize how text is rendered, e.g. adding * around a word to italicize: *quarto* becomes quarto
  • Read about additional formatting options here

Defining the YAML header for quarto slides

title: "Generating slides through quarto"
format: revealjs
bibliography: references.bib
csl: stylesheet.csl

Customzing appearance

title: "Generating slides through quarto"
format: revealjs
bibliography: references.bib
csl: stylesheet.csl
title: "Generating slides through quarto"
format: 
    revealjs:
      theme: dark
bibliography: references.bib
csl: stylesheet.csl

See here for the default themes available out of the box.

Customzing appearance

  • Endless room for your own customization
title: "Generating slides through quarto"
format: 
    revealjs:
      theme: [dark, my_customization.css]
bibliography: references.bib
csl: stylesheet.csl

See here for instructions on how to customize.

Customizing appearance

  • Option to use other peoples’ themes, or to share your theme with others
  • e.g. “Clean theme”

Customizing appearance

  • Various other options can also go into the YAML header
title: "Generating slides through quarto"
format: 
    revealjs:
      theme: dark
      slide-number: true # can also be "c" "c/t" etc.
bibliography: references.bib
csl: stylesheet.csl

Customizing appearance

  • Various other options can also go into the YAML header
title: "Generating slides through quarto"
format: 
    revealjs:
      theme: dark
      slide-number: true
      chalkboard: TRUE
bibliography: references.bib
csl: stylesheet.csl

Some other YAML options:

transition, width, etc.

Adding content

  • Define new slides with a level two heading (##)
## Slide title

<content of slide>

## Next slide title

<content of slide>

Adding content

  • Add speaker notes
## Slide title

<slide content>

::: {.notes}
Speaker notes go here.
:::

Organizing slides

  • Slides in revealjs can be organized “vertically” or “horizontally”

# Horizontal 1

## Vertical 1

## Vertical 2

## Vertical 3

# Horizontal 2

## Vertical 1

## Vertical 2

## Vertical 3

Showing code in quarto slides

```{r}
plot(1:10)
```

Showing code in quarto slides

Code
```{r}
#| code-fold: show

plot(1:10)
```

Presenting quarto slides

  • HTML slides can be directly presented from your computer

  • Relatively easy to “publish” your HTML onto a website, see here for instructions