
The first thing you need to do to create a presentation using Quarto via revealjs is to add appropriate format information in the YAML header of the qmd file like below:
---
title: "02-1 Using Quarto to Create Presentations"
format:
revealjs:
theme: [default, ../custom.scss]
fontsize: 1.6em
callout-icon: false
scrollable: true
echo: true
fig-dpi: 400
---Note
format needs to be specified as revealjsrevealjs-specific options below revealjs: (We will look at various options later).You can start a new slide using either # or ##.
Use # (level 1 header)
By default, this creates a new slide with new section title printed left-aligned at the middle of the slide.
Use ## (level 2 header)
By default, this creates a new slide with new slide title printed at the top left corner of the slide.
Direction
Look at the sample_qmd_revealjs.qmd
We have already learned how to do this. The way we include R codes are consistent across different output formats (including presentation with revealjs)!!
Add scrollable: true under revealjs: to make each of the slides scrollable when the contents are too big to present on a screen.
scrollable: true is enabled in this presentation.
you
can
see
that
right?
Try
Hitting the “s” key will generate a pop-up window with speaker view.
You can add a logo with the logo option under revealjs:.
This presentation has the code below in the YAMl and you can see the logo at the bottom-right corner.
You can use
out-width: option to control the size of a figure.fig-align: option to control the alignment of a figure.See here for all the options available.
To set the figure size exactly you can specify all of the four options:
fig-widthfig-heightout-widthout-heightNote
fig- options take numeric numbers and the unit is inch.out- options you need to add in after a numeric number to make them consistent with the fig- options.There are many pre-made themes that you can apply to revealjs presentations. See the list here.
You can set a theme using the theme option in the YAML header like below:
Direction
Try one of the themes listed and see how the theme of the presentation changes.