Text Formatting ⇒ advanced use of enumerate
Re: advanced use of enumerate
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
advanced use of enumerate
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}-
hugovdberg
- Posts: 133
- Joined: Sat Feb 25, 2012 6:12 pm
advanced use of enumerate
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)]}