Sometimes, I want to have enumerate lists in LaTeX start at other than the first value (1, a, i, etc.) How can I make an enumerate list start at an arbitrary value?
5 Answers
You can change the counter named enumi, like this:
\begin{enumerate} \setcounter{enumi}{4} \item fifth element \end{enumerate} (If you have lists at deeper levels of nesting, the relevant counters are enumii, enumiii and enumiv.)
It even works with negative numbers: if you want to begin your list with 0, you need to set the counter to -1
- 2How do you start at (a) from the very beginning and not (1)?John Molokach– John Molokach2015-07-08 15:23:55 +00:00Commented Jul 8, 2015 at 15:23
- 1@JohnMolokach See tex.stackexchange.com/questions/2291/… (look at top two answers at least).ShreevatsaR– ShreevatsaR2015-07-08 15:38:22 +00:00Commented Jul 8, 2015 at 15:38
- 15@JohnMolokach That will indent it an extra level, and make it look ugly. Better to do it right, e.g. simply
\usepackage{enumerate}at the top and use\begin{enumerate}[(a)]etc. Anyway, it's up to you. This question was about starting at something other than the first index, e.g. starting at(e)instead of(a), but I can see how the title is ambiguous.ShreevatsaR– ShreevatsaR2015-07-08 19:25:27 +00:00Commented Jul 8, 2015 at 19:25 - 6Be advised, that
\setcounter{enumi}{N}will set the next item's value to N+1. So if you happen to end another enumeration with N being the last item and to start another enumeration with N+1, you want to set the counter to N-1 instead.stephanmg– stephanmg2020-04-28 09:32:05 +00:00Commented Apr 28, 2020 at 9:32 - 4@stephanmg That means that if you end an enumeration with N being the last item, you want to set the counter back to N again (not N-1) in the next enumeration if you want to start with N+1.JoeyBF– JoeyBF2023-04-25 23:42:39 +00:00Commented Apr 25, 2023 at 23:42
The enumitem package provides a simple solution to very many common problems that are related to minor tweaks of enumerate/itemize/description. In this case, you can use the start parameter. Also have a look at the resume parameter.
- 16I would just like to make explicit that the "resume" parameter causes the counter to continue from the previous "enumerate" environment.Austin Mohr– Austin Mohr2014-01-09 05:37:36 +00:00Commented Jan 9, 2014 at 5:37
- 3To be more explicit "resume"parameter causes the counter to continue from the previous "enumerate" environment in the current block. For example \begin{enumerate} \item 1 \end{enumerate} \begin{defn} \begin{enumerate} \item 1 \item 2 \end{enumerate} \end{defn} \begin{enumerate} \item This will be 2 \end{enumerate}Dr. Dinesh J. Karia– Dr. Dinesh J. Karia2016-11-16 07:16:10 +00:00Commented Nov 16, 2016 at 7:16
- 5For people looking for a MWE using
resumeyou can find one herecodeaviator– codeaviator2017-10-03 12:14:21 +00:00Commented Oct 3, 2017 at 12:14 - 1FYI:
enumitemwith\begin{enumerate}[resume]is nice but not compatible with theparalistpackage'scompactenumenvironment.orbeckst– orbeckst2019-09-06 17:27:18 +00:00Commented Sep 6, 2019 at 17:27 - On the other hand
enumitemhasnosepandnoitemsep, so you can write\begin{enumerate}[resume,noitemsep]instead.Jakub Narębski– Jakub Narębski2024-05-28 16:45:44 +00:00Commented May 28, 2024 at 16:45
If you only want to alter the starting value, the easiest way is:
\documentclass{article} \begin{document} \begin{enumerate}\addtocounter{enumi}{41} \item This item is numbered `42.' \begin{enumerate}\addtocounter{enumii}{5}% This cannot be more than 25 \item This one is ``numbered'' `(f)' \end{enumerate} \end{enumerate} \end{document} While you can have six layers of nested list environments (itemize, description, enumerate), you can have no more than 4 of one type. The counters enumi through enumiv control the index of each item's label. You can increment (as shown) or decrement (add a negative value) all 4 levels.
Note, though, that this won't be entirely arbitrary. Levels enumerated alphabetically cannot have items after an item labeled 'z.' (You could, however, add a negative amount to the appropriate counter to get it back to the `a' label.)
(Now that I see the other answer, I wonder why I always opt for the relative \addtocounter rather than the absolute \settocounter?)
- 2
\addtocounteris safer in that it ensures monotonicity when used mid-list.equaeghe– equaeghe2014-03-19 10:22:36 +00:00Commented Mar 19, 2014 at 10:22 - 1
\addtocounter works with 0 too:
\documentclass{article} \begin{document} \begin{enumerate}\addtocounter{enumi}{-1} \item % starts with `0.` \item % starts with `1.` .. \end{enumerate} \end{document} - 1What if we want to change the counter if an inner enumerate?snoram– snoram2022-01-27 18:54:36 +00:00Commented Jan 27, 2022 at 18:54
Just to complete the answer of Jukka with a copy/pastable example:
\documentclass{article} \usepackage{enumitem} \begin{document} \begin{enumerate} \item Hello \item I am \end{enumerate} \begin{enumerate}[resume] \item a list \item that continues \end{enumerate} \begin{enumerate}[start=42] \item and go \item beyond your hopes \end{enumerate} \end{document} Note however that this solution is not compatible with beamer, while \setcounter{enumi}{3} does work.
- What if I want to use brackets () around the numbering? [start=(42)] seems to ignore the "()" around 42.Cloud Walker– Cloud Walker2024-07-22 05:52:46 +00:00Commented Jul 22, 2024 at 5:52
- 1@CloudWalker you may want to check tex.stackexchange.com/questions/42905/…tobiasBora– tobiasBora2024-07-23 06:36:03 +00:00Commented Jul 23, 2024 at 6:36
