52  Quarto

Quarto is “an open-source scientific and technical publishing system built on Pandoc”.

It is the evolution of Rmarkdown, itself built as an extension of Markdown.

Markdown, whose name is a play on markup languages, is a lightweight, markup language meant to be easily human-readable and can produce output in multiple formats, like HTML, PDF and many more.

Rmarkdown added the ability to include executable blocks of R code, which would compile to a Markdown document including both the source code and its output, whether that is console text output, plots, or other elements, e.g. interactive html objects/widgets. This makes it easy to create data-driven reports and presentations within a single document. Output formats include PDF, HTML, Word, ePub, and more.

Quarto brings the same and more functionality to more languages, including R, Python, Julia, and Observable JS.

Important

When Quarto renders a document, all the code is executed in a new R session. This means you need to include all code and in the correct order in the document.

For example, when working interactively on a Quarto document, you might load a dataset dat outside the .qmd file, and then use it within a code block in the .qmd file with no error. However, when rendering the document, the dataset dat will not be available, and will throw an error.

52.1 IDEs

RStudio and VS Code both feature support for authoring and rendering/previewing Quarto documents. RStudio includes built-in support for Quarto and may ask you to install additional packages when rendering a Quarto document for the first time. VS Code requires the installation of the Quarto extension.

52.2 Resources

Learn more about Quarto and access its full documentation on the official website: https://quarto.org/.