Tx · LaTeX & TikZ

How to Fix Problems with enumerate and compactenum

Published By the 9to5Science editorial team

At a glance

  1. 1. Identify the environment

    enumerate is built into LaTeX; compactenum is provided by the paralist package.

  2. 2. Choose one list system

    Use enumitem for customizable spacing and labels, or paralist for its compactenum environment.

  3. 3. Use the right label syntax

    enumitem uses keys such as label=(\alph*); compactenum uses a label pattern such as [(a)].

  4. 4. Check list structure

    Make sure each list has an \item and matching begin and end commands.

The usual problem is a mismatch between two list packages or their syntax. LaTeX provides enumerate by default, while compactenum comes from the paralist package. The environments can both make numbered lists, but they are not interchangeable: their optional arguments and spacing controls differ.

If you want compact spacing and alphabetic labels, the simplest approach is usually to use enumitem with the standard enumerate environment. If your document already uses compactenum, load paralist and use its label-pattern syntax instead.

Option 1: Use enumitem

Load enumitem, then set the label and spacing as options to enumerate:

\documentclass{article}
\usepackage{enumitem}

\begin{document}

\begin{enumerate}[label=(\alph*), nosep]
  \item First item
  \item Second item
  \item Third item
\end{enumerate}

\end{document}

This produces labels (a), (b), and (c). The label=(\alph*) option sets the label format; \alph* is replaced by the current lowercase alphabetic counter. Use \Alph* for uppercase letters, \arabic* for ordinary numbers, \roman* for lowercase Roman numerals, or \Roman* for uppercase Roman numerals. The nosep option removes the list’s extra vertical spacing.

You can adjust the spacing more selectively with enumitem keys. For example, itemsep=0pt removes the gap between items, while topsep=0pt removes the extra space above and below the list. These keys belong to enumitem; they are not the label syntax used by paralist.

Option 2: Use paralist’s compactenum

If you specifically want the compactenum environment, load paralist and pass it a label pattern:

\documentclass{article}
\usepackage{paralist}

\begin{document}

\begin{compactenum}[(a)]
  \item First item
  \item Second item
  \item Third item
\end{compactenum}

\end{document}

Here [(a)] tells paralist to format the labels with lowercase letters in parentheses. The environment itself supplies compact list spacing. Don’t assume that compactenum accepts enumitem keys such as label=(\alph*) or nosep: those belong to a different interface.

Why the two forms get confused

The standard enumerate environment accepts no label-format option on its own. Packages extend it in different ways. For instance, enumitem uses key-value options, while older list extensions may use a pattern such as [(a)]. So this is the enumitem form:

\begin{enumerate}[label=(\alph*), nosep]

And this is the paralist form:

\begin{compactenum}[(a)]

Putting the first form on compactenum, or the second on enumerate without a package that supports that pattern, can produce errors or unexpected labels. If you want to keep the compact spacing but also need detailed control over labels, spacing, or indentation, using enumitem alone is often clearer.

Common mistakes to check

  • The package is missing. compactenum is not built into LaTeX; it requires \usepackage{paralist}. The label=... and nosep options require \usepackage{enumitem}.
  • The option syntax belongs to another package. Use [(a)] with compactenum; use keys such as [label=(\alph*), nosep] with enumitem’s enumerate.
  • A list item is missing. Every list entry must start with \item. A missing \item can trigger errors that seem to point at the list environment itself.
  • The list is not closed correctly. Match \begin{enumerate} with \end{enumerate} and \begin{compactenum} with \end{compactenum}.
  • Both packages are loaded without a need. enumitem and paralist offer overlapping list features. Their interfaces are distinct, so choose one for the list you are customizing rather than mixing their options.

If you are diagnosing a larger document, first try the minimal example for your chosen package. If it compiles, add the surrounding code back a little at a time; another list or a missing \item may be the actual source of the error.

References

  1. enumitem package documentation
  2. paralist package documentation

Spotted an error? Send a correction. Read how we write and check articles in our editorial policy.