Quarto for Academic Writing
Write in Markdown, render to PDF with citations and cross-references
Quarto for Academic Writing
What is Quarto and why use it?
Quarto is an open-source scientific publishing system developed by Posit (formerly RStudio). Write in Markdown, render to multiple formats:
- PDF (via Typst or LaTeX)
- HTML pages and websites
- Presentation slides
- Word documents
Think of Quarto as a modern replacement for LaTeX that is simpler to learn and just as capable for academic writing.
LaTeX
- Steep learning curve
- Complex syntax for simple tasks
- Difficult to debug errors
- Large installation (several GB)
- Output mainly PDF
Quarto
- Simple Markdown syntax
- Easy to read and write
- Clear error messages
- Lightweight installation
- PDF, HTML, Word, slides, websites
Quarto produces publication-quality PDFs via Typst with no need to install a full TeX distribution!
LaTeX
\textbf{bold} and \textit{italic}
\begin{itemize}
\item First item
\item Second item
\end{itemize}
\section{Introduction}
\parencite{smith2023}Quarto
**bold** and *italic*
- First item
- Second item
## Introduction
[@smith2023]Same output quality, much less typing!
Getting Started
Installation by platform
macOS
brew install quartoOr download the installer from quarto.org
Windows
winget install Posit.QuartoOr download the installer from quarto.org
Linux
Download the .deb or .rpm package from quarto.org
# Debian/Ubuntu
sudo dpkg -i quarto-*.debPDF output with Typst
Quarto uses Typst for PDF rendering. It is built in, so there is no need to install a full TeX distribution (saves several GB). Simply set format: typst in your YAML frontmatter.
---
title: "My Paper"
format:
typst:
toc: true
number-sections: true
---Typst is fast and produces clean PDFs. It compiles in milliseconds rather than seconds.
Recommended editors
- Zed: A fast, modern editor with Quarto support available through a community extension. Install it from the extensions panel and you are ready to write
.qmdfiles. - VS Code: With the Quarto extension installed, you get syntax highlighting, an integrated live preview, and autocompletion for YAML options and cross-references.
- RStudio: Has native Quarto support built in, making it a natural choice if you already use R for data analysis or are familiar with the RStudio interface.
Any text editor works with Quarto files since they are just plain text (.qmd files). The editors above simply provide extra convenience features like live preview and autocompletion.
Quarto Basics
YAML frontmatter
Every Quarto document starts with a YAML header between --- markers. This header controls the title, author, format, and options.
---
title: "My Seminar Paper"
author: "Jane Doe"
date: today
bibliography: references.bib
format:
typst:
toc: true
number-sections: true
---YAML uses indentation (spaces, not tabs!) to define structure. Be careful with alignment.
Markdown syntax essentials
Syntax
# Heading 1
## Heading 2
### Heading 3
**bold text**
*italic text*
- Bullet list
- Another item
- Nested item
1. Numbered list
2. Second item
[Link text](https://example.com)Result
Heading 3
bold text and italic text
- Bullet list
- Another item
- Nested item
- Numbered list
- Second item
Figures, tables, and equations
Include images with captions and cross-reference labels:
{#fig-example width="80%"}Reference in text: @fig-example renders as “Figure 1”.
The label must start with #fig- for Quarto to recognize it as a figure cross-reference.
Use pipe tables for simple data presentation:
| Method | Objective | Time (s) |
|--------|----------:|:--------:|
| Exact | 142.5 | 3.21 |
| Greedy | 138.7 | 0.05 |
: Comparison of solution methods {#tbl-results}Reference in text: @tbl-results renders as “Table 1”. The label must start with #tbl- for table cross-references.
- Inline math:
$x^2 + y^2 = z^2$renders as \(x^2 + y^2 = z^2\) - Display math with cross-reference:
$$
\min \sum_{i \in \mathcal{I}} \sum_{j \in \mathcal{J}} c_{ij} \cdot x_{ij}
$$ {#eq-objective}\[ \min \sum_{i \in \mathcal{I}} \sum_{j \in \mathcal{J}} c_{ij} \cdot x_{ij} \tag{1}\]
- Reference in text:
@eq-objectiverenders as “Equation 1”
Academic Features
Citations with BibTeX
Store references in a .bib file and set bibliography: references.bib in YAML. Then use the [@key] syntax to cite:
| Syntax | Output |
|---|---|
[@smith2023] |
(Smith, 2023) |
@smith2023 |
Smith (2023) |
[@smith2023; @jones2024] |
(Smith, 2023; Jones, 2024) |
[@smith2023, p. 42] |
(Smith, 2023, p. 42) |
For Typst output, use bibliographystyle: apa in your YAML. This uses Typst’s built-in APA style, so no extra .csl file is needed.
Cross-references overview
Quarto has a unified cross-referencing system:
| Element | Label Prefix | Reference Syntax |
|---|---|---|
| Figure | #fig- |
@fig-label |
| Table | #tbl- |
@tbl-label |
| Equation | #eq- |
@eq-label |
| Section | #sec- |
@sec-label |
All cross-references are automatically numbered and updated when you add or remove elements. No more manual numbering!
Cross-references in practice
{#fig-metro width="80%"}
As shown in @fig-metro, the system connects ...- The label
#fig-metromakes the figure referenceable @fig-metroin text becomes “Figure 1” automatically- Works with PNG, JPG, SVG, and PDF images
| Instance | Optimal | Heuristic | Gap (%) |
|----------|--------:|----------:|--------:|
| Small | 245 | 248 | 1.2 |
| Medium | 1,340 | 1,382 | 3.1 |
| Large | 12,450 | 13,102 | 5.2 |
: Computational results {#tbl-computation}
The results in @tbl-computation show that ...- The caption goes below the table with
: Caption text {#tbl-label}
$$
\sum_{j \in \mathcal{J}} a_{ij} \cdot x_{ij}
\leq b_i \quad \forall i \in \mathcal{I}
$$ {#eq-capacity}
The capacity constraint in @eq-capacity ensures ...\[ \sum_{j \in \mathcal{J}} a_{ij} \cdot x_{ij} \leq b_i \quad \forall i \in \mathcal{I} \tag{2}\]
- The label
{#eq-label}goes right after the closing$$
Advanced Formatting with Typst
Embedding raw Typst
The Quarto templates use Typst (not LaTeX) to produce the PDF. For most writing, you only need Markdown. But for advanced formatting, you can embed raw Typst code in a fenced block:
```{=typst}
#v(1cm) // vertical space
#text(fill: red)[important] // colored text
#align(center)[centered text] // alignment
#line(length: 100%) // horizontal line
#set text(size: 9pt) // change font size locally
```Typst is much simpler than LaTeX. See the Typst documentation for the full reference.
Footnotes and special characters
This claim needs a source^[See Smith (2023) for details.].- En-dash for ranges:
5--10renders as 5–10 - Em-dash for parenthetical remarks:
---renders as — - Non-breaking space:
16\ GBkeeps the number and unit together
Workflow Tips
Reference management with Zotero
Use Zotero (free) to manage your references. Export your collection as a .bib file via File → Export Library (or right-click a collection → Export Collection) and select BibTeX as the format. The workflow becomes: save a paper to Zotero, export to .bib, cite in Quarto with [@key]. See the Literature Research workshop for detailed setup instructions.
Writing best practices
- Keep figures in an
images/folder. A dedicated folder prevents clutter in your project root and makes it straightforward to locate and update graphics later. - Use
quarto previewfor live preview while writing. Seeing your rendered output update in real time helps you catch formatting issues early, before they pile up. - Write one sentence per line. This makes version control diffs much cleaner, because a change to one sentence shows up as a single changed line rather than a reflow of an entire paragraph.
- Use
<!-- comments -->to leave notes for yourself. HTML comments are invisible in the rendered output, so you can mark sections that need revision or leave reminders without affecting the final document.
For guidance on academic language, paragraph structure, and precision in scientific writing, see the Scientific Writing guide.
Templates
Ready-to-use templates for seminar papers, bachelor theses, and master theses are available on the Templates page. Download them there, then come back to this workshop for the formatting syntax.
Quarto lets you focus on content, not formatting. Write your ideas in simple Markdown, and Quarto handles the rest: citations, cross-references, numbering, and clean PDF output.