Chalk cannot be made bold. So in the lecture halls of the mid-twentieth century mathematicians began drawing certain strokes twice, and the doubled line stood in for boldface. That blackboard habit was later cut into type as blackboard bold — the ancestor of the printed ℝ, ℕ and ℤ. LaTeX offers four ornamental alphabets: calligraphic \mathcal, script \mathscr, Fraktur \mathfrak and blackboard bold \mathbb. The awkward part is that the one everybody wants, \mathbb, is not built in, while the one that is built in, \mathcal, accepts a lowercase letter without complaint and quietly prints a completely different symbol. This page is about telling the four apart and using them without stepping on a rake.
\mathcal vs \mathscr vs \mathfrak vs \mathbb
The four differ only in which font they call up and in how much of the alphabet that font actually contains. And here is the hinge of this whole page: \mathcal{A} is not a command that converts A into a calligraphic letter. All it changes is the math font family in force over its argument; the character position (the slot) stays exactly where it was. The A is still the instruction “slot 65 of the current font”, now thrown at a different font — and whatever sits in that slot is what gets printed. Nearly every accident with these four alphabets grows out of that single fact.
| Command | Look | Package needed | Characters present |
|---|---|---|---|
\mathcal | Flowing calligraphic capitals | None — built in | Uppercase A–Z only |
\mathscr | A steeply slanted formal script | mathrsfs (or eucal) | Uppercase A–Z only |
\mathfrak | Angular blackletter | amssymb or amsfonts | Upper- and lowercase, digits |
\mathbb | Doubled-stroke bold | amssymb or amsfonts | Uppercase A–Z only (plus \Bbbk) |
Two lopsided facts jump out of the table. Only \mathcal is built in, and only \mathfrak carries lowercase. Between them those two explain most of the traps below. Start with the question that gets searched for most: how do you actually type ℝ?
How to type ℝ, ℕ and ℤ — and why \mathbb needs amssymb
Put \usepackage{amssymb} in the preamble and write $\mathbb{R}$ in the body. That is the whole recipe; amsfonts gives you the same \mathbb (amssymb loads amsfonts internally). Forget the package and the run stops with ! Undefined control sequence. Plain LaTeX simply has no blackboard bold at all, so this is the design, not a misconfiguration.
\usepackage{amssymb} % gives \mathbb, \mathfrak and \Bbbk
% ...
\[
\mathbb{N} \subset \mathbb{Z} \subset \mathbb{Q}
\subset \mathbb{R} \subset \mathbb{C}
\]Why is it not built in? Because of Knuth's taste. Blackboard bold seems to have started in France in the late 1950s and took hold in the Princeton mathematics department in the early 1960s; it reached print in the mid-1960s, with Gunning and Rossi's Analytic Functions of Several Complex Variables (1965) among the early books. Knuth, however, preferred plain boldface and deliberately left blackboard bold out of Computer Modern, the typeface he made for TeX. The AMS filled the gap in 1985 with a chalk-style blackboard bold for AMS-TeX, reached then by the command \Bbb — a name that survives to this day inside amsfonts.sty as an obsolete alias redirected to \mathbb. As a footnote to the taste question: Jean-Pierre Serre used blackboard bold in lectures but ordinary bold, consistently, in everything he published.
\mathbb{R}— the real numbers ℝ.\mathbb{C}— the complex numbers ℂ.\mathbb{Z}— the integers ℤ, from the German Zahlen (“numbers”); the choice is attributed to Hilbert, and the earliest known textbook use is Bourbaki's Algèbre (1947).\mathbb{Q}— the rational numbers ℚ.\mathbb{N}— the natural numbers ℕ.\mathbb{F}_q— the finite field with q elements; the subscript stays in ordinary italic.
\mathbb{k} prints ℸ — use \Bbbk for lowercase
Never hand \mathbb a lowercase letter. Reach for a blackboard-bold k by writing \mathbb{k} and you get, with no warning and no error, the Hebrew letter daleth ℸ. It follows exactly from the principle above: k remains the instruction “slot 107”, that instruction is handed to the msbm font, and what sits in slot 107 there is \daleth. For the same reason \mathbb{a} comes out as the turned G ⅁ (\Game) and \mathbb{1} as ⊮ (\nVdash). Every one of these compiles cleanly, so nothing tips you off until you look at the PDF.
% lowercase blackboard bold is its own command, not \mathbb{k}
\[
\Bbbk = \overline{\Bbbk}, \qquad V \otimes_{\Bbbk} W
\]The right form is \Bbbk. amssymb provides the blackboard-bold lowercase k as a standalone symbol, which is exactly what algebra documents that call a field k need. Note that it takes no argument: \Bbbk, not \mathbb{k}. For any other lowercase letter or digit — a blackboard-bold 1 or 2, a lowercase h — you need a different font package. dsfont offers capitals plus h, k and the digit 1 through \mathds; bbm supplies lowercase and digits through \mathbbm; bbold redefines \mathbb itself to cover a much wider range. That last one collides with amssymb, so if both are in the same document, decide first which package owns \mathbb.
\mathcal is uppercase-only: \mathcal{a} prints ⊣
Keep the argument of \mathcal to the capitals A–Z. Writing \mathcal{a} does not give you a malformed calligraphic a; it gives you an entirely unrelated ⊣ (\dashv), and not so much as a warning. \mathcal is defined as \DeclareSymbolFontAlphabet{\mathcal}{symbols} — a switch to the math symbol font cmsy10, which carries the calligraphic capitals in slots 65 to 90 while the lowercase and digit positions hold completely different symbols. And because every slot in that font is occupied, TeX never gets the chance to say “no such character”; it simply prints the neighbour it finds.
| What you wrote | What appears | Symbol living in that slot |
|---|---|---|
\mathcal{a} | ⊣ | \dashv |
\mathcal{b} | ⌊ | \lfloor |
\mathcal{g} | } | \rbrace |
\mathcal{o} | ≀ | \wr |
\mathcal{1} | ∞ | \infty |
\mathcal{2} | ∈ | \in |
By the same logic, \mathcal{Hom} does not give you the word “Hom”. Nor does it give three calligraphic letters: the H is calligraphic, but the o and the m come out as ≀ and ⇕. Remember that the argument of an ornamental alphabet is treated as a run of symbols, not a word. The practical rule is simple: pass \mathcal a single capital, always. \mathcal{A} for a family of sets, \mathcal{F} for the Fourier transform, \mathcal{B} for a σ-algebra, \mathcal{O} for a ring of integers — that is what it is for.
\mathcal vs \mathscr: loading mathrsfs
\mathcal is the calligraphic alphabet of the built-in cmsy10; \mathscr is the script of rsfs10, which arrives with \usepackage{mathrsfs}. Side by side they are obviously different hands. \mathcal is wide and only lightly ornamented; \mathscr slants far to the right with a strong contrast between thick and thin strokes — a proper formal script, and the usual choice for the \mathscr{L} of a Laplace transform or a Lagrangian. If you want two distinguishable ornamental alphabets in one paper, this is the least troublesome pairing.
\usepackage{mathrsfs} % adds \mathscr (RSFS); \mathcal is left alone
% ...
\[
\mathcal{F} \subset \mathcal{P}(X), \qquad
\mathscr{L}\{f\}(s) = F(s)
\]RSFS stands for Ralph Smith’s Formal Script; Ralph Smith, a physicist at the University of California, San Diego, drew it in Metafont and released version 1.0 in October 1991. In the README shipped with the font he explains that he closely imitated a formal script designed by R. Hunter Middleton, itself descended from the Spencerian and Copperplate hands that prevailed in the eighteenth century. The same README says he hoped to add lowercase letters one day and make a text font of it — a revision that never came. Which is why, to this day, writing \mathscr{a} puts this in your log: Missing character: There is no a in font rsfs10!
That line is, in fact, good news. Where \mathcal silently swaps in another symbol, \mathscr reports the missing character honestly: rsfs10 holds capitals only, so TeX is able to say so. There is also a second family behind \mathscr, the Euler Script called up by the eucal package. Euler was drawn by Hermann Zapf in 1980–81 on commission from the AMS, and it tries to capture the way a mathematician writes on a blackboard — upright rather than sloped. Its expression is nothing like the steeply inclined classical hand of RSFS.
| How you load it | What you get | Typeface produced |
|---|---|---|
\usepackage{mathrsfs} | \mathscr (\mathcal untouched) | RSFS |
\usepackage[scr]{rsfso} | \mathscr | RSFS with a gentler slope |
\usepackage[mathscr]{eucal} | \mathscr (\mathcal untouched) | Euler Script |
\usepackage{eucal} | \mathcal replaced | Euler Script |
\usepackage{calrsfs} | \mathcal replaced | RSFS |
The lower half of that table is where the traps are. calrsfs and a bare eucal overwrite \mathcal itself. A good share of the “my \mathcal suddenly changed shape” and “the letters differ from my co-author's build” questions trace back to one of these packages having been added by somebody. And if you load both mathrsfs and eucal with the mathscr option, whichever comes second wins \mathscr and you get a face you did not choose. Settle on one script family. That is the only reliable defence.
Why \mathfrak is the alphabet of ideals and Lie algebras
\mathfrak also arrives with amssymb (or amsfonts), but it is the only one of the four that carries capitals, lowercase and digits alike. It is also the only one whose everyday work is done by the lowercase letters. Ideals are written \mathfrak{p} for a prime, \mathfrak{m} for a maximal ideal, \mathfrak{a} in general; Lie algebras are \mathfrak{g}, \mathfrak{h}, \mathfrak{sl}, so that they can be told apart at a glance from the corresponding Lie groups G and H.
Why blackletter? The reason lies in printing history, not mathematics. In nineteenth-century Germany, German-language books were normally set in Fraktur. In 1876 Richard Dedekind, in the supplements he wrote for the third edition of Dirichlet's Vorlesungen über Zahlentheorie, replaced Kummer's ideal numbers with concrete sets of numbers and named them ideals. Fraktur was simply the contrasting alphabet a German compositor had ready to hand, so ideals were written in lowercase Fraktur. Long after German printing abandoned the type, the notation of algebra keeps the habit alive.
\usepackage{amsmath,amssymb} % amssymb: \mathfrak — amsmath: \operatorname
% ...
\[
\mathfrak{g} = \operatorname{Lie}(G), \qquad
\mathfrak{p} \subset \mathfrak{m} \subset \mathcal{O}
\]The Fraktur amssymb calls up is not a nineteenth-century face, incidentally, but Euler Fraktur (font eufm10), drawn by Hermann Zapf as part of AMS Euler. Legibility is much improved — yet it remains a busy alphabet. Pile up \mathfrak inside subscripts, or anywhere the type is set small, and \mathfrak{p} stops being distinguishable from \mathfrak{q}. Where the size drops, either move to a different symbol or name the letter once in the running text.
On XeLaTeX and LuaLaTeX: unicode-math and \symbb
On XeLaTeX or LuaLaTeX with unicode-math, all four ornamental alphabets come from a single OpenType math font and are called with \symbb, \symcal, \symscr and \symfrak. Because the Unicode character itself is selected, most of the traps on this page evaporate: \symbb{k} really does give 𝕜, and there is no \Bbbk to remember. What you actually get, though, depends on how much your chosen math font contains — whether \symcal and \symscr can be made to look different, for instance, is a property of the font. Choosing per engine is a matter for the “Math fonts” page.
% XeLaTeX or LuaLaTeX only
\usepackage{unicode-math}
\setmathfont{Latin Modern Math}
% ...
\[
\symbb{R}, \quad \symcal{F}, \quad \symscr{L},
\quad \symfrak{g}, \quad \symbb{k}
\]