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.
Asked
Active
Viewed 5.9e+01k times
248
barbara beeton
- 88,848
Ramana Venkata
- 2,583
4 Answers
305
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.
Niko Fohr
- 744
- 1
- 7
- 15
Torbjørn T.
- 206,688
-
-
3
-
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. – Maarten Derickx Jun 01 '18 at 09:07
-
-
2
-
1@SolomonUcko -- Indeed,
amsmathdoes not loadamsfonts. When these packages were created, memory was at a premium, and loading of necessary packages was left to the user. – barbara beeton Jan 10 '20 at 03:07 -
which of the two is better? Giving two options is confusing without further remarks. – Charlie Parker Feb 22 '22 at 00:23
-
all you need is
\usepackage{amsfonts}the rest of the answer is confusing. – Charlie Parker Feb 22 '22 at 00:27 -
@CharlieParker Yes, perhaps mentioning
amssymbwas unnecessary, I can't remember now why I added it in the first place ... It wasn't completely without further remarks though, I do say thatamssymbis an option because "this in turn loadsamsfonts". So in that sense they do exactly the same thing with regard to\mathbb. Whatamssymbdoes more is to provide definitions for various mathematical symbols. – Torbjørn T. Feb 22 '22 at 20:30
6
The \mathbb command is provided via the amsfonts package. Add
\usepackage{amsfonts}
to the preamble to solve this problem.
Rushi
- 837
Khawar Islam
- 175
- 1
- 8
2
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.
Davislor
- 44,045
-
-
@CharlieParker obviously that depends on your document. If you want some other alphabets, like script and other not provided by
amsfontsyou will end up loading many more packages than justunicode-math. Another example whenunicode-mathis more useful is when you need to load many fonts (not recommended but it is possible). You have to give a try tounicode-mathand decide by yourself which package is better in certain contexts. – Luis Turcio Feb 22 '22 at 01:16
2
You can use the following two packages.
\usepackage{amsmath}
\usepackage{amssymb}
Sourav De
- 21
-
1Welcome to TSE. Your answer adds nothing new to the already existing answers. – José Carlos Santos May 22 '22 at 14:35
-
While true that blackboard bold Z will appear if these two packages are used, only
amsfontsis needed, and that is loaded automatically byamssymb. – barbara beeton May 22 '22 at 16:31
amssymbpackage. – Ryan Reich Dec 19 '11 at 16:19\usepackage{amsfonts}? I don't think anything else is needed in a very basic overleaf new doc. – Charlie Parker Feb 22 '22 at 00:24