What is Quarto?

A beginner’s introduction to Quarto: the anatomy of a .qmd file, how rendering works, and how Quarto differs from R Markdown.

Quarto is an open-source scientific and technical publishing system. You write a plain-text .qmd document that mixes narrative text with code; Quarto runs the code, captures its output, and assembles everything into a finished HTML page, PDF, Word document, website or slide deck. Because the report is generated from code, it’s fully reproducible — re-render it with new data and every number and figure updates itself.

The anatomy of a .qmd file

Every Quarto document has three kinds of content. Here’s a complete, minimal example:

---
title: "My first report"
format: html
---

## Introduction

This is **narrative text** written in Markdown.

```{r}
x <- c(4, 8, 15, 16, 23, 42)
mean(x)
```

The mean is printed above, straight from the data.

The three parts:

  1. The YAML header — the block fenced by --- at the top. It holds document settings like the title and output format. We cover it in its own lesson.
  2. Markdown text — everything you learned in the Markdown course: headings, emphasis, lists, links and tables.
  3. Code chunks — R (or Python) code fenced with ```{r}. Quarto runs each chunk and inserts the result — a number, a table, or a plot — into the document.

How rendering works

When you click Render in RStudio (or run quarto render report.qmd), Quarto:

  1. Sends each code chunk to R and collects the output.
  2. Hands the text + results to Pandoc, the universal document converter.
  3. Writes the final file in your chosen formatreport.html, report.pdf, and so on.

You edit one source file; Quarto produces the polished document.

Quarto vs R Markdown

If you’ve used R Markdown, Quarto will feel familiar — it’s the next-generation successor from the same team. The big differences:

  • Quarto is language-agnostic (R, Python, Julia, Observable) and ships as a standalone tool, so it doesn’t depend on R packages like rmarkdown.
  • Chunk options are written inside the chunk with the #| “hash-pipe” syntax, rather than in the chunk header.
  • Cross-references, layouts, callouts and websites are built in, not bolted on.

Your existing .Rmd files keep working, and the concepts transfer directly. For a fuller comparison, see Quarto vs R Markdown.


Next: Code chunks → — run R inside your document, live in your browser.