Tutorial: Hello, Quarto
You can work through this tutorial using R or Python code examples. Select your preferred language:
Overview
Positron comes ready to work with Quarto out-of-the-box — it includes both the Quarto command line interface and the Quarto VS Code extension.
In this tutorial, you’ll learn how to use Positron with Quarto. You’ll edit code and markdown in Positron and preview the rendered document in the Viewer pane as you work.
Basic Workflow
Here’s what it might look like in Positron to edit and preview a Quarto document:
The Quarto document (.qmd
) on the left contains a combination of markdown and executable code cells. It is rendered into the HTML version you see on the right. You could also choose to render it into other formats like PDF, MS Word, etc.
This is the basic model for Quarto publishing—take a source document that combines code and narrative, and render it to a variety of output formats.
Setup
If you would like to follow along with this tutorial in your own environment, follow the steps outlined below.
Be sure that you have installed the
tidyverse
andpalmerpenguins
packages:install.packages("tidyverse") install.packages("palmerpenguins")
Download the Quarto document (
.qmd
) below, open it in Positron.
Be sure that you have installed the
jupyter
,plotnine
andpalmerpenguins
packages:pip install jupyter plotnine palmerpenguins
Download the Quarto document (
.qmd
) below, open it in Positron.
Rendering
We’ll start out by rendering the example (hello.qmd
). To render and preview the document, execute the Quarto: Preview command. You can alternatively use the keyboard shortcut , or the Preview button () in the editor toolbar:
Quarto will render the document, and the rendered output will preview in the Viewer pane. This side-by-side preview works for HTML and PDF outputs. Other formats, like MS Word, will open externally.
The preview will update whenever you rerun the Quarto: Preview command. If you prefer to automatically render whenever you save, you can check the Render on Save option on the editor toolbar.
When rendering, Quarto generates a new file that contains selected text, code, and results from the .qmd
file. The new file can be an HTML, PDF, MS Word document, presentation, website, book, interactive document, or other format.
How it works
Next Up
You now know the basics of creating and authoring Quarto documents. The following tutorials explore Quarto in more depth:
Tutorial: Computations — Learn how to tailor the behavior and output of executable code blocks.
Tutorial: Authoring — Learn more about output formats and technical writing features like citations, crossrefs, and advanced layout.