Marcelliniโ€™s Blog
  • Home
  • ๐Ÿงญ Explore
    • ๐Ÿท๏ธ Tags
    • ๐Ÿ“‚ Categories
  • ๐Ÿง  Exact Sciences
    • ๐Ÿงฎ Mathematics
    • ๐Ÿ“Š Statistics
    • ๐Ÿ”ญ Physics
    • ๐Ÿ’ป Programming
  • ๐Ÿ“ Personal Blog
    • ๐Ÿ“ Personal Blog
    • ๐Ÿ‘ค About Me and the Blog
  • ๐Ÿ“˜ Courses
    • ๐Ÿงฎ Math Courses
    • ๐Ÿ“Š Statistics Courses
  • ๐Ÿ—บ๏ธ Site Map
  • PT ๐Ÿ‡ง๐Ÿ‡ท
  • Contact

On this page

  • 1 ๐Ÿ“˜ ๐Ÿ‘จโ€๐Ÿ’ป ๐Ÿ“„ YAML in Quarto: The Invisible Heart of Your Documents
    • 1.1 Introduction
    • 1.2 What is YAML?
    • 1.3 Minimal example
    • 1.4 Where is YAML Used in Quarto?
    • 1.5 Common YAML Fields in Quarto
    • 1.6 Complete Example
    • 1.7 Cautions When Using YAML
    • 1.8 Conclusion
  • 2 ๐Ÿ”— Useful Links

๐Ÿ“˜ ๐Ÿ‘จโ€๐Ÿ’ป ๐Ÿ“„ YAML in Quarto: The Invisible Heart of Your Documents

programming
YAML
Quarto
article
YAML is the first thing that appears in a .qmd document โ€” but for many, itโ€™s also the most mysterious.
Author

Blog do Marcellini

Published

June 29, 2025


โ† Back to the Programming Reading Guide ๐Ÿ‘จโ€๐Ÿ’ป

โ† Back to the Quarto Section ๐Ÿ“„

โ† Back to the Programming Section ๐Ÿ‘จโ€๐Ÿ’ป


YAML

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 .qmd files
  • 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.

Note

Created by Blog do Marcellini with โค๏ธ and code.

2 ๐Ÿ”— Useful Links

  • ๐Ÿง‘โ€๐Ÿซ About the Blog
  • ๐Ÿ’ป Project GitHub
  • ๐Ÿ“ฌ Contact via Email

ยฉ 2025 - Marcelliniโ€™s Blog

 

๐Ÿ“ฌ Contact via Email
๐Ÿ’ป GitHub Repository