12

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.

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

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

  • 2
    "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 '15 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 '15 at 17:44
  • 1
    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 '16 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 '16 at 8:16
  • 1
    Another example is when describing algorithms. The initialization step is often referred to as the 0th step. – fredq Nov 22 '17 at 21:14
4

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

  • It seems better to use start = 0 as an optional argument to each local environment. – Werner Mar 23 '18 at 5:45

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.