Quarto
What is Quarto?
A publishing system for creating documents, presentations, websites…
Combines Markdown and R/Python code for reproducible workflows.
What can Quarto do?
Or click here
Creating a Quarto file
- Open RStudio
- Go to File > New File > Quarto Document
- Select the format you want
- Save the file with a
.qmd
extension
How to use Quarto?
index.qmd
---
title: "My Quarto file"
author: "Your Name"
date: "`r Sys.Date()`"
format: html
---
`mtcars`
Summary of
```{r}
summary(mtcars)
```
Main components of a Quarto file:
- Header (YAML metadata)
- Body (Markdown content and code chunks)
Header
index.qmd
---
title: "My Quarto file"
author: "Your Name"
date: "`r Sys.Date()`"
format: html
---
Defines document properties and settings, for examples:
title
: Document titleauthor
: Authorshipdate
: Date this document was publishedformat
:html
,docx
, orpdf
Body
index.qmd
---
title: "Hello, Quarto"
date: 2025-01-06
author:
- name: Thinh Ong
orcid: 0000-0001-6772-9291
format:
html:
code-overflow: wrap
number-sections: true
navbar: false
---
## Introduction to Quarto
Quarto is a publishing system that allows you to create documents, presentations, websites, and more using Markdown syntax and additional tools.
## Header Levels
Quarto supports multiple header levels to create a hierarchical structure in your document. For example:
- Level 1 header: `# Header`
- Level 2 header: `## Subheader`
- Level 3 header: `### Sub-subheader`
### Nested Headers
Using headers, you can create nested sections to structure your document in a clear and organized way.
## Inline Text Formatting
You can format your text inline to add emphasis or other styling options.
- **Bold text**: `**bold**`
- *Italic text*: `*italic*`
- Inline `code`: `` `code` ``
> Blockquotes can be used to highlight important information or quotes by adding `> ` at the beginning of a line.
## Lists
Quarto supports both ordered and unordered lists.
### Unordered List
`*` before each item:
To create an unordered list, use an asterisk
* First item
* Second item
* Third item
### Ordered List
To create an ordered list, use numbers before each item:
1. First item
2. Second item
3. Third item
## Links and images
<http://example.com>
[linked phrase](http://example.com)

## Tables
| First Header | Second Header |
|--------------|---------------|
| Content Cell | Content Cell |
| Content Cell | Content Cell |
## Code block
Quarto also supports code blocks, making it easy to include and execute code within your document. Here’s an example of a code block to create a simple plot using R:
```{r}
#| fig-width: 4
#| fig-height: 3
#| out-width: "100%"
x <- c(1, 2, 3, 4, 5)
y <- c(1, 4, 9, 16, 25)
plot(x, y, type = "o", col = "blue", main = "Simple plot", xlab = "x", ylab = "y")
```
## Footnotes
[This is an example footnote.] Footnotes can be added inline to provide additional information or references. Here's an example of a footnote in Quarto: ^
index.html
Rendering output
- Save your Quarto file.
- Render it using the “Render” button in RStudio or by pressing
Ctrl+Shift+K
.