Changing the numberings of nested lists in an Enumerate environment, in LaTeX
Question
I want to produce the following in LaTeX:
1. Item
2. Item
3a. Item
3b. Item
4. Item
5. Item
Basically I have already tried using nested enumerate
environments, but I have a problem with implementing the different numberings.
How can I do the above in LaTeX?
Solution
The purpose of the {enumerate}
environment is to number things algorithmically. If you really want the numbers to appear as shown in your question, I can't identify what algorithm you want to be used. For the example you show, I think the easiest method is just to program the labels yourself instead of trying to program LaTeX to do it. I would just do it this way:
\begin{itemize}
\item[1.] Item
\begin{itemize}
\item[2. ] Item
\item[3a. ] Item
\item[3b. ] Item
\item[4. ] Item
\end{itemize}
\item [5. ] Item
\end{itemize}
With LaTeX, the quickest path to a solution often involves brute force :-)
OTHER TIPS
Quick and dirty:
\documentclass{article} \begin{document} \renewcommand{\labelenumii}{\addtocounter{enumi}{1}\arabic{enumi}} %% Second list uses first counter \def\startenumtuple{\setcounter{enumii}{1}\addtocounter{enumi}{1} \renewcommand{\labelenumii}{\arabic{enumi}.\alph{enumii}}} \def\endenumtuple{ \renewcommand{\labelenumii}{\addtocounter{enumi}{1}\arabic{enumi}}} \noindent Here's my list: \begin{enumerate} \item Item \begin{enumerate} \item Item \startenumtuple \item Item \item Item \endenumtuple \item Item \item Item \end{enumerate} \item Item \end{enumerate} \end{document}
(Mica's version was used in the first iteration of this code)
The right way involves defining environments based on enumerate that do the right thing with the counters: the above code would need tweaking to get it to work right if you wanted to change the nesting of the list environments.
\renewcommand{\labelenumi}{\Roman{enumi}.}
\renewcommand{\labelenumii}{\Roman{enumi}. \alph{enumii}}
\noindent Here's my list:
\begin{enumerate}
\item Item 1.
\begin{enumerate}
\item List 2, Item 1
\item List 2, Item 2
\end{enumerate}
\item Item 2.
\item Item 3.
\end{enumerate}
Then change the \Roman
in the renewcommand
to whatever you want it to be: \alph
or \arabic