About
Shop
LaTeX
Software
Books
Gallery
News
Contact
Blog
Settings
Latest news 2019-11-04: The giveaway of two signed copies of “Quack, quack, quack. Give my hat back!” has closed and the winning entrants have been selected. Thank you to everyone who took part.


4.4.1 Unordered Lists

Unordered lists are created using the itemize environment.

Example:

\begin{itemize}
\item Animal
\item Vegetable
\item Mineral
\end{itemize}

Image showing typeset output (click here for a more detailed description).

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):

\begin{itemize}
\item Animal
\item[\ddag] Vegetable
\item Mineral
\end{itemize}

Image showing typeset output (click here for a more detailed description).

Be careful about using square brackets [] inside an optional argument. Grouping is required, as in:

\begin{itemize}
\item Animal
\item[{[X]}] Vegetable
\item Mineral
\end{itemize}

Image showing typeset output (click here for a more detailed description).

Similarly if the item starts with an open square bracket [, as in:

\begin{itemize}
\item Animal
\item {[sic]} Wegetable
\item Mineral
\end{itemize}

Image showing typeset output (click here for a more detailed description).


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}

Image showing typeset output (click here for a more detailed description).

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:

\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}

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}

Image showing typeset output (click here for a more detailed description).

If you try adding a further level, LaTeX will give a “Too deeply nested” error.

© 2012 Dickimaw Books. "Dickimaw", "Dickimaw Books" and the Dickimaw parrot logo are trademarks. The Dickimaw parrot was painted by Magdalene Pritchett.

Terms of Use Privacy Policy Cookies Site Map FAQs