05:00
One of the challenges to producing several kinds of documents (e.g., HTML, DocX, PDF, Dashboard, etc.) from a single source is that the common WYSIWYG editors have you specify the physical appearance of elements.
What Markdown lets you
Identify the components of the text that have special meaning, and then
Defer decisions about styles, colors, fonts, etc. until render time.
In this presentation, the slide title is actually a level 2 heading and is shown on the slide as a bold and larger font face. However, if I rendered this as a single HTML page, it may be Orange but if it goes to a PowerPoint, I want it to fit into my color them and be Red, bold, and Monospace.
Waste your time working on display characteristics before the actual text of what you are producing is finished.
Your time is just too valuable.
Waste your time working on the actual content of the work you are doing.
The display will come later (reformatting bibliographies, changing journal formats, etc.)
Separating also allows you to generalize things like:
What chaos is created by inserting a new figure in between Figure 3 and Figure 4 in your thesis written in Word?
The use of Markdown mixed with R
(or python or julia) means that we can:
Stop typing analyses and data output directly, have Markdown insert results when rendered.
R
code within the text itself.Finally, since Markdown is just text:
YAML (Yet Another Markdown Language) is a method of setting meta-data relevant to the parsing and rendering of a markdown document.
It must be at the top of the document.
It is delimited by three dashes, one set above and one below the content.
Can be set for all files in a project (see file _quarto.yml
in this repository) to standardize meta data for all instances of a document type (e.g., all PDF’s have this them, all DOCX have a TOC, etc.).
The way that YAML works is a simple key:value setup. For these cases, all items are on a single line, like you did previously to change the output from docx to html by changing:
format: docx
to
format: html
The colon is REQUIRED.
Sometimes we have nested YAML. For example, maybe when I make a PDF I do not want a table of contents but when I create an html document I do. Instead of reformatting and rewriting all of this, I can include both PDF and HTML YAML.
To do this, you use tabs to nest items underneath the general section and add a colon to the end of each line that has some kind of nested object.
format:
html:
toc: true
pdf:
toc: false
And sometimes, we have a lot of options under a single key in YAML. For example, if we have several authors on a paper, we can include them as itemized entries.
author:
- name: YOUR NAME
- name: OTHER PERSON
Try the following and see how it renders.
author: YOUR NAME HERE
into the YAML (n.b., you must replace YOUR NAME HERE
with your actual name…)
05:00
Markdown is a method to typeset text using only keyboard commands.
Plain text is displayed as body styled texts.
What you type is what you get.
In your word processor, you have Titles, Subtitles, Header 1, Header 2, Header 3, etc.
In Markdown, we indicate these elements by prepending a hashtag to the text.
The more hashtags, the less prominent the header level.
The most common features of text are also “marked them up” using the following conventions.
Markdown | Result |
---|---|
*italic* | italic |
**bold** | bold |
~~strikethrough~~ |
URL’s can be used to include both to webpages and images (either online or as a path relative to the document you are making on the computer).
Markdown | Rendered As |
---|---|
[CES](https://ces.vcu.edu) | CES |
 |
Local references are relative to the markdown document.
External images can be included as well by including full URL.

Additional figure configurations are described here.
Markdown mixes rather nicely with code.
Code chunks are defined by three backticks (under the tilde on the upper left corner of your keyboard) surrounding the code.
```{r}
print(“hello world”)
```
produces the output of the command and presents it in analysis output styling (just like R
)
[1] "hello world"
You can also produce graphics (this makes a histgram from 1000 random numbers from a normal distribution).
```{r}
hist( rnorm(1000) )
```
These were R
code, but Quarto can integrate all kinds of code. Here is what we call a Mermaid Diagrams.
```{r}
flowchart LR
A[Hard edge] –> B(Round edge)
B –> C{Decision}
C –> D[Result one]
C –> E[Result two]
```
flowchart LR A[Hard edge] --> B(Round edge) B --> C{Decision} C --> D[Result one] C --> E[Result two]
## title
), which is denoted as its “Slide Title”,### subtitle
),There are a ton
of customizations available. I would suggest you look to the official Quarto Reference site: