Introduction to Quarto


Leykun Getaneh (MSc)

NDMC, EPHI

February 17 - 20, 2026

What is Quarto?

  • Quarto is an open-source scientific and technical publishing system built on Pandoc.
  • Next-generation scientific publishing system
  • Successor to R Markdown with enhanced features
  • Creates dynamic reports, presentations, websites, blog posts, books, and more.
  • Supports multiple languages (R, Python, Julia, Observable)
  • Publish technical content in HTML, PDF, and MS Word

Why Quarto?

  • Multilingual and independent of computational systems
  • Quarto comes “batteries included” straight out of the box
  • Consistent expression for core features
  • Extension system
  • Enable “single-source publishing” — create Word, PDFs, HTML, etc. from one source
  • Use defaults that meet accessibility guidelines
  • In short: Quarto is ready to use from the start, with everything necessary for professional, multi-format publishing included by default.

Installation

  1. Ensure you have R and RStudio installed .
  2. Install Quarto:

Anatomy of a Quarto document

.qmd file format with three components:

  1. YAML: Metadata

  2. Text: Markdown

  3. Code: R, Python, Observable, and Julia

Weave it all together, and you have beautiful, powerful, and useful outputs!

Anatomy of a Quarto document

Metadata: YAML

report.qmd
---
title: "Measles Surveillance: Ethiopia 2025"
format: html
---

Anatomy of a Quarto document

Metadata: YAML

report.qmd
---
title: "Measles Surveillance: Ethiopia 2026"
format: html
---
  • Metadata of your document
  • Demarcated by three dashes (---) on either end
  • Uses key-value pairs in the format key: value

Quarto document

Text: Markdown

report.qmd
---
title: "Measles Surveillance: Ethiopia 2025"
format: html
---

The 2025 National Integrated Measles Supplementary Immunization Campaign (SIAs) 
successfully reached **18.5 million children**. However, as we move through 
**February 2026**, surveillance data indicates localized "pockets" of 
transmission in conflict-affected and drought-prone woredas.

### Current Epidemiological Status

* **National MCV1 Coverage:** 71% (Target: >90%)
* **Key Drivers:** High concentration of "zero-dose" children in border regions.
* **Outbreak Alerts:** 5 active outbreaks reported in the first six weeks of 2026.
  • Markdown is a lightweight language for creating formatted text

Writing Content

  • Use Markdown syntax for formatting text:
    • Bold: **text**
    • Italic: *text*
    • Lists:
      • - Item 1
      • - Item 2

Creating a Quarto Document

  • Create a new file in RStudio: File -> New File -> Quarto Document.
  • Use the following YAML header:
---
title: "Document Title"
author: "Your Name"
format: html
---

Code

report.qmd
---
title: "Measles Surveillance: Ethiopia 2025"
format: html
---

The 2025 National Integrated Measles Supplementary Immunization Campaign (SIAs) 
successfully reached **18.5 million children**. However, as we move through 
**February 2026**, surveillance data indicates localized "pockets" of 
transmission in conflict-affected and drought-prone woredas.

```{r}
#| message: false
library(tidyverse)
measles |>
  ggplot(aes(x = date, y = measles_total)) +
  geom_line(color = "steelblue", linewidth = 0.9)
```
  • Code chunks begin and end with three backticks (usually)
  • Code chunks are identified with a programming language in between {}
  • Code can include optional chunk options, in YAML style, identified by #| at the beginning of the line

Code - Example: Monthly reported measles cases data

  • Embed R code chunks:
```{r}
#| label: setup
#| message: false
library(tidyverse)
```
```{r}
#| label: fig-monthly-cases
#| fig-cap: "Monthly reported measles cases in Ethiopia, 2012-2024"

measles <- read_csv("data/measles_data_final.csv", show_col_types = FALSE)

measles |>
  ggplot(aes(x = date, y = measles_total)) +
  geom_line(color = "steelblue", linewidth = 0.9) +
  geom_point(color = "steelblue", size = 0.6) +
  labs(
    title = "Monthly Measles Cases (2012-2024)",
    x = "Date",
    y = "Total cases (monthly)"
  ) +
  scale_x_date(date_breaks = "2 year", date_labels = "%Y") +
  theme_minimal(base_size = 14) 
```

Figure 1: Monthly reported measles cases in Ethiopia, 2012-2024

Common Chunk Options:

  • #| echo: true (Show the code in the output)
  • #| echo: false (Hide the code, show only the output)
  • #| eval: false (Show the code, but don’t run it)
  • #| include: false (Hide code and results)
  • #| label: fig-plot (A unique label for the chunk)
  • #| fig-cap: "A caption for the figure." (Adds a figure caption)

Rendering and Sharing

  • Render your document: Click the Render button in RStudio.
  • Share as HTML, PDF, or Word document.
  • Use quarto render yourfile.qmd in the terminal for command line rendering.

Exercise

  • Open exercise_1.qmd and run the code chunks (in order).

  • Preview the file.

  • Add a #| include: false chunk option to the first cell. Preview the file and note the differences.

  • In the YAML, rename the author field with your name. Preview the file.

  • Edit the first paragraph to make something bold by surrounding the text with **.

  • Update the YAML to generate a Word document (.docx) format.

  • Render the file to produce the Word document.