29  Markdown Cheatsheet

29.1 Inline elements

I want I type
An emphasized word. An *emphasized* word.
An _emphasized_ word.
Some strong emphasis. Some **strong emphasis**.
Some __strong emphasis__.
A sub1 script and a sup1 script (when attached to plain text words). A sub~1~ script and a sup^1^ script.
With \(p_1\) and \(p^2\) the sub(sup)scripts are in math formulas. With $p_1$ and $p^2$ the ...

29.2 Block elements

Paragraph Leave an empty line to separate two paragraphs
Unindented paragraph (following equation, quotation) \noindent This new paragraph...
1. Section heading # Section title
Do not put a number: the house style should add numbers.
1.2 Subsection heading ## Subsection title

1.2.1 Subsubsection title

lower titles

### Subsection title

####, #####, ######

Quotations

Note: only use this for genuine quotations, not to indent blocks.

> Start each line with `>`
> This is a quotation
> with two lines

Statement (indented block)

These lines are going to be indented

First Principle (FP). Everything is what it is.

See below on how to cross-refer to statements.

::: statement
These lines are going to
be indented.
:::

::: {.statement}
*First principle* (**FP**).
Everything is what
it is.`
:::

29.2.1 Citations

Citations are a more difficult aspect of markdown. You should read the chapter on copyediting citations before you use this cheatsheet.

For the following we assume that your document’s bibliography has keys (identifiers) Smith2012, Jones2017 for Smith’s 2012 article, Jone’s 2017 articles, and so on.

I want I type

Basic

(Smith, 2012)

(Smith, 2012, 2015)

(Smith 2012; Jones 2015)

(Smith 2012, 205)

(see Smith 2012, 205)

(Smith 2012, 205-210, 235)

(Smith 2012, 28; Jones 2015, 2017)

(see Smith 2012, 28; comp. Jones 2015, 28; also Jones 2017, 45-58)

Note: whether you get ‘;’ or ‘,’ or ‘:’ separators between several citations should be specified and handled automatically by the template.

[@Smith2012]

[@Smith2012; @Smith2015]

[@Smith2012;@Jones2015]

[@Smith2012, 205]

[see @Smith2012, 205]

[@Smith2012, 205\--210, 235]

[@Smith2012, 28; @Jones2015; @Jones2017]

see @Smith2018, 28; comp. @Jones2015, 28; also @Jones2017, 45\--48]

Inline (note: should with latest RStudio visual mode, but read warning below)

Smith (2012) says that

Smith (2012, 205) says that

Inline several papers by same author, you format the first inline and the rest regular:

Smith (2012; 2015, 205) says that

Peregrin & Svoboda (2013, 2016, 2017, and also Read, 2018)

Alternatively, you can type the name and use year-only:

Smith (2012; 2015)

@Smith2012 says that

@Smith2012 [205] says that

@Smith2012 [@Smith2015, 205] says that

@peregrin-svoboda:2013a [@peregrin-svoboda:2016;

@peregrin-svoboda:2017; and also @read_s:2000]

Smith [-@Smith2012, @Smith2015]

Year only

Smith makes an outrageous claim (2015, 277).

Smith keeps repeating himself (2012, 2013, 2014, 2015).

Smith said this in a few places (2012, 20; 2013, 30)

Smith makes an outrageous claim [-@Smith2015, 277].

Smith keeps repeating himself [-@Smith2012; @Smith2013; @Smith2014; @Smith2015]

Smith said this in a few places [-@Smith2012, 20; @Smith2013, 30].

Common errors:

Bad Good

Code:

(See for instance [@Smith2015]).

(See for instance @Jones2018).

Output:

(See for instance (Smith, 2015)).

(See for instance Jones (2018)).

Code:

[See for instance, @Smith2015]

Output:

(See for instance Smith, 2015).

Code:

See f o r instance @Smith2012; @Smith2015.

Output:

See for instance Smith (2012); Smith (2015).

Code:

See for insta n ce Smith [-@Smith2012; @Smith2015]

Output:

See for instance Smith (2012, 2015).

Space after a formula marker $:

Code:

$ \Delta \rightarrow \Phi $ | Output:

Error, missing $ at line…

Code:

$\Delta \rightarrow \Phi$

Output:

\(\Delta \rightarrow \Phi\)