Docs

Text formatting

Paragraphs, emphasis, inline code, escaping, and typography

Paragraphs and line breaks

Paragraphs are blocks of text separated by a blank line. A single newline inside a paragraph does not break the line — the text reflows. To force a line break within a paragraph, end the line with a backslash or two spaces:

Result

First line.
Second line of the same paragraph.

Markdown
First line.\
Second line of the same paragraph.

Emphasis

Written Result Note
**bold** bold Strong emphasis.
*italic* italic Emphasis.
`code` code Inline code; nothing inside it is interpreted.
~~struck~~ struck Two tildes on each side; one tilde is subscript.
==highlighted== highlighted A highlighted run of plain text.
H~2~O H2O A short index below the line.
x^2^ x2 A short index above the line.
pages 3--7 pages 3–7 Two hyphens: an en dash, for ranges.
a pause---then a pause—then Three hyphens: an em dash.

Notes:

  • ***bold italic*** combines the two.
  • Strikethrough needs two tildes on each side. A single tilde is subscript.
  • Underscores work as an alternative to asterisks (_italic_, __bold__), but asterisks are the house style and survive intra-word use (un*frigging*believable).

Highlight

==text== marks a run of text as highlighted, the way a reader marks a passage with a highlighter. It renders as the HTML <mark> element.

Result

The proof only uses that the function is continuous, never that it is smooth.

Markdown
The proof only uses ==that the function is continuous==, never that it is smooth.
  • Plain text only. A run that holds other formatting or a formula, such as ==a **bold** word==, is left as typed. Highlight the plain part, or restructure the sentence.
  • No = inside. The highlighted text cannot contain an equals sign: ==a=b== pairs the wrong signs and highlights the text after it. Put an equation in maths, where = is never markup.
  • A lone == is left alone, and inside code nothing is highlighted.

Highlight is for a phrase the reader must not miss in the middle of a sentence. For a whole paragraph, an admonition says more.

Subscript and superscript

Result

H2O, x2, CO2, m3

Markdown
H~2~O, x^2^, CO~2~, m^3^

For anything beyond a short index — expressions, Greek letters, nested scripts — use math instead: $x_{n+1}^2$.

Definition lists

A term on its own line, then each definition on a line of its own starting with a colon and a space:

Result
Corollary
A statement that follows from a theorem with little or no extra proof.
Group
A set with an associative operation, an identity and inverses.
In additive notation the operation is written .
Markdown
Corollary
: A statement that follows from a theorem with little or no extra proof.
 
Group $G$
: A set with an associative operation, an identity and *inverses*.
: In additive notation the operation is written $+$.
  • A term may have several definitions, one : line each.
  • Terms and definitions take inline formatting and maths.
  • Consecutive entries form one list, with or without a blank line between them.
  • A term needs at least two characters. A one-letter term such as A followed by a : line stays a plain paragraph. Write the term out, or use a table.

For a definition that is part of the theory, numbered and cited, use a definition statement instead. A definition list is for a glossary: short entries a reader looks up.

Typography

Two hyphens become an en dash, for ranges (pages 3--7 gives pages 3–7), and three become an em dash (a pause---then gives a pause—then). To show hyphens as typed, put them in `inline code`.

Quotes and ellipses are left exactly as typed — smart quotes are not applied, so "quoted" keeps straight quotes.

Escaping

Backslash-escape a character to use it literally where it would otherwise be syntax:

Result

*not italic*, price in $5

Markdown
\*not italic\*, price in \$5

This covers CommonMark syntax and math: \$ keeps a dollar sign from starting a math span. Two cases do not respond to a backslash:

  • A paired ==...== on plain text always becomes a highlight. A lone == stays literal; to show the paired form, put it in `inline code`.
  • A line starting with ::: opens a directive; show literal directive syntax inside a code block.

Inside inline code and code blocks nothing is interpreted, so escaping is never needed there.