1

Noob here: first time using Latex and can't seem to write one line of code without getting ! Undefined control sequence. error. Here is the line it has a problem with:

$$ \left \{ x\in\mathbb{Z}:-2\leq x< 7 \right \} $$

And here is the rest of my document for context:

\documentclass{article}
\usepackage{amsmath}
\usepackage{graphicx}
\usepackage{amstext}
\begin{document}

\section{Chapter 1: Sets}
\subsection{Introduction to Sets}
Write each of the following sets by listing their elements between braces:
\begin{enumerate}

\item Problem 3
$$ \left \{ x\in\mathbb{Z}:-2\leq x< 7 \right \} $$

\end{enumerate}

\end{document}
Summer
  • 55
  • 1
    Try to add the package amssymb. – Fran Apr 04 '15 at 22:00
  • Welcome to TeX.SX! When reporting errors it is always best to post the complete error, that can make it easier to understand what is going on. (Your example makes it easy to figure what the problem is though, and it is a fairly common one. See e.g. http://tex.stackexchange.com/questions/38769/mathbbz-yields-undefined-control-sequence-error/38771#38771) – Torbjørn T. Apr 04 '15 at 22:16

1 Answers1

2

You forgot to use amssymb. Also, you are better off using \[ ... \] rather than $$. In general, using LaTeX is not for the faint of heart; the challenges ahead of you are much greater.

\documentclass{article}
\usepackage{amsmath}
\usepackage{graphicx}
\usepackage{amstext}
\usepackage{amssymb} % Missing in your example. 
\begin{document}
\section{Chapter 1: Sets}
\subsection{Introduction to Sets}
Write each of the following sets by listing their elements between braces:
\begin{enumerate}
    \item Problem 3 \[ \left \{ x\in\mathbb{Z}:-2\leq x< 7 \right \} \]
\end{enumerate}
\end{document}

enter image description here

Yossi Gil
  • 15,951