How to costumize list achieved by enumerate command?

999 views
Skip to first unread message

dd

unread,
Oct 5, 2010, 5:05:37 PM10/5/10
to LaTeX Users Group
Hello!
I would like to have following result:

(A1) something 1
(A2) something 2
(A3) something else

and I would like to use enumerate command to do this:

\begin{enumerate}
\item something 1
\item something 2
\item something else
\end{enumerate}

I want to know if it is possible to redefine printed indexes produced
by enumerate command? How to do that?

Peter Flynn

unread,
Oct 5, 2010, 5:28:16 PM10/5/10
to latexus...@googlegroups.com

Yes, very easy. You just redefine the \labelenumi command:

\documentclass{letter}
\renewcommand{\labelenumi}{(A\arabic{enumi})}
\begin{document}

\begin{enumerate}
  \item something 1
  \item something 2
  \item something else
\end{enumerate}
\end{document}

There is a separate command for each of the four predefined list levels: \labelenumi, \labelenumii, \labelenumiii, and \labelenumiv, so you can redefine the appearance of any level of any list. Each one uses a separate counter (enumi - enumiv) which can be formatted with \arabic, \roman, \Roman, etc.

The equivalents for bulleted lists are \labelitemi, ... \labelitemiv.

There is also the enumerate package, which does this and lots of other stuff, and the mdwlist package, which implements compact lists and stop-restart lists to preserve numbering across other material.

///Peter

Werner Grundlingh

unread,
Oct 5, 2010, 6:22:30 PM10/5/10
to LaTeX Users Group
...another option would be to use the enumitem package, available
online via CTAN from:
http://tug.ctan.org/cgi-bin/ctanPackageInformation.py?id=enumitem

In your case, the following should do the trick:

\documentclass{article}
\usepackage{enumitem}
\begin{document}
\begin{enumerate}[label=(A\arabic*)]
\item something 1
\item something 2
\item something else
\end{enumerate}
\end{document}

Werner
Reply all
Reply to author
Forward
0 new messages