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}
2
  • 1
    Try to add the package amssymb.
    – Fran
    Commented Apr 4, 2015 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. tex.stackexchange.com/questions/38769/…) Commented Apr 4, 2015 at 22:16

1 Answer 1

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

1

You must log in to answer this question.

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