I'm new to TeX and tried to enter an equation using \mathbb. I received a prompt

LaTeX Error: \mathbb allowed only in math mode.
See the LaTeX manual or LaTeX Companion for explanation.

I thought I would try here for an explanation.

  • 1
    Phil's answer below is correct, but a further tip: the macro \mathbb typesets capital letters as "black-board bold" symbols, such as the symbol ℝ which usually denotes the set of real numbers (and which is produced by \mathbb{R} in math mode). Commented Apr 14, 2011 at 6:48

3 Answers 3


You enter math mode by typing a dollar sign $, and you leave math mode by typing another dollar sign $. You should take a look at Chapter 3 of The Not So Short Introduction to LaTeX


I guess that an even better way to enter math mode is to use \( and \), as discussed in this answer.


TeX knows several modes, two of them are math mode and display math mode. Typesetting of ordinary text such as words nor numbers is different compared to mathematical formulas or a mathematical identifier such as x, which should look different from the text x (it does differ here in this editor only vaguely)

In order to let TeX know which mode should be used, there are indicators to enter math mode:

  • Inline math mode, being entered $ and closed with $
  • Display math mode, used with an enclosing $$...$$ in plain TeX or with \[...\] in LaTeX
  • Typing inside \begin{math}...\end{math} in LaTeX
  • Several math environments in LaTeX enter the math mode automatically, such as equation, align, alignedat, gather etc.

Several characters/symbols being connected to math content require entering the math mode, such as \mathbb{R} etc.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .