Documentation/Math & Equations/When to Use \mathbb, \mathcal, and \mathfrak in LaTeX
Math & Equations

When to Use \mathbb, \mathcal, and \mathfrak in LaTeX

LaTeX offers several decorative math alphabets — \mathbb (blackboard bold), \mathcal (calligraphic), and \mathfrak (Fraktur) — each serving distinct mathematical conventions. Using the right font signals to readers what kind of object you're referring to: number sets, function spaces, operators, or Lie algebras. Bibby AI's symbol palette groups these alphabets visually so you can browse and insert them with a click, which is faster than hunting through documentation in Overleaf.

\mathbb — Blackboard Bold for Number Sets

\mathbb is used for standard number sets and well-known spaces. It requires the amssymb package (or amsfonts):

\documentclass{article}
\usepackage{amssymb}
\begin{document}

% Standard number sets
$\mathbb{N}$ — Natural numbers

$\mathbb{Z}$ — Integers

$\mathbb{Q}$ — Rational numbers

$\mathbb{R}$ — Real numbers

$\mathbb{C}$ — Complex numbers

% Other common uses
$\mathbb{E}[X]$ — Expectation operator

$\mathbb{P}(A)$ — Probability

$\mathbb{1}_A$ — Indicator function

\end{document}

\mathcal — Calligraphic for Collections and Operators

\mathcal produces ornate uppercase letters, conventionally used for sets, sigma-algebras, function spaces, and operators:

% Sigma-algebras and collections
$\mathcal{F}$ — sigma-algebra

$\mathcal{B}(\mathbb{R})$ — Borel sigma-algebra

% Spaces and categories
$\mathcal{H}$ — Hilbert space

$\mathcal{L}(V, W)$ — space of linear maps

% Transforms and operators
$\mathcal{F}\{f(t)\}$ — Fourier transform

$\mathcal{L}\{f(t)\}$ — Laplace transform

% Complexity classes, data sets
$\mathcal{O}(n \log n)$ — Big-O notation

$\mathcal{D} = \{(x_i, y_i)\}$ — Dataset

\mathfrak — Fraktur for Lie Algebras and Ideals

\mathfrak produces Gothic (Fraktur) letters, used primarily in abstract algebra for Lie algebras and ideals:

\usepackage{amssymb}

% Lie algebras (lowercase Fraktur)
$\mathfrak{g}$ — a Lie algebra

$\mathfrak{su}(2)$, $\mathfrak{so}(3)$, $\mathfrak{sl}(n)$

% Ideals in ring theory
$\mathfrak{p}$ — prime ideal

$\mathfrak{m}$ — maximal ideal

% Example in context
\[
[\mathfrak{g}, \mathfrak{g}] \subseteq \mathfrak{g}
\]

💡 Tips

  • \mathbb only works on uppercase letters by default. For lowercase blackboard bold, use the bbm or dsfont package.
  • \mathcal only produces uppercase letters. For lowercase calligraphic, consider the mathrsfs package (\mathscr).
  • Don't overuse decorative fonts — they should convey specific mathematical meaning, not just look fancy.
  • Bibby AI's symbol palette lets you preview all three alphabets side-by-side and insert them with one click.

Try This in Bibby AI

Write LaTeX faster with AI auto-complete and instant compilation.

Start Writing Free

Related Tutorials

When to Use \mathbb, \mathcal, and \mathfrak in LaTeX | Bibby AI