157

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.

  • 9
    This was my very first LaTeX error! It took me days to figure out; no online resource I read thought to mention that it was assuming the amssymb package. – Ryan Reich Dec 19 '11 at 16:19
  • tex.ac.uk/cgi-bin/texfaq2html?label=numbersets describes the AMS fonts, and says "Support files for using the fonts, both under Plain TeX and LaTeX (packages amssymb and amsfonts), are available. [...]". this of course doesn't help, if you're a person who doesn't like to read faq answers... – wasteofspace Dec 19 '11 at 16:56
193

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 19 January 2017) of the document, it is table 307 with the caption Math alphabets. It is the final table in chapter 3 Mathematical symbols.

  • Thank you. Would the same be sufficient for \mathds?? – Ramana Venkata Dec 19 '11 at 11:03
  • 2
    @RamanaVenkata No, for that you have to load the dsfont package. – Torbjørn T. Dec 19 '11 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. – M.D. Jun 1 '18 at 9:07
  • 2
    Apparently amsmath does not load amsfonts automatically. – Solomon Ucko Jan 25 '19 at 20:41
  • 1
    @SolomonUcko -- Indeed, amsmath does not load amsfonts. When these packages were created, memory was at a premium, and loading of necessary packages was left to the user. – barbara beeton Jan 10 at 3:07
0

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.