4.4.1 Unordered Lists
Unordered lists are created using the itemize environment.
Example:
Another Example:
Changing the default markers is covered in §8.2. Redefining Commands,
but it's also possible to override the default marker for a
particular item, as in this example (recall the double-dagger
symbol command \ddag
from Table 4.2):
Be careful about using square brackets [] inside an optional argument. Grouping is required, as in:
Similarly if the item starts with an open square bracket [, as in:
4.4.1.1 Nested Lists
It is also possible to nest itemize environments. The following example has three levels, each using its own default marker.
\begin
{itemize}
\item
Animal
\begin
{itemize}
\item
Mammals
\item
Birds
\item
Reptiles. For example:
\begin
{itemize}
\item
dinosaurs
\item
crocodiles
\end
{itemize}
\end
{itemize}
\item
Vegetable
\begin
{itemize}
\item
Cultivated
\item
Wild
\end
{itemize}
\item
Mineral
\end
{itemize}
You might have noticed the code in the above example is a little difficult to read. Each new list item starts a new paragraph, so it doesn't matter if we have blank lines before each item. Also, recall from §2. Some Definitions that spaces at the start of each line of code are ignored, so it's possible to make the code more readable without affecting the final result:
It's now a little easier to see which \begin{itemize}
matches
up with the corresponding \end{itemize}
.
Example (Four Levels)
This example has four levels, which is the maximum allowed by most classes.
\begin
{itemize}
\item
Animal
\begin
{itemize}
\item
Mammal
\begin
{itemize}
\item
Placental
\item
Monotreme
\begin
{itemize}
\item
Platypus
\end
{itemize}
\item
Marsupial
\begin
{itemize}
\item
Kangaroo
\item
Koala
\end
{itemize}
\end
{itemize}
\item
Reptile
\end
{itemize}
\item
Vegetable
\item
Mineral
\end
{itemize}
If you try adding a further level, LaTeX will give a “Too deeply nested” error.