Writing in Markdown

Markdown and Quarto

In Quarto, you can write in Markdown, a lightweight markup language with plain text formatting syntax. It is designed so that it can be converted to HTML and many other formats. Markdown is often used to format readme files, for writing messages in online discussion forums, and to create rich text using a plain text editor.

In Quarto, Markdown is converted to multiple formats, including HTML, PDF, and Word using Pandoc. Pandoc is a free and open-source document converter, widely used as a writing tool and as a basis for publishing workflows. For this course, you don’t need to know Pandoc, but it’s good to have some basic familiarity with it so that you know what is happening behind the scenes.

Why write in Markdown? Writing in Markdown is an easy way to standardize your writing process and to ensure that your documents are easily readable across different platforms. When you write in Markdown, and let Quarto handle the formatting, you never have to worry about fiddling around with dropdowns or any of the stuff you would have to do with a standard processing tool. It is also a great way to write and share code, as it allows you to include code chunks directly in your text.

Markdown Basics

Have a look at the following video to learn the basics of Markdown. Note that in this video the presenter is not using Quarto (but rather VS Code). You can use Markdown in multiple different contexts and IDEs, but the syntax is always going to be the same.

Here are some key points about writing in Markdown you should know:

For basic text, you can simply start typing. To insert a line break, use two spaces followed by the return (enter) key. Headings are created using hashmarks: # for the largest heading (level 1), ## for the next largest (level 2), and ### for the subsequent size (level 3).

Emphasis in Markdown is achieved using asterisks: for italics, enclose the word with a single asterisk (*), and for bold, use double asterisks (**). Lists can be either bullet points, created using a dash (-), or numbered lists, initiated with 1., 2., etc.

To insert links, the syntax is [text](url), and for images, you use ![](file path or url). Code chunks allow you to include blocks of code directly in your text. R code chunks are wrapped with {r}..., and Python code chunks with {python}.... This syntax allows for easy inclusion of various types of content directly in your Markdown document, facilitating a rich text formatting experience across different platforms and IDEs.