---
name: latex-typography-conventions
source: https://app.decimal.ai/s/latex-typography-conventions@1/SKILL.md
source_sha256: 15e13080c2c9
---

# LaTeX Typography Conventions

## Contract

When you emit LaTeX source for an academic manuscript, produce it in the
cross-venue typographic conventions below. Apply this any time you write or fix
`.tex` content — tables, figures, prose, math, references, units. These are
exact, arbitrary TeX-specific forms; the naive default (straight quotes, `\hline`,
`10-20`, `...`, `$$`) is what an inexperienced author types and what reviewers
read as amateur typesetting.

## Rules

### R1 — Table rules use booktabs

- Use the `booktabs` rules `\toprule` (top), `\midrule` (under the header),
  `\bottomrule` (bottom). Never `\hline`.
- Never emit a double horizontal rule (`\hline\hline`, or `\toprule\toprule`).
- One `\midrule` separates the header row from the body; do not rule between
  every data row.

### R2 — No vertical rules in the column spec

- The `tabular`/`array` column spec carries letters only: `{lcr}`, `{llc}`.
- Never put a vertical bar `|` in the spec (`{|l|c|r|}`). Vertical rules in a
  table are the single clearest amateur tell.
- Numeric columns are right-aligned (`r`) or decimal-aligned (`S` from
  `siunitx`); text columns are left-aligned (`l`).

### R3 — Table caption goes ABOVE the table

- Emit `\caption{}` BEFORE `\begin{tabular}`, inside the `table` float.
- A table caption below the tabular is wrong — below is for figures (R4).

### R4 — Figure caption goes BELOW the figure

- Emit `\caption{}` AFTER `\includegraphics`, inside the `figure` float.
- A figure caption above the graphic is wrong — above is for tables (R3).

### R5 — Float placement is `[htbp]`

- Use `[htbp]` (or `[tbp]`, `[t]`) on `\begin{table}` / `\begin{figure}`.
- Never `[H]` (forces placement, creates large whitespace gaps) and never
  `[h!]`. Plain `[h]` alone is fragile — avoid it too.

### R6 — Ranges use an en-dash `--`

- Number, page, and year ranges use a double hyphen (en-dash): `10--20`,
  `pp.\ 5--12`, `2020--2023`. Never a single hyphen `10-20` for a range.

### R7 — Em-dash `---` for asides, hyphen for compounds

- A parenthetical aside or emphatic break uses an em-dash, three hyphens:
  `text---text`. Apply spacing uniformly (closed `text---text` is the academic
  default).
- A single hyphen `-` is only for compound words (`state-of-the-art`,
  `well-known`). Never use a single hyphen where a range (R6) or aside belongs.

### R8 — Quotes are TeX quotes

- Open a quotation with two backticks `` `` `` and close with two apostrophes
  `''`. Never the straight `"` keyboard character — it renders as two wrong
  glyphs in TeX.
