I am using WinEdt 6 for compiling my TeX documents. I am getting an error with contains the line $\mathbb{Z}$
showing that it is undefined control sequence. How should I rectify it? Should I include any math packages or something. I am a beginner in using TeX.
4 Answers
Load the amsfonts
package, this provides that command:
\documentclass{article}
\usepackage{amsfonts}
\begin{document}
$\mathbb{Z}$
\end{document}
Optionally you could load amssymb
, as this in turn loads amsfonts
.
\documentclass{article}
\usepackage{amssymb}
\begin{document}
$\mathbb{Z}$
\end{document}
For reference, the Comprehensive LaTeX Symbol List has also a table of mathematical alphabets, and the packages required for using them. In the current version (dated 25 June 2020) of the document, it is table 316 with the caption Math Alphabets. It is the final table in chapter 3 Mathematical symbols.
-
-
3@RamanaVenkata No, for that you have to load the
dsfont
package. Dec 19, 2011 at 11:07 -
I guess the document you reference is subject to chance, if other people are looking for it here a description that is hopefully less prone to change. Look at the chapter called Mathematical symbols (currently chapter 3) and look for the table called "mathematical alphabets". It is last table in that chapter at this moment and currently numbered 307. Jun 1, 2018 at 9:07
-
2
-
1@SolomonUcko -- Indeed,
amsmath
does not loadamsfonts
. When these packages were created, memory was at a premium, and loading of necessary packages was left to the user. Jan 10, 2020 at 3:07
The \mathbb
command is provided via the amsfonts
package. Add
\usepackage{amsfonts}
to the preamble to solve this problem.
You can load many other fonts for \mathbb
with either unicode-math
, which supports modern OpenType math fonts, or mathalpha
, which supports legacy 8-bit math alphabets.
-
-
@CharlieParker obviously that depends on your document. If you want some other alphabets, like script and other not provided by
amsfonts
you will end up loading many more packages than justunicode-math
. Another example whenunicode-math
is more useful is when you need to load many fonts (not recommended but it is possible). You have to give a try tounicode-math
and decide by yourself which package is better in certain contexts. Feb 22, 2022 at 1:16
You can use the following two packages.
\usepackage{amsmath}
\usepackage{amssymb}
-
1Welcome to TSE. Your answer adds nothing new to the already existing answers. May 22, 2022 at 14:35
-
While true that blackboard bold Z will appear if these two packages are used, only
amsfonts
is needed, and that is loaded automatically byamssymb
. May 22, 2022 at 16:31
amssymb
package.\usepackage{amsfonts}
? I don't think anything else is needed in a very basic overleaf new doc.