Section 2.1 Markdown syntax
In this section, we give a very brief introduction to Pandocβs Markdown. Readers who are familiar with Markdown can skip this section. The comprehensive syntax of Pandocβs Markdown can be found on the Pandoc website
pandoc.org.
Subsection 2.1.1 Inline formatting
You can make text italic by surrounding it with underscores or asterisks, e.g., . Small caps can be produced by the HTML tag
_text_ or *text*. For bold text, use two underscores (__text__) or asterisks (**text**). Text surrounded by ~ will be converted to a subscript (e.g., H~2~SO~4~), and similarly, two carets (^) produce a superscript (e.g., Fe^2+^). To mark text as inline code, use a pair of backticks, e.g., `code`β1β
To include literal backticks, use more backticks outside, e.g., you can use two backticks to preserve one backtick inside:
`` `code` ``.
span, e.g., <span style="font-variant:small-caps;">Small Caps</span>. Links are created using [text](link), e.g., [Posit](https://www.posit.co), and the syntax for images is similar: just add an exclamation mark, e.g., . Footnotes are put inside the square brackets after a caret ^[], e.g., ^[This is a footnote.]. We will talk about citations in SectionΒ 2.8.
Subsection 2.1.2 Block-level elements
Section headers can be written after a number of pound signs, for example,
# First-level header
## Second-level header
### Third-level header
If you do not want a certain heading to be numbered, you can add
{-} after the heading.
# Preface {-}
Unordered list items start with
*, -, or +, and you can nest one list within another list by indenting the sub-list by four spaces.
- one item
- one item
- one item
- one item
- one item
The output is:
-
one item
-
one item
-
one item
-
one item
-
one item
-
Ordered list items start with numbers (the rule for nested lists is the same as above).
1. the first item
2. the second item
3. the third item
The output does not look too much different with the Markdown source:
-
the first item
-
the second item
-
the third item
Blockquotes are written after
>, e.g.,
> "I thoroughly disapprove of duels. If a man should challenge me,
I would take him kindly and forgivingly by the hand and lead him
to a quiet place and kill him."
>
> --- Mark Twain
"I thoroughly disapprove of duels. If a man should challenge me, I would take him kindly and forgivingly by the hand and lead him to a quiet place and kill him."β Mark Twain
Plain code blocks can be written after three or more backticks, and you can also indent the blocks by four spaces.
```
This text is displayed verbatim / preformatted
```
Or indent by four spaces:
This text is displayed verbatim / preformatted
Subsection 2.1.3 Math expressions
Inline LaTeX equations can be written in a pair of dollar signs using the LaTeX syntax, e.g.,
$f(k) = {n \choose k} p^{k} (1-p)^{n-k}$ (actual output: \(f(k) = \binom{n}{k} p^{k} (1-p)^{n-k}\)); math expressions of the display style can be written in a pair of double dollar signs, e.g., $$f(k) = {n \choose k} p^{k} (1-p)^{n-k}$$, and the output looks like this:
\begin{equation*}
f(k) = \binom{n}{k} p^{k} (1-p)^{n-k}
\end{equation*}
$$\begin{array}{ccc}
x_{11} & x_{12} & x_{13}\\
x_{21} & x_{22} & x_{23}
\end{array}$$
\begin{equation*}
\begin{array}{ccc}
x_{11} \amp x_{12} \amp x_{13}\\
x_{21} \amp x_{22} \amp x_{23}
\end{array}
\end{equation*}
$$X = \begin{bmatrix}1 & x_{1}\\
1 & x_{2}\\
1 & x_{3}
\end{bmatrix}$$
\begin{equation*}
X = \begin{bmatrix}
1 \amp x_{1}\\
1 \amp x_{2}\\
1 \amp x_{3}
\end{bmatrix}
\end{equation*}
$$\Theta = \begin{pmatrix}\alpha & \beta\\
\gamma & \delta
\end{pmatrix}$$
\begin{equation*}
\Theta = \begin{pmatrix}
\alpha \amp \beta\\
\gamma \amp \delta
\end{pmatrix}
\end{equation*}
$$\begin{vmatrix}a & b\\
c & d
\end{vmatrix}=ad-bc$$
\begin{equation*}
\begin{vmatrix}
a \amp b\\
c \amp d
\end{vmatrix} = ad - bc
\end{equation*}
