Why LaTeX Maths Is Italic: \mathbf, \boldsymbol and \mathit

Italic is not styling, it is semantics: each letter is a variable. Here is how to opt out for names, units and vectors.

Italic maths is a convention about meaning: every italic letter is a variable and every upright word is a name. Read it that way and "why is my text italic" answers itself — and the fix is always a switch of alphabet, never a font. The switches are \mathrm, \mathbf, \boldsymbol and \mathit; which one applies depends on whether the symbol is Latin, Greek or a whole word (Greek Letters, Trigonometric Functions).

Which one to use

Situation Write this Because
An ordinary variable
x, y, \alpha
Italic is the default and the correct reading.
A predefined function
\sin, \log
Upright operators with spacing.
A name you invent
\operatorname{rank}
Upright with operator spacing.
A unit
\mathrm{m\,s^{-1}}
Upright, thin space, superscript.
A bold vector
\mathbf{v}
Latin only.
Bold Greek
\boldsymbol{\alpha}
\mathbf will not do it.

The commands

What Type this Renders as
Bold Latin Bold upright. Covers Latin letters and digits only.
\mathbf{v} \quad \mathbf{Ax} = \mathbf{b}
\mathbf{v} \quad \mathbf{Ax} = \mathbf{b}
Bold Greek The command that reaches Greek letters, where \mathbf has nothing to offer.
\boldsymbol{\omega}
\boldsymbol{\omega}
Italic emphasis Forces the italic shape even where a context would default upright, and disables auto-spacing between the letters.
\mathit{ABC}
\mathit{ABC}
Upright Roman Names and operators rather than variables; the differential d is the classic case.
\mathrm{d}x \quad \mathrm{Var}(X)
\mathrm{d}x \quad \mathrm{Var}(X)
Operator name Upright plus correct operator spacing, which \mathrm alone does not give you.
\operatorname{sn}(x)
\operatorname{sn}(x)
Double-struck Reserved for number sets and, increasingly, expectation. Capitals only.
\mathbb{R}^n \quad \mathbb{E}
\mathbb{R}^n \quad \mathbb{E}
Calligraphic Script capitals for transforms, families and categories.
\mathcal{L}\{f\}
\mathcal{L}\{f\}
Fraktur Lie algebras and ideals; rarely anything else.
\mathfrak{sl}_2
\mathfrak{sl}_2
Sans serif Transpose markers and computer-science names, where roman would read as an abbreviation.
\mathsf{T} \quad \mathsf{queue}
\mathsf{T} \quad \mathsf{queue}
Typewriter Identifiers and literal tokens, mostly in programming-language texts.
\mathtt{lambda}
\mathtt{lambda}

Worked examples

The italic default explained

ab \ne a b \neq \mathrm{ab}
ab \ne a b \neq \mathrm{ab}

All three print nearly alike, which is precisely the problem: LaTeX treats adjacent letters as an implicit product unless you say otherwise.

Units need out of italic

E = mc^2 \quad t = 5\,\mathrm{s}
E = mc^2 \quad t = 5\,\mathrm{s}

A unit symbol is a name, not a variable, so an italic s invites reading it as seconds times something.

Bold face versus bold Greek

\mathbf{F} = m\mathbf{a} \quad \boldsymbol{\tau} = \mathbf{r} \times \mathbf{F}
\mathbf{F} = m\mathbf{a} \quad \boldsymbol{\tau} = \mathbf{r} \times \mathbf{F}

Where a bold torque symbol is needed, \mathbf will not do it; this is the single most common font error in mechanics.

Differentials set upright

\int_0^1 x\,\mathrm{d}x
\int_0^1 x\,\mathrm{d}x

ISO style asks for an upright d. Whether you follow it matters less than following it consistently.

Common mistakes

  • Using \text{max} inside maths when \max exists. The text form loses the operator limits and the correct surrounding space.
  • Writing \mathbf{\Omega} for a bold omega. It produces an upright bold capital that looks wrong next to a bold lowercase set; \boldsymbol{\Omega} matches.
  • Setting a multi-letter variable as mass and expecting it to read as one quantity. It parses as m·a·s·s; wrap it in \mathit{mass} or rename the variable.
  • Reaching for \bm{...} outside a LaTeX document. It is a package command and KaTeX defines it only as a thin alias, so \boldsymbol remains the portable choice.

Questions about this notation

Why are my variables italic in LaTeX?
Because that is the typographic signal that a letter is a mathematical variable rather than a word. It also means adjacent letters are read as a product, which is why \sin and \log have to be commands rather than typed plainly.
What is the difference between \mathbf and \boldsymbol?
\mathbf selects the bold upright Latin alphabet and ignores everything else. \boldsymbol switches the whole maths symbol font to its bold variant, so it reaches Greek letters, operators and symbols.
How do I make a variable upright?
\mathrm{x} for a single symbol, or \operatorname{name} when it behaves as a function. Note that \mathrm changes the shape but not the grammatical class, so spacing around it stays that of an ordinary symbol.
How do I write a bold vector that keeps its Greek letters and symbols bold?
\mathbf affects letters and digits only, so \mathbf{\Gamma v} leaves the Gamma light without warning you. The bm package fixes that: \bm{\Gamma v} bolds every symbol in its argument and keeps maths italic, which is what a vector wants. Without an extra package, \boldsymbol{\Gamma} from amsfonts covers the Greek case.

Keep reading

Three ways into the same idea: the notation itself, the lesson that teaches it, and an article that applies it.