๐ ๐จโ๐ป ๐ YAML in Quarto: The Invisible Heart of Your Documents
.qmd document โ but for many, itโs also the most mysterious.
โ Back to the Programming Reading Guide ๐จโ๐ป
โ Back to the Quarto Section ๐
โ Back to the Programming Section ๐จโ๐ป

1 ๐ ๐จโ๐ป ๐ YAML in Quarto: The Invisible Heart of Your Documents
1.1 Introduction
YAML is the first thing that appears in a .qmd document โ but for many, itโs also the most mysterious.
In this post, we will understand:
- What YAML is
- How it works in
.qmdfiles- Main fields used in Quarto projects
- Practical examples of YAML headers
1.2 What is YAML?
YAML stands for โYAML Ainโt Markup Languageโ โ even though it looks like one.
It is a human-readable format used to declare configurations.
It is simple, indented with spaces (not tabs), and uses key:value pairs.
1.3 Minimal example
---
title: "My Document"
author: "Blog do Marcellini"
format: html
---1.4 Where is YAML Used in Quarto?
At the top of any .qmd file, between --- and ---.
YAML defines how the document will be processed and rendered: title, author, output format, code execution options, cover image, table of contents, and much more.
1.5 Common YAML Fields in Quarto
| Field | Description |
|---|---|
title |
Document title |
author |
Name of the author(s) |
date |
Creation or publication date |
format |
Output format: html, pdf, epub, docx |
editor |
Type of editor used (e.g., visual) |
lang |
Document language (e.g., en-US) |
cover-image |
Cover used for EPUB or PDF |
toc |
Shows the table of contents (true or false) |
execute |
Rules for code execution |
1.6 Complete Example
---
title: "Data Analysis with R"
author: "Blog do Marcellini"
date: 2025-06-23
format: html
lang: en-US
toc: true
execute:
engine: knitr
echo: true
warning: false
message: false
---1.7 Cautions When Using YAML
- โ
Use spaces, never TABs.
- โ
Indentation must be consistent.
- โ
Lists are created with
- item.
- โ
Long text blocks can use
|(to keep line breaks) or>(to join lines).
1.8 Conclusion
YAML may seem like just a technical block at the beginning of a .qmd, but it is the soul of configuration in Quarto.
Mastering YAML is essential for customizing your documents, projects, websites, and books.
โ Back to the Programming Reading Guide ๐จโ๐ป
โ Back to the Quarto Section ๐
โ Back to the Programming Section ๐จโ๐ป
๐ Back to Top
Blog do Marcellini โ Exploring Mathematics, Statistics, and Physics with Rigor and Beauty.
Created by Blog do Marcellini with โค๏ธ and code.
2 ๐ Useful Links
- ๐งโ๐ซ About the Blog
- ๐ป Project GitHub
- ๐ฌ Contact via Email