Introduction to Quarto

An unified authoring framework for data science

May 2026

Nicolas Casajus

Data scientist
@FRB-CESAB    

Series of courses


   Introduction to Quarto

   Advanced Quarto

   Quarto projects: Websites

   Quarto projects: Blogs

   Quarto projects: Slides

   Publish w/ GitHub Pages

Series of courses


   Introduction to Quarto

   Advanced Quarto

   Quarto projects: Websites

   Quarto projects: Blogs

   Quarto projects: Slides

   Publish w/ GitHub Pages

Motivations

A common problem

In data science, we often separate:

  • code
  • results
  • narrative (explanatory text)


This creates several issues:

  • lack of reproducibility
  • hard maintenance
  • results are disconnected from the code

A common problem

Credits: Ignasi Bartomeus

Literate programming

Paradigm introduced in 1984 by Donald Knuth1


Literate programming is an approach in which code, results and narrative are written together in the same document, so that programs can be understood by humans as well as executed by computers.


Reproducibility



  Quarto and R Markdown are modern implementations of this paradigm

Quarto

What is Quarto?

  • Quarto is an open-source scientific and technical publishing system designed to create reproducible documents, websites, presentations, books, and dashboards

  • Quarto is a CLI software supporting different languages (R, Python, Julia & Observable JS)

  • Quarto is a powerful, flexible and multi-language successor of R Markdown

  • Quarto supports dozens of output formats: HTML, PDF, Word, Slide, eBook, Website, etc.


Credits: Allison Horst

How it works?

  1. Edit a Quarto document (.qmd file) with narrative, metadata and code chunks
  2. Convert this document in a Markdown (.md) file using knitr1
  3. Convert this .md file in the final output using Pandoc2


Credits: Allison Horst

R Markdown vs Quarto

Table: Quick comparison of R Markdown & Quarto
Feature / Aspect R Markdown Quarto
File extension .Rmd .qmd
Primary language support R R, Python, Julia, Observable JS
Execution engine for R knitr knitr
Other languages Limited (Python via reticulate) Jupyter kernels (Python, Julia, etc.)
Output formats1 HTML, PDF, Word HTML, PDF, Word, Reveal.js, Beamer, PowerPoint, dashboards
Project types1 Individual documents Documents, websites, books, dashboards
Cross-references1 Limited, requires bookdown Built-in support for figures, tables, equations, sections
Themes & styling1 Limited Multiple themes, CSS/HTML customization
Chunk options Inline w/ ```{r echo=TRUE} Hashpipe w/ #| echo: true
Rendering R w/ rmarkdown::render() R w/ quarto::render() or CLI w/ quarto render



1 The capabilities of R Markdown can be extended with additional R packages (distill, bookdown, blogdown, xaringan, etc.) but each plugin comes with its own specificity.


  Quarto is an unified system with advanced features

Installation

Quarto is available for different IDE:


  • If you use RStudio or Positron IDE, Quarto is already installed
  • You also need to install both knitr and rmarkdown R packages

The .qmd file

Anatomy of a .qmd file

---
title: "Hello Quarto"
author: "Jane DOE"
date: "2026-05-13"
format: html
---

# Introduction

Quarto is the next-generation replacement for `R Markdown`, and it
can run **R**, **Python**, **Julia**, and **JavaScript** code.


## R Code Example

Here's a simple R code chunk:


```{r}
#| echo: false
#| eval: true

summary(cars)
```

End of the demo.

Anatomy of a .qmd file

---
title: "Hello Quarto"
author: "Jane DOE"
date: "2026-05-13"
format: html
---

# Introduction

Quarto is the next-generation replacement for `R Markdown`, and it
can run **R**, **Python**, **Julia**, and **JavaScript** code.


## R Code Example

Here's a simple R code chunk:


```{r}
#| echo: false
#| eval: true

summary(cars)
```

End of the demo.

YAML header

  • Surrounded by ---
  • Describes document metadata
  • Controls the output format
  • Syntax = key: value

Anatomy of a .qmd file

---
title: "Hello Quarto"
author: "Jane DOE"
date: "2026-05-13"
format: html
---

# Introduction

Quarto is the next-generation replacement for `R Markdown`, and it
can run **R**, **Python**, **Julia**, and **JavaScript** code.


## R Code Example

Here's a simple R code chunk:


```{r}
#| echo: false
#| eval: true

