Your support for our advertisers helps cover the cost of hosting, research, and maintenance of this document

Formatting Information — An introduction to typesetting with LATEX

Chapter 4: Lists, tables, figures

Section 4.1: Lists

Lists are useful tools for arranging thoughts in a digestible format, usually a small piece of information at a time. There are four basic types of list, shown in Table 4.1 below.

Table 4.1: Types of list

Random or itemized lists
(sometimes called ‘arbitrary’ or ‘bulleted’ lists) where the order of items is unimportant. The items are often prefixed with a bullet or other symbol for clarity or decoration, but are sometimes simply left blank, looking like miniature paragraphs (when they are known as ‘simple’ or ‘trivial’ lists).
Enumerated or ordered lists
(sometimes called ‘sequential’ or ‘numbered’ lists) where the order of items is critical, such as sequences of instructions or rankings of importance. The enumeration can be numeric (Arabic or Roman), or lettered (uppercase or lowercase), and can be programmed to be hierarchical (1.a.viii, 2.3.6, etc).
Descriptive or labelled lists
(sometimes called ‘discussion’ lists), which are composed of subheadings or topic labels (usually unnumbered but typographically distinct), each followed by one or more indented paragraphs of discussion or explanation.
Inline lists
which are sequential in nature, just like enumerated lists, but are a ) formatted within their paragraph; b ) usually labelled with letters like this example; and c ) often mutually inclusive or exclusive, with the final item prefixed by ‘and’ or ‘or’ respectively.

There are actually two other types of list in existence, segmented lists and reference lists, but these are much rarer, and outside the scope of this document.

The structure of lists in LATEX is identical for each type, but with a different environment name. Lists are another example of this LATEX technique (environments), where a pair of matched commands surrounds some text which needs special treatment.

Within a list environment, list items are always identified by the command \item (followed by an item label in [square brackets] in the case of labelled lists). You don’t type the bullet or the number or the formatting, it’s all automated.

4.1.1 Itemized lists

To create an itemized list, use the itemize environment:

\begin{itemize}
\item Itemized lists usually have a bullet;
\item Long items use ‘hanging indentation’, whereby
  the text is wrapped with a margin which brings it 
  clear of the bullet used in the first line of 
  each item;
\item The bullet can be changed for any other 
  symbol, for example from the \textsf{bbding} or 
  \textsf{pifont} package.
\end{itemize}
  • Itemized lists usually have a bullet;

  • Long items use ‘hanging indentation’, whereby the text is wrapped with a margin which brings it clear of the bullet used in the first line of each item;

  • The bullet can be changed for any other symbol, for example from the bbding or pifont package.

The default list bullet is the normal round, solid one (•), which is also available with the command \textbullet if you load the textcomp package. See § 7.6.2 below for details of how to change the settings for list item bullets.

Nested itemized lists (see § 4.1.6 below) used differing symbols for their bullets as well as more indentation and less spacing.

4.1.2 Enumerated lists

To create an enumerated list, use the enumerate environment:

\begin{enumerate}
\item Enumerated lists use numbering on each item
  (can also be letters or roman numerals);
\item Long items use ‘hanging indentation’ in just
  the same way that itemized lists do;
\item The numbering system can be changed for any
  level.
\end{enumerate}
  1. Enumerated lists use numbering on each item (can also be letters or roman numerals);

  2. Long items use ‘hanging indentation’, in just the same way that itemized lists do;

  3. The numbering system can be changed for any level.

See § 4.1.6 below for details of how to change the numbering schemes for each level.

In standard LATEX document classes, the vertical spacing between items, and above and below the lists as a whole, is more than between paragraphs. If you want tightly-packed lists, use the enumitem package, which provides an environment option noitemsep for the three main list environments (there is also a nosep option for even more compact spacing). Both these options come after the environment name, not before; eg \begin{itemize}[nosep]

4.1.3 Description lists

To create a description list, use the description environment:

\begin{description}
\item[Identification:] description lists require
  a topic for each item given in square brackets;
\item[Hanging indentation:] Long items use this
  in the same way as all other lists;
\item[Reformatting:] Long topic labels can be
  reprogrammed to fold onto multiple lines.
\end{description}
Identification:

description lists require a topic for each item given in square brackets;

Hanging indentation:

Long items use this in the same way as all other lists;

Reformatting:

Long topic labels can be reprogrammed to fold onto multiple lines.

I very strongly recommend using the enumitem package with its unboxed environment option for description lists, which avoids the spacing problems with LATEX’s default handling of long labels. This package has so many good features I tend to load it for virtually every document I create.

All three of these types of lists can have multiple paragraphs per item: just type the additional paragraphs in the normal way, with a blank line between each. So long as they are still contained within the enclosing environment, they will automatically be indented to follow underneath their head item.

