Writing

Topics

  • Markdown Syntax
  • Referencing

Markdown Syntax

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

When you render your Quarto document, Quarto converts the Markdown-formatted text into HTML, LaTeX, etc., depending on the output format you chose.

Learning Markdown

You can familiarize yourself with Markdown in a couple of minutes using the following link: https://www.markdownguide.org/cheat-sheet/.

You can also use the Visual Editor in VS Code or RStudio, to see Markdown syntax previewed in it’s final format as you write. The Visual Editor also has some common Word-like shortcuts, such as Ctrl + B to make text bold.

Markdown Sneak Peek: Text Formatting

Markdown Syntax Output
*italics* and **bold**
italics and bold
superscript^2^ / subscript~2~
superscript2 / subscript2
~~strikethrough~~
strikethrough
`verbatim code`
verbatim code

Markdown Sneak Peek: Headers

Markdown Syntax Output
# Header 1

Header 1

## Header 2

Header 2

### Header 3

Header 3

#### Header 4

Header 4

Markdown Sneak Peek: 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
1. ordered list
2. item 2
   i. sub-item 1
      A.  sub-sub-item 1
  1. ordered list
  2. item 2
    1. sub-item 1
      1. sub-sub-item 1
*   item 2
    
    Continued (indent 4 spaces)
  • item 2

    Continued (indent 4 spaces)

term
: definition
term
definition

Markdown Sneak Peek: 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

Exercise

  1. Go to the Markdown Syntax chapter in the workshop book and refer to the text provided in the Exercise section.

  2. Copy the text into your Quarto document, like an Introduction of sorts, and reformat it with Markdown Syntax

  3. Render the document to HTML.

10:00

Referencing

BibTex Keys

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:

@article{nash51,
  author  = "Nash, John",
  title   = "Non-cooperative Games",
  journal = "Annals of Mathematics",
  year    = 1951,
  volume  = "54",
  number  = "2",
  pages   = "286--295"
}

Working With BibTex Keys

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:

@misc{RMarkdownWritingReproducible,
    title = {{RMarkdown} for writing reproducible scientific papers},
    url = {https://libscie.github.io/rmarkdown-workshop/handout.html},
    urldate = {2023-04-18},
    file = {RMarkdown for writing reproducible scientific papers:C\:\\Users\\Moope001\\Zotero\\storage\\SJITSZZI\\handout.html:text/html},
}

Working With BibTex Keys

The typical workflow is as follows:

  1. Find a reference that you need in your manuscript.
  2. Save it to your Zotero library via the browser extension
    Zotero automatically updates your .bib file through syncing with Zotero desktop and updating the .bib file.
  3. Cite the references using the @ + reference identifier:
    • In-text citations: @nash51 OR @RMarkdownWritingReproducible
    • Bracketed citations: [@nash51] OR [@nash51, @RMarkdownWritingReproducible]

Exercise

Go to the Referencing chapter in the workshop book 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