Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I'm using enumerate to type up homework solutions, based on the following MWE. When I remove the [(a)] from the enumerate, there isn't an error, but when I add it, I get the "perhaps a missing \item" error. How can I fix this? I don't want to add an \item in front of the solution, since it isn't part of the list per se, and I don't want to remove the custom bullet because in my full document, this is part of a nested list.

\documentclass[12pt]{article}

\begin{document}
\begin{enumerate}[(a)]
\item $n(n+1)/2 \in O(n^3)$

True, because $n(n+1)/2$ is of order 2, which is less than order 3. 

\item $n(n+1)/2 \in O(n^2)$

\end{enumerate}
\end{document}
share|improve this question
add comment

1 Answer 1

up vote 5 down vote accepted

You need to include the enumerate package, since it redefines the enumerate environment to manage an optional argument:

enter image description here

\documentclass[12pt]{article}
\usepackage{enumerate}% http://ctan.org/pkg/enumerate
\begin{document}
\begin{enumerate}[(a)]
\item $n(n+1)/2 \in O(n^3)$

True, because $n(n+1)/2$ is of order 2, which is less than order 3. 

\item $n(n+1)/2 \in O(n^2)$

\end{enumerate}
\end{document}​

A similar format would have been achieved with the enumitem package:

\usepackage{enumitem}% http://ctan.org/pkg/enumitem
%...
\begin{enumerate}[label=(\alph*)]
  %...
\end{enumerate}
share|improve this answer
    
Thank you, adding \usepackage{enumerate} fixed the error in the MWE, and I fixed the additional problem that was occurring in my full example. (I had a ` in place of a /`). –  Ricardo Altamirano Feb 1 '12 at 22:22
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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