3

I want to mantain numeration in sublist (second order, Actions) between sections with enumitem package. With list of first order (Objectives) I got it, but I'm having trouble with sublists.

I've tried resume but it doesn't works in maintain enumeration. Under Objective 3 must be Action 5 (no Action 1 another time) and so on.

Look at my MWE:

\documentclass[a4paper,10pt]{article}
\usepackage[]{enumitem}
\begin{document}

\section{First}

\begin{enumerate}[label=\textbf{Objective\ \theenumi\ }]
 \item Lorem
      \begin{enumerate}[label=\textbf{Action\ \arabic*}] 
       \item ipsum
       \item dolorem
      \end{enumerate}
 \item Ipsum
      \begin{enumerate}[label=\textbf{Action\ \arabic*},resume] 
       \item ipsum
       \item dolorem
      \end{enumerate}
\end{enumerate}

\section{Second}

\begin{enumerate}[label=\textbf{Objective\ \theenumi\ },resume]
 \item Lorem
      \begin{enumerate}[label=\textbf{Action\ \arabic*},resume] 
       \item ipsum
       \item dolorem
      \end{enumerate}
 \item Ipsum
      \begin{enumerate}[label=\textbf{Action\ \arabic*}] 
       \item ipsum
       \item dolorem
      \end{enumerate}
\end{enumerate}

\end{document}

What is the correct way of doing so?

Thanks in advance

4

You're close, you can declare the sublist with a series=<series name>, which you can refer to in the later sublists with resume=<series name>. I wrapped the inner sublist with a custom environment so that there is less repetition.

\documentclass[a4paper,10pt]{article}
\usepackage[]{enumitem}
\newlist{innerenumerate}{enumerate}{1}
\setlist*[innerenumerate]{label=\textbf{Action\ \arabic*}, resume=inner}
\begin{document}

\section{First}

\begin{enumerate}[label=\textbf{Objective\ \theenumi\ }]
 \item Lorem
      \begin{innerenumerate}[series=inner]
       \item ipsum
       \item dolorem
      \end{innerenumerate}
 \item Ipsum
      \begin{innerenumerate}
       \item ipsum
       \item dolorem
      \end{innerenumerate}
\end{enumerate}

\section{Second}

\begin{enumerate}[label=\textbf{Objective\ \theenumi\ },resume]
 \item Lorem
      \begin{innerenumerate}
       \item ipsum
       \item dolorem
      \end{innerenumerate}
 \item Ipsum
      \begin{innerenumerate}
       \item ipsum
       \item dolorem
      \end{innerenumerate}
\end{enumerate}

\end{document}

enter image description here

  • It works very well. Thanks for your help. I must practice a little more with enumitem because it's a powerful package and I use lists very often. – jqueralt Sep 11 '18 at 6:46
  • 1
    I would suggest to define a new list environment for the outer "objective" list as well. Having to type and read \begin{enumerate}[label=\textbf{Objective\ \theenumi\ },resume] is tedious. I'd also rename innerenumerate to actionenum or similar to make the macros more semantic. – moewe Sep 11 '18 at 8:05

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.