[1] 4
Rendering code and markdown into documents and presentations
April 6, 2026
Quarto uses markdown for text content.
A code chunk is demarcated by triple backticks: ```
These are simply formatted as code (ie monospace font), but are not executed.
```
x <- 2 + 2
print(x)
```
Would be rendered as:
x <- 2 + 2
print(x)
You can write code chunks in any markdown document.
If we want to execute code in our document, we use a code cell:
The triple backticks ``` are used to demarcate a code chunk.
The {r} tells Quarto this is an R code cell.
Quarto can run code in a variety of languages, called “engines”:
You can only use one coding engine in a single document—no mixing languages.
reticulate and JuliaCall, or vice versa with packages specific to each languagePython:
Julia:
Code cells have a variety of settings,
These are set with a special comment #| in the first lines of the code cell:
Code cells have a variety of settings,
Code cells have a variety of settings,
Code cells have a variety of settings,
Instead, you can set the code cell settings for all cells in the YAML.
All of your code cells run in order, in the same R session.
This means you can use variables and packages from prior code cells.
You may want to reference one of your variable values in the text of your document.
Code cells can output figures.
Use fig-cap to set a caption (title).
Use fig-width and fig-height to control the figure size.
There are a couple of options for making presentation slides:
format: beamer
format: revealjs
Individual slides are created with a level-2 header.
Some text on my slide
Some more text.
You can add a pause in your presentation with ...:
Some text.
You can add pauses between bullet points with “incremental lists”:
Some text.
To implement incremental lists, we used a Quarto “div” with the class “incremental”.
These are similar to HTML divs, but are designed to work for all Quarto output formats.
Some Quarto “divs” will only work for a certain output (often HTML), but the goal is they work for as many outputs as possible.
Quarto has a div for callout blocks:
my-slides.qmd
---
title: My Quarto Slides
format: revealjs
---
## Slide 1 Title
Some text.
:::{.callout-tip}
Some text in a callout block.
:::
:::{.callout-warning appearance="default"}
- a bullet point
- a second bullet point
:::
:::{.callout-note title="Note with Title" appearance="default"}
A note with a title.
:::Some text.
Some text in a callout block.
Warning
Note with Title
A note with a title.
Quarto has a div for columns:
Some text.
Some text on the left.
Some text on the right.
You can set a code cell to output in a column:
You can set a code cell to output on the next slide:

embed-resourcesBy default, HTML and RevealJS output does not include all of the resources (e.g. CSS, JS) in the output file.
If you want to share one file with everything included:
This document can then be opened on any computer without needing to worry about sharing multiple files or having internet access.
It does add a lot to the file size and a couple seconds to the rendering.
Quarto extensions are third-party packages that add new features or templates to Quarto.
Two examples for slides:
Click on the links to see examples of each.
Quarto extensions are installed with:
_extensions folderThis means you have to install each extension in each project.
_extensions folder.You can list your extensions with: quarto list extensions