16

As we know the enumeration usually begin at (1), then followed by (2), (3),...

My question: How to start at (0)? I know \item[(0)] will work, but how do I do this automatically? That is, make it as a default option.

3
  • 2
    With the enumitem package just say \setlist[enumerate,1]{start=0}
    – egreg
    Mar 4, 2013 at 14:36
  • @egreg Yes, it works, thank you. However, the second layer will start at () instead of (a)...
    – Popopo
    Mar 4, 2013 at 14:39
  • 1
    There is no zero'th letter, so \arabic* is the only format supporting zero
    – daleif
    Mar 4, 2013 at 14:52

3 Answers 3

18

I really don't know why one should want it. However, here's a solution with the enumitem package.

\documentclass{article}
\usepackage{enumitem}
\setlist[enumerate,1]{start=0} % only outer nesting level
\begin{document}
\begin{enumerate}
\item zero
\item one
  \begin{enumerate}
  \item a
  \item b
  \end{enumerate}
\item two
\end{enumerate}
\end{document}

enter image description here

5
  • 4
    "I thought that by now professional programmers knew how much more preferable it is to let the natural numbers start at 0." -Dijkstra, On a Somewhat Disappointing Correspondence
    – ben
    Apr 17, 2015 at 16:14
  • @ben Yes, the natural numbers start at zero, but you're numbering the first item. Before any item the number of items is zero, when the first item appears it has number one.
    – egreg
    Apr 17, 2015 at 17:44
  • 2
    One reason you might want to do this is if you are numbering a list of items that correspond to 'real' things numbered from zero. For example, I teach a course that starts in "0th week" (the week before the calendar start of term). It would be confusing if the 0th week topic was numbered 1. in the list.
    – Ubiquitous
    Jul 29, 2016 at 8:05
  • 1
    @Ubiquitous I'm not saying it's always wrong to start at 0. But Dijkstra's idea was misunderstood by the OP
    – egreg
    Jul 29, 2016 at 8:16
  • 3
    Another example is when describing algorithms. The initialization step is often referred to as the 0th step.
    – fredq
    Nov 22, 2017 at 21:14
11

You can also achieve it locally within the environment by using:

\setcounter{enumi}{-1} 

% arara: pdflatex: {synctex: yes, action: nonstopmode}
\documentclass{article}
\usepackage{enumerate} 
\usepackage[shortlabels]{enumitem} 
\begin{document}
\begin{enumerate}[\bf 1:,labelindent=10pt,leftmargin=*]
    \setcounter{enumi}{-1} 
\item zero
\item one
    \begin{enumerate}[\bf i:,labelindent=10pt,leftmargin=*] 
        \setcounter{enumii}{-1} 
        \item Nothing %testing with \roman, equivalent bold using \bf i
        \item one
        \item two
    \end{enumerate}
\item two
\end{enumerate}
\end{document}

Status:

SUCCESS

enter image description here

2
  • 2
    It seems better to use start = 0 as an optional argument to each local environment.
    – Werner
    Mar 23, 2018 at 5:45
  • Note that none of the package inclusions are needed to make this method work. This is a good thing.
    – Mars
    Mar 24, 2021 at 1:35
2

This simple trick does the job:

\begin{enumerate}
\item[0.] Zero
\item One
\item Two
\end{enumerate}

enter image description here

1
  • 1
    NB The OP is aware of this solution ("I know \item[(0)] will work") and is looking for an automatic implementation of the zero-based counting. Apr 20, 2021 at 14:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.