Dyr og Data

Dynamic documents — YAML

Gavin Simpson

Aarhus University

Mona Larsen

Aarhus University

Wednesday, 19 August 2026

YAML Ain’t Markup Language

YAML is a human-readable data serialization language

Indentation matters — use spaces and 2 or 4 of them

---
title: Hello Quarto
author: Awesome Me
date: 2020-03-26

format:
  html:
    toc: true
  pdf:
    keep_tex: true
  docx: default
---

YAML

Data are typically written as simple key: value pairs

---
title: Hello Quarto
author: Awesome Me
date: 2020-03-26

More complex structures are allowed, but you won’t encounter them typically with Quarto

YAML

Strings don’t need to be quoted…

But, if the string contains any special characters, they must be quoted

---
title: "Me & my cow"
---

You can use ' or " quotes, latter most useful

---
title: "Gavin's amazing paper!"
---

YAML

To nest elements hierarchically we use indendation

2 or 4 spaces are used, not a tab!

---
format:
  html:
    toc: true
  pdf:
    keep_tex: true
  docx: default
---

format is the top level

html, pdf, and docx are second-level elements, etc