- Nested: single backtick / single apostrophe inside the doubles:
  `` ``He called it `optimal' which is debatable.'' ``

### R9 — Ellipsis is `\ldots`

- An ellipsis is `\ldots` (or `\dots`). Never three literal periods `...`,
  which TeX sets with wrong inter-dot spacing.

### R10 — Non-breaking tilde before refs and cites

- Put a non-breaking tilde `~` immediately before every cross-reference and
  citation: `Figure~\ref{fig:x}`, `Table~\ref{tab:x}`, `Section~\ref{sec:x}`,
  `Equation~\eqref{eq:x}`, and `prior work~\cite{smith2020}`.
- The tilde prevents a line break that would strand the label ("Figure") at the
  end of one line and the number on the next.

### R11 — Thin space between a number and its unit

- Join a number and its unit with a thin space `\,`: `10\,ms`, `8\,GB`,
  `100\,K`. Equivalently use `siunitx`: `\SI{10}{\milli\second}` / `\qty{10}{ms}`.
- Never `10ms` (no space) and never `10 ms` (a plain inter-word space, which
  TeX may break across lines).

### R12 — Inline fractions use `\nicefrac`

- In running prose write an inline fraction as `\nicefrac{1}{2}` (or
  `\sfrac{1}{2}` from `xfrac`). Never an inline `$\frac{1}{2}$`, which creates a
  tall element that disrupts line spacing.
- `\frac` is correct only inside display math (R13).

### R13 — Display math uses `\[ ... \]`

- Display an equation with `\[ ... \]` or an `equation`/`align` environment.
- Never `$$ ... $$` — that is plain TeX, not LaTeX, and produces incorrect
  vertical spacing.

### R14 — Multiplication and degree symbols

- Multiplication is `$\times$` (e.g. a `$3 \times 3$` kernel). Never the letter
  `x`.
- A degree symbol is `$^\circ$` or `\textdegree` (or a `siunitx` celsius
  command). Never the Unicode `°` character.

### R15 — Emphasis is `\emph{}`

- Emphasize a word with `\emph{...}`. Never `\textbf`, `\textit`, ALL CAPS, or a
  color command for stress in running prose — `\emph` is semantic and nests
  correctly.

### R16 — Escape reserved characters in text

- Escape `\&`, `\%`, `\#`, `\_` whenever they appear as literal text. A bare
  `&`, `%`, `#`, or `_` is a TeX control character and breaks compilation or is
  silently dropped.

### R17 — URLs go in `\url{}`

- Wrap a URL in `\url{...}` or `\href{...}{...}`. Never leave it as bare text
  and never put it in `\texttt{...}` — only `\url` allows the line breaks that
  prevent an overfull margin.

## Worked examples (BEFORE = the naive default, AFTER = conforming)

R1/R2/R3 — table:
```latex
% BEFORE
\begin{table}[H]
\begin{tabular}{|l|c|r|}
\hline
Method & Accuracy & F1 \\ \hline\hline
Ours & 0.94 & 0.91 \\ \hline
\end{tabular}
\caption{Results.}
\end{table}
% AFTER
\begin{table}[htbp]
\caption{Results.}
\begin{tabular}{lcr}
\toprule
Method & Accuracy & F1 \\
\midrule
Ours & 0.94 & 0.91 \\
\bottomrule
\end{tabular}
\end{table}
```

R4/R5 — figure:
```latex
% BEFORE
\begin{figure}[H]
\caption{Training curves over 100 epochs}
\includegraphics{results.png}
\end{figure}
% AFTER
\begin{figure}[htbp]
\includegraphics{results.png}
\caption{Training curves over 100 epochs}
\end{figure}
```

R6 — number range:    BEFORE `See pages 10-20.`  → AFTER `See pages 10--20.`

R6 — year range:      BEFORE `the years 2020-2023` → AFTER `the years 2020--2023`

R7 — aside:           BEFORE `works well, in fact better than expected, on all`
                      → AFTER `works well---in fact better than expected---on all`

R8 — quotes:          BEFORE `the result was "surprising"` →
                      AFTER ``the result was ``surprising'' ``

R8 — nested:          BEFORE `She said "He called it 'optimal'."` →
                      AFTER ``She said ``He called it `optimal'.'' ``

R9 — ellipsis:        BEFORE `the analysis trailed off...` →
                      AFTER `the analysis trailed off\ldots`

R10 — ref:            BEFORE `As shown in Figure \ref{fig:curve}` →
                      AFTER `As shown in Figure~\ref{fig:curve}`

R10 — cite:           BEFORE `Prior work \cite{smith2020}` →
                      AFTER `Prior work~\cite{smith2020}`

R11 — unit:           BEFORE `latency was 10 ms` or `10ms` → AFTER `latency was 10\,ms`

R11 — unit:           BEFORE `under 8 GB` → AFTER `under 8\,GB`

R12 — fraction:       BEFORE `about $\frac{1}{2}$ of the runs` →
                      AFTER `about \nicefrac{1}{2} of the runs`

R13 — display math:   BEFORE `$$L = \sum_i (y_i - \hat{y}_i)^2$$` →
                      AFTER `\[ L = \sum_i (y_i - \hat{y}_i)^2 \]`

R14 — multiply:       BEFORE `a 3 x 3 convolution` → AFTER `a $3 \times 3$ convolution`

R14 — degree:         BEFORE `at 25°C` → AFTER `at $25^\circ$C`

R15 — emphasis:       BEFORE `This step is \textbf{critical}.` →
                      AFTER `This step is \emph{critical}.`

R16 — escapes:        BEFORE `Smith & Jones, a 5% gain` →
                      AFTER `Smith \& Jones, a 5\% gain`

R16 — underscore:     BEFORE `the field max_value` → AFTER `the field max\_value`

R17 — URL:            BEFORE `available at https://example.com/repo/path` →
                      AFTER `available at \url{https://example.com/repo/path}`

