Fix the \mathbb undefined control sequence error.
The undefined control sequence error with \mathbb happens because the command requires a math font package that is not loaded by default. Add \usepackage{amssymb} or \usepackage{amsfonts} to your preamble to make it work.
The short answer: add \usepackage{amssymb} to your preamble. Standard LaTeX does not include blackboard bold characters without an external font package.
Why the error happens
Plain LaTeX knows basic math symbols, but blackboard bold letters such as \mathbb{R}, \mathbb{Z}, and \mathbb{N} belong to the American Mathematical Society font collection. When you type \mathbb without loading the package that defines it, the compiler hits a backslash command it does not recognize and stops.
The log points straight at the failing line. Look for the line starting with l. followed by the line number, and check the token right before the line break. If it is \mathbb, the fix is adding the missing package line before \begin{document}.
How to fix it
Load amssymb in the preamble
Add \usepackage{amssymb} between \documentclass and \begin{document}. This package loads the AMS symbols and automatically pulls in amsfonts, enabling \mathbb commands across your document.
\documentclass{article} \usepackage{amssymb} \begin{document} Let $x \in \mathbb{R}^n$. \end{document}Check for spelling and capitalization
LaTeX commands are case-sensitive. Typing \Mathbb or \mathbbb will trigger the exact same undefined control sequence error because the compiler checks every character against its internal dictionary.
Verify the package placement
A \usepackage command must sit in the preamble. Putting it inside the body after \begin{document} raises a different error about preamble-only commands, so ensure it lives at the top of your main file.
Other missing packages that cause the same error
The undefined control sequence error is the most common issue in LaTeX, and missing packages cause most instances. Common commands and their required packages include:
\citep and \citet need natbib. \includegraphics needs graphicx. \toprule, \midrule, and \bottomrule need booktabs. \href and \url need hyperref. Whenever a command fails right after you paste a snippet from an online guide, check whether the source loaded a package your document skipped.
Questions
Why does \mathbb give an undefined control sequence error?
Standard LaTeX does not include blackboard bold fonts by default. The command requires either amsfonts or amssymb to be loaded in the preamble.
Should I use amsfonts or amssymb?
Use amssymb because it includes everything in amsfonts while adding extra math symbols. Loading amssymb alone is enough for \mathbb.
Where should \usepackage{amssymb} go?
It must go in the preamble, which is the space between \documentclass{article} and \begin{document}. Placing it in the body causes a preamble-only error.
What if the package is loaded and I still get the error?
Check for typos in \mathbb, make sure you are inside math mode using dollar signs or an environment, and verify that invisible characters from a PDF or Word paste did not corrupt the backslash.
Does Texeno require different package setups than a local TeX Live installation?
No. Texeno compiles documents using TeX Live 2026 with standard TeX Live package distributions, so any package that works locally works on Texeno without manual installation.
Try your own paper in Texeno.
Start free, upload a project as a .zip and press Recompile. Upgrade when you need longer compiles.
Start writing