## LaTeX forum ⇒ Text Formatting ⇒ Using enumerate package with [1]

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
latexforever
Posts: 120
Joined: Fri Nov 14, 2008 9:40 pm

### Using enumerate package with [1]

Hello,

I would like to use the enumerate package to have such an output:

[1]: My first item,
[2]: My second item.

Inferring its manual (http://www.dd.chalmers.se/latex/Docs/PDF/enumerate.pdf), I would use such a partial code:

\begin{enumerate}[[1]:]\item My first item,\item My second item.\end{enumerate}

It does not work. I tried

\begin{enumerate}[{[}1{]:}]\item My first item,\item My second item.\end{enumerate}

with no success too.

Any suggestion would be much appreciated.

Stefan Kottwitz
Posts: 9560
Joined: Mon Mar 10, 2008 9:44 pm
Hi Luca,

the second code
\begin{enumerate}[{[}1{]:}]

worked for me as well as
\begin{enumerate}[{[1]:}]

Stefan

latexforever
Posts: 120
Joined: Fri Nov 14, 2008 9:40 pm
Thanks for your answer, Stefan. That is possible that I made a typo when trying locally. It now works.

Is there a preferred (in the sense of the enumerate package, not in our sense) form?

Thanks.

Stefan Kottwitz
Posts: 9560
Joined: Mon Mar 10, 2008 9:44 pm
Hi Luca,

latexforever wrote:Is there a preferred (in the sense of the enumerate package, not in our sense) form?

regarding the enumerate-package, I don't see a reason to prefer a certain form as long as it's working.
But in general and in my opinion I would be careful when grouping by {...} to avoid changes in the kerning between characters, that's why I often prefer to use {word} instead of {w}ord for instance when I want to protect the first letter in this case.

Stefan

gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm
You can also use the enumitem package:

\documentclass{article}\usepackage{enumitem} \begin{document} \begin{enumerate}[label={[}\arabic*{]}:]   \item first item.   \item second item.\end{enumerate} \end{document}
1,1,2,3,5,8,13,21,34,55,89,144,233,...

latexforever
Posts: 120
Joined: Fri Nov 14, 2008 9:40 pm
gmedina wrote:You can also use the enumitem package:

\documentclass{article}\usepackage{enumitem} \begin{document} \begin{enumerate}[label={[}\arabic*{]}:]   \item first item.   \item second item.\end{enumerate} \end{document}

Pretty good! I will check it too. Thanks.

Stefan_K wrote:Hi Luca,

latexforever wrote:Is there a preferred (in the sense of the enumerate package, not in our sense) form?

regarding the enumerate-package, I don't see a reason to prefer a certain form as long as it's working.
But in general and in my opinion I would be careful when grouping by {...} to avoid changes in the kerning between characters, that's why I often prefer to use {word} instead of {w}ord for instance when I want to protect the first letter in this case.

Ok. Thanks.

rf
Posts: 21
Joined: Mon Jul 20, 2009 5:27 pm
if you have
\let\lbrack[\let\rbrack]

and then
\begin{enumerate}[\lbrack1{\rbrack:}]

you get the correct result.

tex doesn't do bracket matching, so there's a lot of requests like
this

latexforever
Posts: 120
Joined: Fri Nov 14, 2008 9:40 pm
Thanks.