## Edge cases & exceptions

- **Hyphen vs en-dash vs em-dash.** Three distinct marks: hyphen `-` joins a
  compound word, en-dash `--` spans a range, em-dash `---` breaks a clause. When
  in doubt about a numeric "A to B," it is a range → `--`.
- **Document class owns the table style.** If the class mandates a table style
  (e.g. `IEEEtran`), follow it rather than imposing booktabs — but the default
  case is always booktabs.
- **Percent and degree spacing.** `%` after a number conventionally touches it
  (`14.3\%`); a unit like `ms`/`GB` does not (`10\,ms`). Either way `%` is still
  escaped as `\%`.
- **`\frac` is right in display math.** R12 forbids inline `$\frac{}{}$`, not
  `\frac` itself — inside `\[ ... \]` or `equation`, `\frac` is correct.
- **Naturalized Latin.** `et al.`, `vs.`, `e.g.`, `i.e.` are set upright (not
  italic) and take a period; this is orthogonal to R15 emphasis.
- **Minus vs hyphen.** A negative number in math is a real minus inside math
  mode (`$-5$`), not a text hyphen.

## Do / Don't

- Never `\hline`; always `\toprule`/`\midrule`/`\bottomrule`.
- Never a `|` in a column spec; always letters only (`{lcr}`).
- Never put a table caption below the tabular; always above it.
- Never put a figure caption above the graphic; always below it.
- Never `[H]` or `[h!]`; always `[htbp]`.
- Never a hyphen for a range; always an en-dash `--`.
- Never the straight `"`; always `` ``...'' ``.
- Never `...`; always `\ldots`.
- Never `Figure \ref{}` with a space; always `Figure~\ref{}` with a tilde.
- Never `10 ms` or `10ms`; always `10\,ms`.
- Never inline `$\frac{}{}$`; always `\nicefrac{}{}`.
- Never `$$...$$`; always `\[...\]`.
- Never the letter `x` for multiply or `°` for degree; always `$\times$` and `$^\circ$`.
- Never `\textbf`/`\textit`/color for prose emphasis; always `\emph{}`.
- Never a bare `&`, `%`, `#`, `_`; always `\&`, `\%`, `\#`, `\_`.
- Never a bare or `\texttt{}` URL; always `\url{}`.

## Common mistakes

- Reaching for `\hline` and `|` columns — the universal novice default.
- Writing the caption after the tabular (figure habit applied to a table).
- Using a plain hyphen `10-20` for ranges; it reads as a subtraction.
- Typing straight quotes `"..."` and literal `...` out of word-processor habit.
- Omitting the tilde before `\ref`/`\cite` — the most common LaTeX mistake.
- Gluing the unit to the number (`10ms`) or using a breakable plain space.
- Using inline `$\frac{1}{2}$` mid-sentence and `$$...$$` for display math.
- Using `\textbf{}` for emphasis because it "looks emphasized."
- Forgetting to escape `&`/`%`/`#`/`_`, which silently breaks the build.

## Quick checklist

booktabs rules · no `|` columns · table caption above · figure caption below ·
`[htbp]` · en-dash ranges · em-dash asides · `` ``...'' `` quotes · `\ldots` ·
tilde before refs/cites · `10\,ms` units · `\nicefrac` · `\[...\]` ·
`$\times$` / `$^\circ$` · `\emph{}` · escaped `\& \% \# \_` · `\url{}`.
