Blackboard Bold LaTeX: \mathbb, โ, โ, โค and ๐
November 11, 2026 ยท 9 min read
Blackboard Bold LaTeX: \mathbb for R, N, Z, Q and C
Blackboard bold LaTeX commands give you the double-struck letters used for number sets: \mathbb{R} for the reals, \mathbb{N} for the naturals, \mathbb{Z} for the integers. Load amssymb in a .tex file and they work in math mode. This page also covers digits like ๐, lowercase letters, and what changes in Markdown math.
How Do You Write Blackboard Bold in LaTeX?
Add \usepackage{amssymb} to your preamble, then wrap a capital letter in \mathbb inside math mode. The command itself is defined by the amsfonts package. amssymb loads amsfonts for you, so either package works, and this is the setup almost every LaTeX blackboard bold example assumes.
\documentclass{article}
\usepackage{amssymb}
\begin{document}
Let $f \colon \mathbb{R}^n \to \mathbb{R}$ and $k \in \mathbb{Z}$.
\end{document}
That compiles to "Let f: โโฟ โ โ and k โ โค" with proper double-struck letters. Two errors catch most people:
- Undefined control sequence on
\mathbbmeans the package isn't loaded. - \mathbb allowed only in math mode means you wrote
\mathbb{R}in running text. Wrap it in$...$.
Watch the braces as well. Write \mathbb{R}^n, not \mathbb{R^n}. In pdfLaTeX the second form doesn't raise an error. It prints โ followed by a โ symbol, because the AMS font has a different glyph in the slot where n would be. We tested this on TeX Live 2025.
Number Set Symbols: โ, โค, โ, โ and โ
The real number symbol in LaTeX is \mathbb{R}, which renders as โ (Unicode U+211D). The other number sets follow the same pattern, and a few more double-struck letters show up often in probability and algebra.
| Set or meaning | Command | Renders as | Unicode |
|---|---|---|---|
| Natural numbers | \mathbb{N} | U+2115 | |
| Integers | \mathbb{Z} | U+2124 | |
| Rational numbers | \mathbb{Q} | U+211A | |
| Real numbers | \mathbb{R} | U+211D | |
| Complex numbers | \mathbb{C} | U+2102 | |
| Quaternions | \mathbb{H} | U+210D | |
| Probability, projective space | \mathbb{P} | U+2119 | |
| Finite field of order q | \mathbb{F}_q | U+1D53D | |
| Expected value | \mathbb{E} | U+1D53C |
Authors disagree on whether โ includes 0, so define it once in your text. All 26 capitals work with \mathbb. Seven of them (โ โ โ โ โ โ โค) live in Unicode's Letterlike Symbols block, and the rest sit in the Mathematical Alphanumeric Symbols block. That split only matters when you type the characters directly.
Matrix spaces use the same notation with an exponent, as in \mathbb{R}^{m \times n}. The Markdown matrix guide shows that in context. For the symbols that go with these sets, such as โ and โ, see our LaTeX set notation reference.
Blackboard Bold LaTeX Shortcuts Like \R and \N
Typing \mathbb{R} fifty times gets old, so many authors add shortcuts to the preamble:
\newcommand{\N}{\mathbb{N}}
\newcommand{\Z}{\mathbb{Z}}
\newcommand{\Q}{\mathbb{Q}}
\newcommand{\R}{\mathbb{R}}
\newcommand{\C}{\mathbb{C}}
After that, $x \in \R$ prints x โ โ. Don't try the same trick for every letter. \P, \S, \L, \O and \H already exist in LaTeX (pilcrow, section sign, ล, ร and an accent), so \newcommand stops with an "already defined" error. Pick a longer name such as \Prob.
KaTeX, the math renderer in our editor and many other Markdown tools, ships some of these shortcuts built in. In our tests with KaTeX 0.16, \N, \Z, \R, \Reals, \reals, \natnums, \Complex and \cnums all render. \Q and \C don't. They throw "Undefined control sequence", so you can't assume all five number-set shortcuts exist.
The portability trap runs the other way too. \R works in KaTeX-based Markdown math without setup, then breaks a real .tex file that lacks the \newcommand line. We prefer writing \mathbb{R} in full in any notes that might move between Markdown and LaTeX, because it works in both with no preamble. The Markdown vs LaTeX comparison covers why that move happens so often.
Why Doesn't \mathbb{1} Work? Digits and the Indicator Function
The AMS blackboard alphabet covers capital letters only. \mathbb{1} in pdfLaTeX gives no error, but it prints โฎ (the \nVdash relation), because that's the glyph sitting in the font slot where 1 would go. Lowercase letters fail the same way: \mathbb{r} prints a small set-minus sign.
For the indicator function ๐, load a font that actually has a double-struck one. The usual choice is dsfont, which ships in the CTAN package named doublestroke:
\usepackage{dsfont}
...
$\mathds{1}_A(x) = 1$ if $x \in A$, otherwise $0$
\mathds covers all capitals, the digit 1, and lowercase h and k. Loading it as \usepackage[sans]{dsfont} switches to a sans-serif design. Because \mathds is a separate command, your \mathbb letters stay in the AMS style.
Lowercase Blackboard Bold: \Bbbk, bbm, bbold and unicode-math
amssymb offers exactly one lowercase double-struck glyph, \Bbbk (๐, common for a ground field). For anything else, pick a package:
| Package | Command | Lowercase | Digits | Caveat |
|---|---|---|---|---|
| dsfont | \mathds | h and k only | 1 only | Based on Computer Modern Roman |
| bbm | \mathbbm | All | 1 and 2 | Metafont source only |
| bbold | \mathbb | All | 0 to 9 | Takes over \mathbb for the whole document |
| unicode-math | \symbb | All | 0 to 9 | Needs XeLaTeX or LuaLaTeX |
bbm also adds \mathbbmss (sans) and \mathbbmtt (typewriter) variants. bbold is a geometric sans design, and since it redefines \mathbb, your โ changes shape too.
With XeLaTeX or LuaLaTeX, unicode-math maps \symbb (and \mathbb) to the Unicode double-struck alphabet. Then \symbb{1} and \symbb{r} give ๐ and ๐ฃ, and you can paste those characters straight into the source.
% compile with xelatex or lualatex
\usepackage{unicode-math}
...
$\symbb{1}_A(x)$, $\symbb{k}[x]$, $\mathbb{R}^3$
That prints the indicator ๐ with subscript A, a polynomial ring over ๐, and โยณ, all from the one math font, with no extra font packages. It only works when your math font includes the glyphs, so check the PDF before you submit.
Blackboard Bold in Markdown and KaTeX
In Markdown math, blackboard bold works the same way for capitals. Write $\mathbb{R}$ inline or put it in a $$ block. KaTeX predefines the AMS symbols, so there's no package to load and no preamble to write. The Markdown equation guide explains the delimiters themselves.
Blackboard bold LaTeX that compiles in a .tex file doesn't always survive the trip to the web. Here's what we found testing KaTeX 0.16, the version our editor uses:
- Works:
\mathbbwith any capital, the older\Bbb,\Bbbk, and KaTeX's built-in shortcuts such as\Rand\Reals. - Errors in red:
\mathds,\mathbbm,\symbb,\Qand\C. There's no way to load a package to fix this. - Quietly wrong:
\mathbb{1}renders a plain upright 1, and\mathbb{r}renders an ordinary italic r. Neither looks double-struck.
That last point is the main limitation for web math. KaTeX has no double-struck digits or lowercase letters (apart from ๐). If you need ๐, paste the Unicode character into the math. KaTeX logs a warning and draws it with a system font, so how it looks depends on your reader's device. Our KaTeX vs LaTeX comparison lists the other LaTeX features KaTeX leaves out.
Try it below. The split view shows the rendered math on the right as you type:
For a single formula you want as an image, the LaTeX equation editor renders it with KaTeX and exports PNG or SVG.
\mathbb vs \mathbf for Number Sets
Older books and many journals print the reals as a bold upright R (\mathbf{R}) instead of โ. Both are correct. Blackboard bold grew out of ways to mark bold letters on typewriters and chalkboards, and it later became its own typeface. Pick one style per document. If your vectors are already bold, \mathbb keeps sets visually distinct from them.
Keep in mind that \mathbb is an alphabet, not a weight. \mathbb{\alpha} won't give you a double-struck alpha. Both KaTeX and pdfLaTeX just print an ordinary ฮฑ. Script and fraktur letters (\mathcal, \mathfrak) are separate alphabets with their own conventions. Our LaTeX math fonts reference covers them alongside bold and sans serif.
How Do You Type โ, โค and โ Outside LaTeX?
In plain text, chat or a word processor, use the Unicode characters directly. Each has an HTML named entity too, listed in the WHATWG character reference table:
| Symbol | Code point | HTML entity |
|---|---|---|
| โ | U+211D | ℝ or ℝ |
| โค | U+2124 | ℤ or ℤ |
| โ | U+2115 | ℕ or ℕ |
| โ | U+211A | ℚ or ℚ |
| โ | U+2102 | ℂ or ℂ |
Unicode's Mathematical Alphanumeric Symbols block holds the remaining capitals (๐ธ at U+1D538 onward), lowercase ๐ to ๐ซ, and digits ๐ to ๐ก, with ๐ at U+1D7D9. How they look depends on the reader's font, so stick with LaTeX when the math matters.
Frequently Asked Questions
Blackboard bold LaTeX comes down to one command for print and a few rules for the web. Use \mathbb with amssymb for capitals, dsfont or unicode-math for ๐, and write \mathbb{R} in full when the same math has to compile and render in Markdown. Paste the Markdown math from this page into the editor to check it in the live preview before it goes into your document.