4.1.4 Inline lists

Inline lists are a special case, as they require the use of the enumitem or paralist packages.

The enumitem package with the inline option provides ‘starred’ versions of the three standard list types to do this: enumerate*, itemize*, and description*. It uses a specification in the optional argument for formatting the labels (for example, italic letters and an upright parenthesis), and it also provides extensive support for the punctuation and conjunction between items, making it unnecessary to type it separately for each item (and differently for the last-but-one).

\usepackage[inline]{enumitem}
...
\textbf{\itshape Inline lists}, which are sequential
in nature, just like enumerated lists, but are
\begin{enumerate*}[label=\textit{\alph*}), 
       itemjoin={{; }},itemjoin*={{; and }}]
\item formatted within their paragraph
\item usually labelled with letters
\item usually have the final item prefixed with
  ‘and’ or ‘or’
\end{enumerate*}, like this.

Inline lists, which are sequential in nature, just like enumerated lists, but are a ) formatted within their paragraph; b ) usually labelled with letters; and c ) usually have the final item prefixed with ‘and’ or ‘or’, like this.

See Chapter 6 ‘Layouts and fonts’ below for details of the font-changing commands used in the optional arguments to the enumerate* shown in this example.

Exercise 4.1 — List practice

  1. Add a list or two to your document.

  2. Copy and paste any two of the ones described here to practice with.

  3. Read the documentation for the enumitem package or the paralist package and use it to change the layout of the lists you have added.

4.1.5 Reference lists and segmented lists

Reference lists are visually indistinguishable from numbered or lettered lists, but the numbering or lettering does not imply a sequence. The numbers or letters are just used as labels so that the items can be referred to from elsewhere in the text (as in ‘see item 501(c)3’). In this sense they are really a kind of sub-sectional division, and LATEX’s \paragraph or \subparagraph commands (with appropriate renumbering) would probably be a far better solution than using a list. Label them and refer to them with \label and \ref as for any other cross-reference (see § 5.3 below).

Segmented lists are a highly specialised structure and outside the scope of this document. For details of their usage, see the ‘Segmentation and Alignment’ (Burnard, Sperberg-McQueenBurnard & Sperberg-McQueen, 1995).

4.1.6 Lists within lists

You can start a new list environment within the item of an existing list, so you can embed one list inside another up to four deep. The lists can be of any type, so you can have a description list containing an item in which there is a numbered sub-list, within which there is an item containing a bulleted sub-sub-list.

  1. by default an outer enumerated list uses Arabic numerals;

    1. an embedded enumerated list is lettered in lowercase;

      1. a third level is numbered in lowercase Roman numerals;

        1. the fourth level uses uppercase alphabetic letters.

Multiple embedded lists automatically change the bullet or numbering scheme so that the levels don’t get confused, and the spacing between levels is adjusted to become slightly tighter for more deeply nested levels.

  • by default the outer itemized list item has a bullet;

    • an embedded itemized list uses a dash;

      • a third level uses an asterisk;

        • the fourth level uses a small bullet.

These are only defaults and can easily be changed by redefining the relevant set of values. You could also add a fifth and further levels, although I suspect that would mean your document structure needed some careful analysis, as lists embedded five deep will probably confuse your readers.

The values for lists come in pairs: for each level there is a counter to count the items and a command to produce the label:

Table 4.2: Default numbering for nested numbered lists

LevelDefaultCounterLabel command
1digit.enumi\theenumi
2(letter)enumii\theenumii
3roman.enumiii\theenumiii
4LETTER.enumiv\theenumiv

Note that each counter and command ends with the Roman numeral value of its level (this is to overcome the rule that LATEX commands can only be made of letters — digits wouldn’t work here). To change the format of a numbered list item counter, just renew the meaning of its label:

\renewcommand{\theenumi}{\Alph{enumi}}
\renewcommand{\theenumii}{\roman{enumii}}
\renewcommand{\theenumiii}{\arabic{enumiii}}

This would make the outermost list use uppercase letters, the second level use lowercase roman, and the third level use ordinary Arabic numerals. The fourth level would remain unaffected.

Exercise 4.2 — Nesting

Extend your use of lists by nesting one type inside a different one.

Lists and Tables: a caution to the unwary

Treat lists with care: people sometimes use tables for labelled information which is really a list and would be better handled as such. They often do this because their wordprocessor has no way to do what they want (usually to place the item label level with the description or explanation) except by using a table, hence they are misled into believing that their text is really a table when it’s actually not.

  1. In fact, any time you define a counter in LATEX, you automatically get a command to reproduce its value. So if you defined a new counter example to use in a teaching book, by saying \newcounter{example}, that automatically makes available the command \theexample for use when you want to display the current value of example