Converting xaringan to Quarto RevealJS
Guide for converting xaringan presentations to Quarto RevealJS format.
Overview
Key differences:
- Format:
moon_reader→revealjs - Slide separators:
---→ headers - Incremental:
--→::: {.incremental} - Speaker notes:
???→::: {.notes}
Quick Start
1. Rename File
mv slides.Rmd slides.qmd
2. Update YAML
Xaringan
output:
xaringan::moon_reader:
lib_dir: libs
nature:
highlightStyle: github
Quarto
format:
revealjs:
theme: default
highlight-style: github
3. Convert Slides
Replace --- with headers:
# xaringan
---
# Slide Title
Content
---
# Next Slide
# Quarto
## Slide Title
Content
## Next Slide
YAML Conversion
Basic Presentation
Xaringan
title: "My Presentation"
author: "Jane Doe"
date: "2024-01-15"
output:
xaringan::moon_reader:
css: ["default", "custom.css"]
nature:
ratio: "16:9"
highlightStyle: github
highlightLines: true
countIncrementalSlides: false
Quarto
title: "My Presentation"
author: "Jane Doe"
date: 2024-01-15
format:
revealjs:
theme: default
css: custom.css
slide-number: true
highlight-style: github
code-line-numbers: true
width: 1600
height: 900
Common Options
| xaringan | Quarto RevealJS |
|---|---|
ratio: "16:9" |
width: 1600 / height: 900 |
highlightStyle: github |
highlight-style: github |
highlightLines: true |
code-line-numbers: true |
countdown |
chalkboard: true or timer extension |
autoplay: 30000 |
auto-slide: 30000 |
Slide Separators
xaringan
Uses --- to separate slides:
# First Slide
Content
---
# Second Slide
More content
---
class: center, middle
# Centered Slide
Quarto
Uses headers (level 1 or 2):
# First Slide
Content
## Second Slide
More content
## Centered Slide {.center}
Or with explicit separators:
format:
revealjs:
slide-level: 2
Incremental Reveals
xaringan
Uses -- within a slide:
# Incremental
- ## First point
- ## Second point
- Third point
Quarto
Use incremental class:
## Incremental
::: {.incremental}
- First point
- Second point
- Third point
:::
Or globally:
format:
revealjs:
incremental: true
Per-slide opt-out:
## Non-Incremental {.nonincremental}
- All at once
- All at once
Speaker Notes
xaringan
Uses ???:
# Slide Title
Content here.
???
Speaker notes go here.
They can span multiple lines.
Quarto
Uses notes div:
## Slide Title
Content here.
::: {.notes}
Speaker notes go here.
They can span multiple lines.
:::
Two-Column Layouts
xaringan
.pull-left[
Left content
]
.pull-right[
Right content
]
Quarto
::: {.columns}
::: {.column width="50%"}
Left content
:::
::: {.column width="50%"}
Right content
:::
:::
Slide Classes
xaringan
---
class: inverse, center, middle
# Dark Slide
Quarto
## Dark Slide {.inverse .center .middle}
Or use theme variants.
Background options:
## Slide with Background {background-color="black"}
Code Highlighting
xaringan
```{r, highlight.output=c(1,3)}
# Highlighted output
```
Quarto
```{r}
#| code-line-numbers: "1,3"
# Highlighted lines
```
Or in output:
```{r}
#| output-line-numbers: "1,3"
```
CSS Customization
xaringan
output:
xaringan::moon_reader:
css: ["default", "my-theme.css"]
Quarto
format:
revealjs:
theme: [default, custom.scss]
css: styles.css
Custom SCSS
// custom.scss
$body-bg: #f0f0f0;
$body-color: #333;
$link-color: #007bff;
.reveal h1 {
color: navy;
}
Fragments (Animations)
xaringan
.animated.fadeIn[
Content fades in
]
Quarto
::: {.fragment .fade-in}
Content fades in
:::
```
Fragment types:
- `.fade-in`
- `.fade-out`
- `.fade-up`
- `.highlight-red`
- `.strike`
## Images and Figures
### xaringan
````markdown

.center[

]
Quarto

{fig-align="center"}
Full-Screen Background
## {background-image="image.jpg" background-size="cover"}
Content overlaid on image.
Special Slides
Title Slide
Automatic in Quarto from YAML.
Section Headers
# Section Title {.section}
Thank You Slide
## Thank You! {.center .middle}
Questions?
Common xaringan Features
Countdown Timer
Install extension:
quarto add gadenbuie/countdown
Chalkboard
format:
revealjs:
chalkboard: true
Self-Contained
format:
revealjs:
embed-resources: true