Even if your paragraphs are of the highest typographical quality, some things are better expressed using lists. As the name implies: they are ideal for listing numerous things. This sounds obvious, but people often miss when they write sentences in which they merely list things. Those sentences would be cleaner and shorter as a list.

Example

“You can get the film by downloading it at this url, grabbing a copy from your local store, or streaming it from this service.”

How to get the film?

  • Download here
  • Buy from your local store
  • Stream it here

All different list types are created using an environment that follows this boilerplate syntax:

1\begin{listType}
2    \item Text
3    \item Text
4\end{listType}

Unordered Lists

Unordered lists are, you guessed it, lists where order doesn’t matter. They are displayed with bullets—big round dots—in front of every list item. For this, use the itemize environment.

1
2\begin{itemize}
3    \item Uno
4    \item Duo
5    \item Tres
6\end{itemize}
Code left > output right
Code left > output right

Ordered Lists

Here, order does matter. Items are therefore displayed with a number in front, which is incremented for every item. For this, use the enumerate environment.

1
2\begin{enumerate}
3    \item Uno
4    \item Duo
5    \item Tres
6\end{enumerate}
Code left > output right
Code left > output right

Description Lists

Description lists join a description and its definition or explanation. You can supply your own text to be displayed in front of every list item, by using an optional argument \item[text]. For this, use the description environment.

1
2\begin{description}
3    \item[Bird] An animal
4    \item[Animal] An organism
5    \item[Organism] See Bird.
6\end{description}
Code left > output right
Code left > output right

Nesting Lists

You can nest these in any way you like, up to a depth of four.

You can also create your own custom lists, sometimes by using a package. (Which is what the rest of this chapter is about.)

Customs lists allow you to circumvent the nesting depth limit. But as always: don’t. Lists with more depth than four levels are a crime against humanity.

Custom Lists

Without Packages

You’ve already learned about the fact that LaTeX uses counters for nearly everything. Lists are certainly no exception—they are one of the primary reasons!

The counters used for the four levels of depth are

1enumi, enumii, enumiii, enumiv

Their corresponding numbering system is accessed with

1labelenumi, labelenumii, labelenumiii, labelenumiv
 1
 2\begin{enumerate}
 3    % Just to show you that this does nothing
 4    \setcounter{enumii}{10}
 5    \item Uno 
 6        \begin{enumerate}
 7            \setcounter{enumii}{3}
 8            \item Quatro?!
 9        \end{enumerate}
10    \item Duo
11\end{enumerate}
Code left > output right
Code left > output right

With Packages

With the enumitem package you can create your own labels for every item. For this, use the optional parameter [label=yourLabel] for the environment.

 1
 2\usepackage{enumitem}
 3
 4\begin{document}
 5    \begin{enumerate}[label=\bfseries Item \roman*:]
 6        \item 5 + 7 = 12
 7        \item 9 + 1 = 10
 8        \item 2 * 2 = 4
 9    \end{enumerate}
10\end{document}
Code left > output right
Code left > output right

Easylist

The easylist package is very powerful. It provides an easier syntax for lists. To load it, use

1\usepackage[control character]{easylist}

_What’s the control character? It’s what signals the start of a new item. It’s the replacement for \item in the default lists.

It’s common to use an ampersand as the control character, but you can choose anything you like.

Use it to indicate an item and its depth. For example, if you need a depth three item, simply type three control characters right after each other.

 1
 2\usepackage[ampersand]{easylist}
 3
 4\begin{document}
 5    \begin{easylist}
 6        & Main Item
 7            && Sub Item
 8        & Main Item
 9                &&& Sub Sub Item
10        & Main Item
11    \end{easylist}
12\end{document}
Code left > output right
Code left > output right

The easylist environment also has an optional argument that allows you to specify what kind of list it is. The options are:

NameRemark
itemize
enumerateDefault.
tractatusItems are numbered like sections—a dot between every level of depth
checklistAll items have empty checkboxes next to them
booktocApproximately the format that is used for the table of contents of the book class
articletocApproximately the format that is used for the table of contents of the article class

On top of that, you can define different styles for each level of depth.

1\ListProperties(Style1=style, Style2=style, … )
1
2\begin{easylist}[checklist]
3    \ListProperties(Style3*=\textit{!} )
4    & Main Item
5    && Sub Item
6    & Main Item
7    &&& Sub Sub Item
8    & Main Item
9\end{easylist}
Code left > output right
Code left > output right
Remark

The asterisk behind Style3 in this example means that it should replace the original list bullet type. If you don’t add it, it will add your style at the start of every list item with this depth, but also keep the original list bullet.

Inline lists

Again, the enumitem package comes to the rescue! To use starred enumerate* environments, include it with optional argument [inline]. The optional argument for labels also still applies.

 1
 2\usepackage[inline]{enumitem}
 3
 4\begin{document}
 5    \begin{enumerate*}
 6        \item Cool
 7        \item Cool
 8        \item Supercool!
 9    \end{enumerate*}
10\end{document}
Code left > output right
Code left > output right

What’s the use of inline lists? I keep saying this, but it’s semantics. Now the markup clearly states that this is a list. But you can still display it like it’s a sentence, or while saving some space, if you want.

Example

This website, like most websites, uses lists for navigation and menu buttons. This way, Google easily understands what it means. And our code looks clear and meaningful. We simply style the lists later to look like … whatever we want.

Continue with this course
Support me and this website!

Want to support me?

Buy one of my projects. You get something nice, I get something nice.

Donate through a popular platform using the link below.

Simply giving feedback or spreading the word is also worth a lot.