summary(cars)
```

End of the demo.

Formatted text

  • The narrative of the document
  • Use the markdown syntax
    • Headers w/ #, ##, ###, etc.
    • Format w/ **bold**, _italic_, `verbatim`
    • Hyperlink w/ [](url)
    • Image insertion w/ ![caption](image_path)


  Learn more about the Markdown syntax here

Anatomy of a .qmd file

---
title: "Hello Quarto"
author: "Jane DOE"
date: "2026-05-13"
format: html
---

# Introduction

Quarto is the next-generation replacement for `R Markdown`, and it
can run **R**, **Python**, **Julia**, and **JavaScript** code.


## R Code Example

Here's a simple R code chunk:


```{r}
#| echo: false
#| eval: true

summary(cars)
```

End of the demo.

Code chunks

  • Surrounded by ```
  • Specify the language w/ ```r
  • Specify the language & execute the chunk w/ ```{r}
  • Chunk option syntax = #| key: value
    • #| echo: true
    • #| eval: false


  Learn more about chunk options here

Render the output

  • Click on the Render button of RStudio
  • Or, on a terminal, run: quarto render filename.qmd
  • Or, use the shortcut Ctrl + Shift + K
  • Or, with the quarto R package, run quarto::render("filename.qmd")

Credits: Allison Horst

Render the output

---
title: "Hello Quarto"
author: "Jane DOE"
date: "2026-05-13"
format: html
---

# Introduction

Quarto is the next-generation replacement for `R Markdown`, and it
can run **R**, **Python**, **Julia**, and **JavaScript** code.


## R Code Example

Here's a simple R code chunk:


```{r}
#| echo: true
#| eval: true

summary(cars)
```

End of the demo.

Figures

From an external file

In Markdown, the basic syntax to insert a figure is:

![Caption of the figure](relative_path_to_the_file.png)


Quarto provides some options to quickly customize figures

![This is not a pipe](pipe.png){width=50% fig-align="center"}


We can cross-reference figures by adding an ID with the #fig-* prefix

![This is not a pipe](pipe.png){#fig-pipe}


Then, we can refer to this figure by using @fig-* in your narrative

This statement is illustrated well by @fig-pipe.

This statement is illustrated well by Fig. 1.

Advanced layouts

Figure panel

::: {layout-ncol=2}

![Surus](surus.png)

![Hanno](hanno.png)


:::


Advanced layouts

Figure panel

::: {layout-ncol=2}

![Surus](surus.png)

![Hanno](hanno.png)


:::


Subfigures

::: {#fig-elephants layout-ncol=2}

![Surus](surus.png){#fig-surus}

![Hanno](hanno.png){#fig-hanno}

Famous Elephants
:::


Advanced layouts

Multiple Rows

::: {layout-nrow=2}
![Surus](surus.png)

![Hanno](hanno.png)

![Abdul Abbas](abdul-abbas.png)

![Lin Wang](lin-wang.png)
:::









  Learn more about figures here

Figures produced by code chunks

```{r}
#| label: fig-airquality
#| fig-cap: "Temperature and ozone level"
#| fig-width: 8
#| fig-height: 8
#| fig-align: center

library(ggplot2)

ggplot(airquality, aes(Temp, Ozone)) + 
  geom_point() + 
  geom_smooth(method = "loess")
```

Tables

Markdown Tables

| Default | Left | Right | Center |
|---------|:-----|------:|:------:|
| 12      | 12   |    12 |   12   |
| 123     | 123  |   123 |  123   |
| 1       | 1    |     1 |   1    |

: This is Markdown table {#tbl-mdtable}

Markdown Tables

| Default | Left | Right | Center |
|---------|:-----|------:|:------:|
| 12      | 12   |    12 |   12   |
| 123     | 123  |   123 |  123   |
| 1       | 1    |     1 |   1    |

: This is Markdown table {#tbl-mdtable}
Table 1: This is Markdown table
Default Left Right Center
12 12 12 12
123 123 123 123
1 1 1 1


  Learn more about tables here

Tables produced by code chunks

```{r}
#| label: tbl-cars
#| tbl-cap: "Overview of the cars data.frame"

cars |> 
  head() |> 
  knitr::kable()
```

Resources

Resources


Acknowledgments

These slides borrow content from the following resources:

Next time

Series of courses


   Introduction to Quarto

   Advanced Quarto (callout blocks, tabsets, parameters, citations, cross-references, extensions)

   Quarto projects: Websites

   Quarto projects: Blogs

   Quarto projects: Slides

   Publish w/ GitHub Pages