---
title: "Quarto"
description: "Quarto is an open-source scientific and technical publishing system from Posit that renders documents combining prose with R, Python, Julia, or SQL code into reports, websites, and books."
canonical: "https://motherduck.com/glossary/quarto/"
related:
  - title: "DuckLake Architecture Deep Dive"
    url: "https://motherduck.com/blog/ducklake-architecture-deep-dive/"
  - title: "Obsidian | MotherDuck Docs"
    url: "https://motherduck.com/docs/integrations/dev-tools/obsidian/"
  - title: "Querio - MotherDuck"
    url: "https://motherduck.com/ecosystem/querio/"
gated_asset:
  title: "DuckLake on MotherDuck"
  url: "https://motherduck.com/product/ducklake/"
---

# Quarto

> Quarto is an open-source scientific and technical publishing system from Posit that renders documents combining prose with R, Python, Julia, or SQL code into reports, websites, and books.

## Overview

Quarto is a multi-language publishing system built by Posit (the company behind RStudio) as a successor to R Markdown, extended to work across R, Python, Julia, and Observable JS in a single ecosystem. A Quarto document mixes narrative text with executable code chunks; running `quarto render` executes the code, captures its output (tables, plots, values), and weaves everything into a finished HTML page, PDF, Word document, website, or book, all from one source file.

## Code chunks across languages

Each chunk in a `.qmd` file declares its engine — Python and R chunks are the most common, executed via Jupyter or knitr respectively — and a single document can combine multiple languages, useful for a report that does data prep in Python and modeling or visualization in R, or vice versa.

````markdown
```{python}
import pandas as pd
df = pd.read_csv("orders.csv")
df.groupby("category")["order_total"].sum()
```
````

## SQL chunks and DuckDB

Quarto also supports SQL as a chunk language, though it currently requires the **knitr** engine (R), since SQL execution in Quarto goes through R's DBI package rather than a standalone SQL runner. In practice, that means opening a DuckDB connection with the R `duckdb` package via `DBI::dbConnect()`, passing that connection object into the chunk's engine options, and then writing plain SQL — DuckDB executes the query and Quarto renders the resulting table inline in the document. This pattern is popular for reproducible analysis reports where the underlying data lives in DuckDB or Parquet files: the SQL, the R/Python analysis, and the narrative explanation all live in the same version-controlled `.qmd` file.