Text Formatting ⇒ advanced use of enumerate
Re: advanced use of enumerate
Thank you; that works.
NEW: TikZ book now 40% off at Amazon.com for a short time.

advanced use of enumerate
There is a problem with the counter while using nested enumeration.
Code: Select all
\documentclass{article}
\newcommand\itemone{\stepcounter{enumi}\item[$\ast$\, \theenumi.]}
\newcommand\itemtwo{\stepcounter{enumi}\item[$\ast\ast$\, \theenumi.]}
\newcommand\itemthree{\stepcounter{enumi}\item[$\ast\ast\ast$\, \theenumi.]}
\begin{document}
\begin{enumerate} \item Consider the following items
\begin{enumerate}
\itemone first item.
\item second item.
\itemone third item.
\itemtwo fourth item.
\itemthree fifth item.
\itemone sixth item.
\end{enumerate}
\item This is the second item of the main list
\end{enumerate}
\end{document}
-
- Posts: 133
- Joined: Sat Feb 25, 2012 6:12 pm
advanced use of enumerate
I think I know what your problem is, but you don't explain what you would like to accomplish. I guess your main problem is that the nested list actually starts at 2, and the second item of the outer list continues from where the previous nested list ended. If you always use the asterisked version as a nested list you could simply change the references to counter
enumi
to enumii
, this is the counter for the second level. This makes sure the second item of the nested list also gets the correct number. Since this counter is by default setup with an alphabetic counter between brackets I changed that as well for consistency. A code snippet showing the new \newcommands
:
Code: Select all
\newcommand\itemone{\stepcounter{enumii}\item[$\ast$\, (\theenumii)]}
\newcommand\itemtwo{\stepcounter{enumii}\item[$\ast\ast$\, (\theenumii)]}
\newcommand\itemthree{\stepcounter{enumii}\item[$\ast\ast\ast$\, (\theenumii)]}
Ubuntu 13.10 + Tex Live 2013 + Texmaker / Windows 7 Pro + MikTex 2.9 + TexnicCenter / Android 4.3 + TexPortal + DroidEdit