What is Quarto?
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:
- 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. - Markdown text — everything you learned in the Markdown course: headings, emphasis, lists, links and tables.
- 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:
- Sends each code chunk to R and collects the output.
- Hands the text + results to Pandoc, the universal document converter.
- Writes the final file in your chosen
format—report.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.