0

How to interrupt the nested lists and resume directly from the inner list?

For example:

Step 1: Define the below items

\begin{enumerate}
  \item Item Level 1
     \begin{enumerate}
          \item Item Level 2
     \end{enumerate}
\end{enumerate}

Step 2: Define the comment in the first level:

comment at level 1

Step 3: Define the second item in the second level:

     \begin{enumerate}
          \item Item Level 2
     \end{enumerate}

Step 4: Define the comment in the second level:

    comment at level 2

Step 5: Define another comment in the first level:

comment at level 1

Step 6: Define the second item in the first level:

\begin{enumerate}[resume]
  \item Item Level 1
\end{enumerate}

Resuming the first level is achieved using this solution. How to interrupt both first & second list and resuming directly from second list second item?

The Final expected output should be something like this:

1. Item Level 1
    a. Item Level 2
comment at level 1
    b. Item Level 2
    comment at level 2
comment at level 1
2. Item Level 1

Could you please suggest some ideas for this?

  • Will possible items content be several lines long? – Bernard Sep 7 '18 at 13:07
  • Possibly, yes, it contains! – Prradep Sep 7 '18 at 13:11
1

Here is a solution, with the series key, for the level 2 enumerate:

\documentclass{article}
\usepackage[showframe]{geometry}
\usepackage{enumitem}
\setlength{\parindent}{1em}

\begin{document}

\begin{enumerate}[wide=1em, leftmargin=*]
  \item Item Level 1
     \begin{enumerate}[wide=0pt, leftmargin=*, series=level2]
          \item Item Level 2
     \end{enumerate}
\end{enumerate}

Comment at level 1
 \begin{enumerate}[resume*]
 \item[]
 \begin{enumerate}[resume*=level2, wide = 0pt]
 \item Item Level 2
 \end{enumerate}
\noindent Comment at level 2
\end{enumerate}

Comment at level 1
\begin{enumerate}[resume*]
 \item Item Level 1
\end{enumerate}

\end{document} 

enter image description here

| improve this answer | |
  • Awesome, Thanks. Would it be possible to have the level1 comments aligned with the numbers like the level2 alphabets? – Prradep Sep 7 '18 at 18:07
  • 1
    es, it is: jus set \parindent to 1em (like labelindent), and make the comments for level 1 start a new paragraph. Please see the updated code. However, note that only the first line of the comment will be aligned with the level 1 label. – Bernard Sep 7 '18 at 18:48

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.