3

Possible Duplicate:
Enumerated list with square brackets

Using the help of this answer, I am trying to create a list in which each item is numbered by [1], [2], etc.

\documentclass{article}
\usepackage{enumitem}
\begin{document}
\begin{enumerate}[label=[\arabic*]]
\item First item
\item Second item
\end{enumerate}
\end{document}

However, because the ] character signifies the end of the [label=, I'm getting lots of errors.

Is there a way to "escape" the ] character so that this does not happen? Or is there a better way to make this list in the first place?

jamaicanworm
  • 29,114

1 Answers1

7

You need to enclose the label within a {} as in label={[\arabic*]}:

enter image description here

\documentclass{article}
\usepackage{enumitem}
\begin{document}
\begin{enumerate}[label={[\arabic*]}]
    \item First item
    \item Second item
\end{enumerate}
\end{document}​
Peter Grill
  • 223,288
  • 1
    Another option, not requiring additional braces, is to use \lbrack, \rbrack as in \begin{enumerate}[label=\lbrack\arabic*\rbrack]. – Gonzalo Medina Apr 19 '12 at 02:44
  • @GonzaloMedina Thanks! Peter's answer is more convenient to implement, but your solution more directly addresses the question I posed. I'm sure that if you turn it into an answer, you'll get some upvotes! :) – jamaicanworm Apr 19 '12 at 03:57