3 Using markdown
Markdown is a lightweight markup language that you can use to add formatting elements to plaintext text documents. - Markdown Guide
Quarto documents contain content that is formatted with markdown. Where in text editors, you press buttons to make text bold, create a hyperlink, or create headers, in markdown you explicitly write these elements out in the raw text. This raw markdown can then be converted to other formats, such as HTML, pdf, epub or even Word. In a Quarto book, this is done automatically when you render the book.
See the full Quarto markdown documentation
Some useful resources:
- Learn markdown interactively with the Markdown tutorial.
- For a longer list of markdown syntax, please refer to the Markdown Guide Cheatsheet and this GitHub repository with more extensive markdown options.
3.1 Basic syntax
Markdown Syntax | Output |
---|---|
|
italics and bold |
|
superscript2 / subscript2 |
|
|
|
verbatim code |
|
Header 1 |
|
Header 2 |
|
Header 3 |
3.2 Lists
* unordered list
+ sub-item 1
- sub-sub-item 1
+ sub-item 2
- unordered list
- sub-item 1
- sub-sub-item 1
- sub-item 2
- sub-item 1
1. ordered list
2. item 2
i. sub-item 1 A. sub-sub-item 1
- ordered list
- item 2
- sub-item 1
- sub-sub-item 1
- sub-item 1
* item 2
Continued (indent 4 spaces)
item 2
Continued (indent 4 spaces)
term : definition
- term
- definition
3.3 Links
[named hyperlink](https://quarto.org/)
Direct url: <https://quarto.org/>
Direct url: https://quarto.org/
[other places](#lists)
Link to in the document.
Link to other places in the document.
Embed an image:
![penguins](https://allisonhorst.github.io/palmerpenguins/reference/figures/lter_penguins.png)
Embed an image:
3.4 Tables
| Right | Left | Default | Center |
|------:|:-----|---------|:------:|
| 12 | 12 | 12 | 12 |
| 123 | 123 | 123 | 123 |
| 1 | 1 | 1 | 1 |
Right | Left | Default | Center |
---|---|---|---|
12 | 12 | 12 | 12 |
123 | 123 | 123 | 123 |
1 | 1 | 1 | 1 |
It is possible to use raw html elements in a quarto document. But try to limit this because:
- Not everyone knows how html works, so it’s less accessible for others to work with your content.
- Raw html elements will only correctly be displayed in html output. If you have pdf output, for example, the html elements are not rendered correctly.