3

I want to start my enumitem counter at 2 instead of 1, but I do not know how. Could you please tell me how to do this?

Here is a minimum example:

\documentclass[a4paper, 11pt]{article}
\usepackage[a4paper,left=3cm,right=3cm,top=3cm,bottom=3cm]{geometry}

\usepackage{enumitem}

\newcounter{mycount} \renewcommand{\themycount}{\arabic{mycount}}
\AtBeginEnvironment{enumerate}{\stepcounter{mycount}}
\setlist[enumerate]{label=\themycount.\arabic*,ref=\themycount.\arabic*)}


\begin{document}
    
    \begin{enumerate}
        \item Should be 2.1.
    \end{enumerate}

    \begin{enumerate}
        \item Should be 3.1.
    \end{enumerate}

\end{document}

1 Answer 1

5

Maybe I've misunderstood what you want, but you just need to set your mycount counter to 1 in your preamble. And you don't need to use \AtBeginEnvironment since enumitem has a before key for injecting this sort of code. enumitem also has a start key which can be used to start any list at any number without manually incrementing the counter, but in your case that doesn't seem to be what you need.

\documentclass[a4paper, 11pt]{article}
\usepackage[a4paper,left=3cm,right=3cm,top=3cm,bottom=3cm]{geometry}

\usepackage{enumitem}

\newcounter{mycount} \renewcommand{\themycount}{\arabic{mycount}}
\setlist[enumerate]{label=\themycount.\arabic*,
   ref=\themycount.\arabic*),
   before=\refstepcounter{mycount}}
\setcounter{mycount}{1}

\begin{document}
    
    \begin{enumerate}
        \item Should be 2.1.
    \end{enumerate}

    \begin{enumerate}
        \item Should be 3.1.
    \end{enumerate}

\end{document}

output of code

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .