Bold math symbols in LaTeX (mathbf, bm)

\mathbf{x} sets Latin letters and digits bold and upright. For bold italic letters, Greek letters and other symbols use \bm{...} from the bm package.

Preamble

The snippets on this page need these lines before \begin{document}:

\usepackage{amsmath}
\usepackage{bm}

Bold upright letters

\mathbf is part of LaTeX. It changes Latin letters, digits and uppercase Greek letters. Lowercase Greek letters and symbols such as + or \nabla stay unchanged.

\[
  \mathbf{A}\mathbf{x} = \mathbf{b}
  \qquad
  \mathbf{0}
\]
Change the formula

The preview is drawn in your browser by KaTeX, which knows the common math commands. The editor compiles the formula with pdfTeX.

Ax=b0\mathbf{A}\mathbf{x} = \mathbf{b} \qquad \mathbf{0}

Open this formula in the editor

Bold italic letters, Greek letters and symbols

\bm{...} makes its argument bold and keeps the shape: italic letters stay italic, and Greek letters and operators get their bold form.

\[
  \bm{\alpha} + \bm{x} = \bm{\nabla} f
  \qquad
  \bm{A}\bm{x} = \bm{b}
\]
Change the formula

The preview is drawn in your browser by KaTeX, which knows the common math commands. The editor compiles the formula with pdfTeX.

α+x=∇fAx=b\bm{\alpha} + \bm{x} = \bm{\nabla} f \qquad \bm{A}\bm{x} = \bm{b}

Open this formula in the editor

Without the bm package

amsmath has \boldsymbol{...}, which also keeps the shape of the symbol. When bm is loaded, \boldsymbol becomes another name for \bm.

\[
  \boldsymbol{\beta} = (\beta_1, \dots, \beta_n)
\]
Change the formula

The preview is drawn in your browser by KaTeX, which knows the common math commands. The editor compiles the formula with pdfTeX.

β=(β1,…,βn)\boldsymbol{\beta} = (\beta_1, \dots, \beta_n)

Open this formula in the editor

A whole formula in bold

\textbf does not change a formula inside its argument. \boldmath switches every following formula to bold; it has to stand outside math mode, and braces limit its range.

\textbf{Result: {\boldmath $x = \alpha + 1$}}
Result
The compiled example

Open in the editor

Pitfalls

Compiled with pdfLaTeX from TeX Live 2023.

Related pages