# Syntax Pastes are written in [Markdown](https://commonmark.org/help/), and math is typeset with [KaTeX](https://katex.org/docs/supported). When you select and copy rendered math, the LaTeX source is copied. Each example below shows what you type on the left and the result on the right. ## Math Inline math goes between single dollars or `\( … \)`. A dollar sign followed by a digit stays plain text. ```example Euler: $e^{i\pi} + 1 = 0$, or \(e^{i\pi} = -1\). It costs $5 and $10. A literal dollar: \$. ``` Display math goes between `\[ … \]`. Double dollars work too. ```example \[ \int_{-\infty}^{\infty} e^{-x^2}\,dx = \sqrt{\pi} \] ``` Environments such as `align`, `gather` and `equation` can start a line without any delimiters. Unstarred environments are numbered through the whole paste. ```example \begin{align} f(x) &= (x+1)^2 \\ &= x^2 + 2x + 1 \end{align} ``` Macros defined with `\newcommand` or `\def` apply to all formulas after the definition. A formula that only defines macros is not shown. ```example \[ \newcommand{\RR}{\mathbb{R}} \newcommand{\norm}[1]{\lVert #1 \rVert} \] For all $x \in \RR^n$, $\norm{x} \ge 0$. ``` Chemistry uses `\ce` from mhchem. ```example $\ce{2H2 + O2 -> 2H2O}$ ``` ## Text ```example **bold**, *italic*, ~~struck~~, ==marked==, `code`, H~2~O, x^2^ ``` ```example A link to [KaTeX](https://katex.org), and a plain address: https://pref.tools ``` ```example A claim with a footnote.[^1] [^1]: The footnote text can go anywhere. ``` Images are not shown; they appear as links. ## Headings, lists and tables ```example ### A heading - one - two 1. nested 2. list - [x] done - [ ] not done ``` ```example Term : Its definition. > A quotation. ``` ```example | Rule | Winner | | ----- | -----: | | Borda | a | | Copeland | b | ``` ## Code and diagrams Code blocks with a language name are highlighted. A code block with the language `mermaid` is drawn as a [Mermaid](https://mermaid.js.org/intro/) diagram. ````example ```python def borda(profile): return sum(profile) ``` ```` ````example ```mermaid graph LR A[Profile] --> B[Rule] --> C[Winner] ``` ```` ## HTML A few HTML tags are allowed, including `<sub>`, `<sup>`, `<kbd>`, `<br>`, `<details>` and `<summary>`. ```example Press <kbd>Ctrl</kbd> + <kbd>C</kbd>. <details> <summary>Show the proof</summary> Since $n^2 \ge n$ for all $n \ge 1$, … </details> ```