Dynamic documents — Introduction
Wednesday, 19 August 2026
At the end of this topic you should
understand the basics of the literate programming paradigm
understand basic Markdown syntax
understand how to write YAML
understand basic Quarto commands, syntax, & workflow
be able to use the RStudio IDE to work with and render Quarto documents
be able to write documents using Markdown and Quarto
Quarto is a system for dynamic document creation
Let us change our traditional attitude to the construction of programs: Instead of imagining that our main task is to instruct a computer what to do, let us concentrate rather on explaining to humans what we want the computer to do
— Donald E. Knuth (1984) Literate Programming
The general idea of dynamic documents comes from literate programming
Mix source code and documentation together, then we can
Two main tasks in the literate programming paradigm
write program code to do computing, and
write narrative text to explain what the code does
In computer code, 2. is largely done through comments and specialised markup
Three main steps in literate programming
parse the source document, separating code from narrative text,
execute the code and return/gather the results
interleave results from executing the code with the narrative text
In a dynamic document we mix executable code with narrative text
Executable code can produce text, tables, figures/plots, etc that are combined with the narrative text
The narrative text in a report or paper is typically complex and long
Ideally we’d have a way to write narrative text in a human-readable source file
Quarto is a tool for mixing text written in Markdown with executable code (typically R) and for including the outputs of that code in the document
Builds upon previous tools
Several technologies are involved
Source: Wickham, Çetinkaya-Rundel, & Grolemund (2023) R for Data Science