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.

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?

share|improve this question

marked as duplicate by Werner, Thorsten, Ulrich Schwarz, Joseph Wright Apr 19 '12 at 6:40

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1 Answer 1

up vote 6 down vote accepted

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}​
share|improve this answer
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 2: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 3:57

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