4

Here is my latex code:

\begin{enumerate}
\item  
\begin{enumerate}
\item  I do not feel sad. 
\item  I feel sad 
\item I am sad all the time and I can't snap out of it. 
\item I am so sad and unhappy that I can't stand it.
\end{enumerate}
\end{enumerate}

and here is the output

enter image description here

and here is what I want

enter image description here

As you see from the second picture, the number starts with 0 and it starts from the second row. How can I obtain this?

3

You can do it like this:

\documentclass{article}


\begin{document}
   \begin{enumerate}
\item  

\begin{enumerate}\setcounter{enumii}{-1}\renewcommand\theenumii{\arabic{enumii}}
\item  I do not feel sad. 
\item  I feel sad 
\item I am sad all the time and I can't snap out of it. 
\item I am so sad and unhappy that I can't stand it.
\end{enumerate}
\end{enumerate}
\end{document}

You also can define as \settozero the above command like:

\def\settozero{\setcounter{enumii}{-1}\renewcommand\theenumii{\arabic{enumii}}}

and then you can use it just when the inner enumeration starts:

\documentclass{article}

\def\settozero{\setcounter{enumii}{-1}\renewcommand\theenumii{\arabic{enumii}}}

\begin{document}
\begin{enumerate}
\item  

\begin{enumerate}\settozero
\item  I do not feel sad. 
\item  I feel sad 
\item I am sad all the time and I can't snap out of it. 
\item I am so sad and unhappy that I can't stand it.
\end{enumerate}
\end{enumerate}
\end{document}

And somehow more automated:

\documentclass{article}

\def\settozero{\setcounter{enumii}{-1}\renewcommand\theenumii{\arabic{enumii}}}


\newenvironment{myenumerate}{\begin{enumerate}\ifx\c@enumii\undefined\relax\else\settozero\fi}{\end{enumerate}}
\begin{document}
\begin{enumerate}
\item  

\begin{myenumerate}
\item  I do not feel sad. 
\item  I feel sad 
\item I am sad all the time and I can't snap out of it. 
\item I am so sad and unhappy that I can't stand it.
\end{myenumerate}

\item
\begin{myenumerate}
   \item Test 0
   \item Test 1
\end{myenumerate}

\end{enumerate}
\end{document}

Output:

enter image description here

  • They perfectly works on a new document, but I copied the code above and pasted to my document and it does not work the same way. The first raw has no number and others have a, b and c. Any idea why? – Günal Oct 19 '17 at 14:10
  • Try the last one and if it doesn't works just give me more information about your document. You may be redefine nested enumerations and have only "enumi" and "\c@enumi" without "enumii" ot "c@enumii"... – koleygr Oct 19 '17 at 14:11
  • I see... I found what is your problem.... You use enumitem package... @StevenB.Segletes soplution is fine for your case. If you want you can just extend my automation if possible – koleygr Oct 19 '17 at 14:23
  • Did you removed enumitem package? – koleygr Oct 19 '17 at 14:25
  • 1
    Ok... If you/or someone else need enumitem the solution from @StevenB is the option for your/his case. – koleygr Oct 19 '17 at 14:56
5
\documentclass{article}
\usepackage{enumitem}
\begin{document}
\begin{enumerate}
\item  
\begin{enumerate}[label=\arabic*,itemindent=.5in,labelsep=.5in,start=0]
\item[]
\item  I do not feel sad. 
\item  I feel sad 
\item I am sad all the time and I can't snap out of it. 
\item I am so sad and unhappy that I can't stand it.
\end{enumerate}
\end{enumerate}
\end{document}

enter image description here

  • enumitem provides the start option, so start=0 is simpler. – Andrew Swann Oct 19 '17 at 14:26
  • @AndrewSwann Thanks! I will take that advice. – Steven B. Segletes Oct 19 '17 at 14:28

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.