Quarto

Create reproducible documents combining narrative and code with Quarto in Positron.

Quarto is an open-source scientific and technical publishing system for creating reproducible documents that combine narrative and executable code.

Positron enhances how you can use Quarto in several important ways:

A Quarto document in Positron, with narrative, executable code chunks, and the rendered preview in Positron’s integrated Viewer pane.

A Quarto document in Positron, with narrative, executable code chunks, and the rendered preview in Positron’s integrated Viewer pane.

Learn more in the Quarto documentation about getting started with Quarto and Positron, or the details of using Positron as a tool for working with Quarto.

Note

Quarto’s visual editor has limited support in Positron. It is a great fit for rich text authoring, but statement execution and other language features are not supported. Consider switching to source mode when you need such features, and follow along on GitHub for updates on this support.

AI actions

Positron integrates with Posit Assistant to help you write and improve Quarto documents. To use AI actions, first set up a language model provider. Then select the Ask Assistant icon button in the Quarto editor action bar to open the Assistant panel for your document.

From the panel, you can ask Posit Assistant to Explain This Document, Fix Errors and Issues, or Improve This Document. These actions work with all parts of your document, including prose, code chunks, chunk options, and YAML front matter.

You can also select Generate AI Suggestions to get prompts based on your file. Or, type your own request in the Or enter a custom prompt box. When you choose any action, suggestion, or custom prompt, Positron starts a new chat in Posit Assistant and sends the prompt.

The new chat includes your Quarto document as context.

AI actions work whether or not you use inline output. With inline output turned on, Posit Assistant can also run chunks and read their output. The editor follows the edits it makes, and you can fix and explain chunk errors.

Positron hides the Ask Assistant button when ai.enabled is false. See Configure AI features for other ways to turn AI features on and off.

Support for R Markdown

Quarto provides Positron’s support for R Markdown; there is limited specialized IDE support for R Markdown other than what is provided by Quarto. Some advanced .Rmd features like using params are not supported for interactive use.

Positron’s Command Palette does provide commands for working with R Markdown:

  • R: Render Document With R Markdown renders an .Rmd file using the R package rmarkdown instead of Quarto. This approach does support all .Rmd features but does not automatically open a preview of the rendered output.
  • R: New R Markdown from Template creates a new .Rmd file from an R Markdown template available in an installed R package, such as the GitHub flavored markdown template or the flexdashboard templates.

Using the Quarto extension

The Quarto extension is included as a bootstrapped extension in Positron. This means that it will behave just like you installed it yourself; this extension will update automatically when a new version is available from the extension gallery and it can be uninstalled if desired.

Managing Quarto installations

Positron bundles a version of the Quarto CLI, but you can also use a version of the Quarto CLI that you have installed yourself. This should typically work automatically, but you can manage exactly which Quarto to use via the quarto.path setting. Check the bottom status bar to see which version of Quarto is being used currently.1

Footnotes

  1. If you change the version of Quarto you are using, you will need to restart Positron to see the status bar update.↩︎