How to Fix List Margins with enumitem
At a glance
- 1. Identify the margin
Check whether the page margin, the list text, or the label is in the wrong position.
- 2. Set the list indent
Use enumitem's leftmargin option to position the item text within its surrounding text.
- 3. Fit the label
Use leftmargin=* to let enumitem calculate space for the widest label.
- 4. Check nested lists
Set options for the relevant list level, then compile again and inspect the result.
A margin problem with enumitem usually means that an enumerate list’s text or labels are not aligned where you expect. The key distinction is between the document’s page margins and the indentation inside a list: enumitem controls list layout, not the width of the page’s text block.
For most list-indentation problems, set leftmargin. If the label width varies, use leftmargin=* to let enumitem calculate the list margin using its label-width settings. For labels wider than the default estimate, specify widest=... as needed.
Start with a minimal example
Load enumitem and set the list option directly:
\documentclass{article}
\usepackage{enumitem}
\begin{document}
Text before the list.
\begin{enumerate}[leftmargin=2em]
\item First item.
\item Second item with enough text to wrap onto another line.
\end{enumerate}
Text after the list.
\end{document}
Here, leftmargin=2em sets the horizontal indentation for the list. Increase it to move the item text farther right; decrease it to move the item text left. The em unit scales with the current font size. You can instead use a fixed length, such as leftmargin=25mm.
Align labels and item text
A list has more than one horizontal measurement. The most useful enumitem options are:
| Option | What it controls |
|---|---|
leftmargin | The list’s left indentation and the position of its item text |
labelsep | The gap between the label and the item text |
labelwidth | The width reserved for the label |
labelindent | The horizontal indentation of the label |
itemindent | An additional indentation for the first line of an item |
When the label is wider than the space reserved for it, it may stick into the left margin or make the layout look uneven. With custom labels or multi-digit numbers, leftmargin=* is often a good first fix, but specify widest=... if the widest label is larger than the default estimate:
\begin{enumerate}[label=(\arabic*), leftmargin=*, widest=10]
\item A short item.
\item A longer item whose text wraps to a second line.
\setcounter{enumi}{9}
\item This item has a two-digit label.
\end{enumerate}
The * tells enumitem to calculate a suitable left margin using its label-width settings. The widest option lets you provide the label to use for that calculation; here, widest=10 accounts for the label (10). If you need a particular visual gap, combine it with an explicit labelsep, for example [label=(\arabic*), leftmargin=*, widest=10, labelsep=0.6em].
Apply settings to every list
If the same indentation should be used throughout the document, set it once with \setlist:
\setlist[enumerate]{leftmargin=2em}
To set a different indent for a particular nesting level, specify the level:
\setlist[enumerate,2]{leftmargin=3em}
A local option on one list overrides the general setting for that list. For example, \begin{enumerate}[leftmargin=*] can be used when most lists use a fixed indent but one has unusual labels.
If you mean the page margins
Changing leftmargin will not move the surrounding paragraphs or alter the page’s text block. For document-wide margins, use a page-layout package such as geometry:
\documentclass{article}
\usepackage[margin=1in]{geometry}
\usepackage{enumitem}
\begin{document}
Text and lists share the page's one-inch margins.
\end{document}
If the paragraph before and after a list is also too far from the paper edge, adjust the page layout rather than the list options.
Common mistakes
- Changing
labelsepto move the whole list. It changes only the gap between label and item text. Useleftmarginto adjust the list indentation. - Setting a fixed margin for labels of different widths. A fixed
labelwidthcan be too small when numbering reaches two or more digits. Tryleftmargin=*, specifyingwidest=...if needed, or choose a label width large enough for the widest label. - Confusing
leftmarginwith the page margin. The former affects a list; the latter affects the document’s text block. - Setting a global option and expecting it to affect every list type.
\setlist[enumerate]{...}applies toenumeratelists. Set options separately foritemizeor other list environments if needed. - Using a large
itemindentto fix alignment. This changes the first line of each item, not the list’s overall position. Wrapped lines may then appear misaligned.
When diagnosing a stubborn layout, reduce the document to a short example and change one option at a time. First decide whether the label, the item text, or the page text block is misplaced; then adjust the option that controls that part.
References
Spotted an error? Send a correction. Read how we write and check articles in our editorial policy.