How to annoy Evan with LATEX
A list of pet peeves
Evan Chen《陳誼廷》
30 November 2024
It is assumed you are using amsmath and amssymb packages, which you likely are already if you are trying
to type math. See also https://web.evanchen.cc/latex-style-guide.html.
Instead of. . . Annoy Evan by using . . . Notes
``quotes'' “quotes” "quotes" ”quotes”
$\sin(x)$ sin(x) $sin(x)$ sin(x) (1)
$1,\dots,n$ 1, . . . , n $1,...,n$ 1, ..., n (2)
$1,\dots,n$ 1, . . . , n $1,\cdots,n$ 1, · · · , n (2)
$a$, $b$, and $c$ a, b, and c $a,b,$ and $c$ a, b, and c (3)
$p \mid n$ p|n $p | n$ p|n (4)
$\ell \parallel m$ `km $\ell || m$ `||m
$a \pmod n$ a (mod n) $a (\text{mod }n)$ a(mod n) (5)
$2 \cdot 3 = 6$ 2·3=6 $2 * 3 = 6$ 2∗3=6
$2 \times 3 = 6$ 2×3=6 $2$x$3 = 6$ 2x3 = 6
$\left< x,y \right>$ hx, yi $<x,y>$ < x, y > (6)
\[ 1+1=2 \] See (7) $$1+1=2$$ See (7) (7)
Notes
1. This also applies to cos, tan, gcd, min, max, deg, log, ln, exp, inf, sup, . . . . (For
custom operators, say lcm(a, b), write $\operatorname{lcm}(a,b)$. Or put
\DeclareMathOperator{\lcm}{lcm} in the preamble to define \lcm.)
2. Generally, you should almost always use \dots, even outside math mode. The
two dots commands, \ldots (. . .) and \cdots (· · · ) put the dots in different
places. Generally, you want the former for lists and text, the latter between
operators. The smarter \dots will auto-detect which case you are in.
3. The spacing right before the variable b is affected.
4. Also in set notation, e.g. {x | f (x) > 0} is $\left\{ x \mid f(x) > 0 \right\}$.
5. $a \mod n$ gives “a mod n”, $a \bmod n$ gives “a mod n”.
6. \left and \right are also used for resizing (), [], \{\} to match heights of tall
inputs. Compare \[ f\left( \frac12 \right) \] and \[ f( \frac12 ) \]:
1 1
f vs. f ( ).
2 2
7. $$...$$ is a TEX primitive, not officially supported by LATEX. It “usually” works,
but there are occasional mysterious breakages (whereas \[ ... \] always works).
For example, the \qedhere command will break:
Example proof with double dollar signs. Follows by
1 + 1 = 2.
Example proof with correct syntax. Follows by
1 + 1 = 2.