10:00
Session 5–Revealjs Slides
Setting up a reveal.js presentation in Quarto is easy. You just specify the revealjs
format. From there you can use the usual YAML arguments like title:
, subtitle:
, etc. that you would use in any Quarto document. Here’s a simple example:
Slides are created using the standard markdown syntax. #
gives you a new section, while ##
gives you a new slide. Then you can write text and use -
for bullet points.
<br>
tags where you want the extra space.## Slide 2
<br>
This is the content for my second slide. It is going to have this line and then a line break and then some code.
<br>
::: {.cell}
::: {.cell-output .cell-output-stdout}
[1] 4
:::
:::
If perchance you don’t want a title slide, just eliminate title
, subtitle
, etc. from the YAML header.
There are two ways to get incremental lists. The first is to specify incremental: true
in the YAML header.
The other is to surround the relevant bullet points in a div with the class incremental
.
Or, let’s say you have incremental: true
in the YAML header, but you want to turn it off for a particular slide. In this case, you can use nonincremental
.
revealjs
formatincremental
class to create incremental listsincremental: true
in the YAML headernonincremental
to turn off incremental lists for a particular slide10:00
Sometimes you have too much material to fit on a slide. In this case, you can use the .smaller
or .scrollable
class. You can use curly braces to add these to a particular slide…
Or you can add them to the YAML header to apply them to the entire presentation…
To add an image, you can use the standard markdown syntax.
To control the width of the image, you can use the width
attribute.
To put content in columns, you can create a div with the columns
class.
.smaller
class.scrollable
class insteadwidth
attribute to control the size of the image10:00
If your echo:
is set to false
, then you will just see the output.
But if echo:
is set to true
, then you will see the code and the output…
And just like in a normal HTML document, you can also set these options in the YAML header.
For presentation purposes, you may oly want to show specific lines of code.
To do this, you would use the code-line-numbers
option in the YAML header.
evaluate
options in the YAML header10:00
You can customize the look of your slides by using a different theme, e.g.
You can also add a custom SCSS file to tweak an existing them or create your own:
Quarto offers 20 different syntax highlighting themes. Click here to see the available themes.
You can select your preferred theme by adding highlight-style
to the YAML header, e.g.
You can change the color of your background by adding the background-color
attribute to a slide.
You can change the color of your background by adding the background-color
attribute to a slide.
Similarly, you can add a background image to your slide by adding the background-image
attribute.
Similarly, you can add a background image to your slide by adding the background-image
attribute.
And you can add a background image to the title slide by adding the title-slide-attributes
attribute to the YAML header.
transition: fade
slide-number: true
footer:
to add a footer your slideslogo:
to add a logo to your slideschalkboard: true
to the YAML headernotes
attribute to it.
multiplex: true
to advance slides for your audience ---
title: "Revealjs Slides"
subtitle: "Session 4--Visualizing Data"
footer: "[DRR Website](https://quarto.training)"
logo: images/drr6502-logo.png
format:
revealjs:
theme: [simple, custom.scss]
transition: fade
slide-number: true
chalkboard: true
execute:
echo: false
message: false
warning: false
freeze: auto
---
chalkboard
or multiplex
quarto publish quarto-pub mydocument.qmd