library(ggplot2)
= ggplot(airquality, aes(Temp, Ozone)) +
fig geom_point() +
geom_smooth(method = "loess", se = FALSE)
When writing the body of your document, you will use the Markdown format.
Markdown is a lightweight markup language that you can use to add formatting elements to plaintext text documents. - Markdown Guide
Markdown is the
lingua franca
to creating any kind of document
Writing a post using markdown on Stanford’s Subreddit
Writing an issue using markdown on GitHub
Markdown Syntax | Output |
---|---|
|
italics and bold |
|
superscript2 / subscript2 |
|
|
|
verbatim code |
Markdown Syntax | Output |
---|---|
|
Header 1 |
|
Header 2 |
|
Header 3 |
|
Header 4 |
$
is treated as “inline” maths$$
is a standalone equation$x$
is an equation, $x $
is notImportant
Make sure a new line (space) exists between text and the first list item. For sublists or nested lists, indent four spaces to create a new level in the list.
Tip
To simplify ordered lists and allow for moving items in the list around, use 1.
for each item. If a list needs to be broken, numbering is only continued if each entry is labeled using 1.
, 2.
, 3.
, … format.
Code
| Left | Center | Right |
|-------------------------|:---------------:|--------:|
| Hey, check it out | Colons provide | 873 |
| its **Markdown** | alignment thus | 1000 |
| right in the table | *centered* text | |
Output
Left | Center | Right |
---|---|---|
Hey, check it out | Colons provide | 873 |
its Markdown | alignment thus | 1000 |
right in the table | centered text |
Tip
Visual
mode provides a Table
menu to setup quarto tables or use the table generator website.
You can embed named hyperlinks
Simply a direct url like https://quarto.org/
Links to other places in the document.
Call-out blocks highlight sections of text that interrupt the flow of your regular text. Maybe it’s a definition, a warning, or a sidenote
When rendering your document to HTML, callout blocks are interactive and can be collapsed and opened.
My First Callout Block!
Say things here
Note
Note that there are five types of callouts, including: note
, tip
, warning
, caution
, and important
.
Warning
Callouts provide a simple way to attract attention, for example, to this warning.
This is important
Danger, callouts will really improve your writing.
Tip with caption
Run this first
Caution, under construction
Here is something under construction
Expand To Learn About Collapse
This is an example of a ‘folded’ caution callout that can be expanded by the user. You can use `collapse=“true”` to collapse it by default or `collapse=“false”` to make a collapsible callout that is expanded by default.
Split up and flip between sections of a page, alternative to just two columns
You can familiarize yourself with Markdown in a couple of minutes using the following link: https://www.markdownguide.org/cheat-sheet/.
Go to the Writing/Reference
section on the website and refer to the text provided in the Exercise section.
Copy the text into your Quarto document, like an Introduction of sorts, and reformat it with Markdown Syntax
Render the document to HTML.
10:00
Now that we know how to write in Markdown, let’s add some references!
Adding reproducible references happens with BibTex keys. A typical BibTex key might look like as follows:
We will work with with bibliographies in the form of .bib
files (BibTeX Bibliographical Database). .bib
files are text files which contain a list of references in the form of BibTex keys.
Here is an example of another BibTex key for a reference used in this workshop:
The typical workflow is as follows:
.bib
file through syncing with Zotero desktop and updating the .bib
file.@
+ reference identifier:
@nash51
OR @RMarkdownWritingReproducible
[@nash51]
OR [@nash51, @RMarkdownWritingReproducible]
Alternatively, when using the Visual Editor option - you can use the citation dialog/option to insert citations directly.
Let’s go to RStudio!
Go to the Referencing
section on the website and refer to the instructions in the Exercise section.
You will go through the workflow of creating a .bib
file that will be automatically updated by Zotero and integrating it with your Quarto document.
10:00
You need to use a csl (citation style guide) file to make sure references are properly formatted
I have included the apa7.csl file in the project folder
Add the csl
to your YAML and include the apa7.csl file
Render your document
02:00