Payload LogoOctree

Mathematical Fonts in LaTeX: Complete Typography Guide

Date Published

Mathematical Fonts in LaTeX

LaTeX offers a rich variety of mathematical fonts for different purposes. Here's your complete guide to mathematical typography.

Default Math Fonts

In math mode, LaTeX automatically uses italic for variables:

$x + y = z$ renders with italic letters.

For upright text in math, use \text{} or \mathrm{}:

$\text{speed} = \frac{\text{distance}}{\text{time}}$

Calligraphic Font (\mathcal)

The calligraphic font is perfect for sets, categories, and special mathematical objects:

$\mathcal{A}, \mathcal{B}, \mathcal{C}, \mathcal{L}, \mathcal{F}$

Common uses: - Lagrangian: $\mathcal{L}$ - Fourier transform: $\mathcal{F}$ - Categories: $\mathcal{C}$ - Power set: $\mathcal{P}(A)$

Note: \mathcal only works with uppercase letters.

Blackboard Bold (\mathbb)

Blackboard bold represents number sets and special spaces:

$\mathbb{R}, \mathbb{C}, \mathbb{Z}, \mathbb{Q}, \mathbb{N}$

Requires \usepackage{amssymb}

Common uses: - Real numbers: $\mathbb{R}$ - Complex numbers: $\mathbb{C}$ - Integers: $\mathbb{Z}$ - Rationals: $\mathbb{Q}$ - Natural numbers: $\mathbb{N}$ - Expectation: $\mathbb{E}[X]$

Fraktur Font (\mathfrak)

Fraktur (Gothic) letters for Lie algebras and ideals:

$\mathfrak{a}, \mathfrak{g}, \mathfrak{sl}, \mathfrak{so}$

Requires \usepackage{amssymb}

Common uses: - Lie algebras: $\mathfrak{g}, \mathfrak{sl}(n)$ - Ideals in ring theory: $\mathfrak{p}, \mathfrak{m}$

Script Font (\mathscr)

More ornate than calligraphic:

$\mathscr{A}, \mathscr{B}, \mathscr{L}$

Requires \usepackage{mathrsfs}

Bold Math (\mathbf and \boldsymbol)

For vectors and matrices:

$\mathbf{A}, \mathbf{x}, \mathbf{v}$ — bold upright

$\boldsymbol{\alpha}, \boldsymbol{\beta}$ — bold italic (for Greek)

Sans-Serif Math (\mathsf)

Often used for categories and tensors:

$\mathsf{T}, \mathsf{Set}, \mathsf{Grp}$

Typewriter/Monospace (\mathtt)

For code-like elements in math:

$\mathtt{true}, \mathtt{false}$

Quick Reference Table

Font Packages Summary

\usepackage{amsmath} — enhanced math (\boldsymbol) \usepackage{amssymb} — \mathbb, \mathfrak \usepackage{mathrsfs} — \mathscr

Beautiful Math Typography with Octree

Octree makes mathematical fonts easy:

- AI suggests appropriate font styles - Real-time preview of all math fonts - Auto-loads required packages - Professional typesetting instantly

Try it at https://useoctree.com