2

When an enumitem list is resumed there is some additional vertical space that is applied as can be seen in the difference in the vertical alignment of the 2nd item:

enter image description here

I assume this is related to topsep. So, I could adjust the topsep parameter manually each time I resume a list, but wondering if there is a way to define the MyEnumerate list so that the values of topsep (and perhaps any others things that need tweaking) are different for resumed lists vs. the initial (non-resumed) list.

Also, what is the correct mathematical computation of the topsep value required in terms of the other enumitem spacing parameters?

References:

Code:

\documentclass{article}
\usepackage{enumitem}

\newlist{MyEnumerate}{enumerate}{3}
\setlist[MyEnumerate]{label*=(\arabic*)}

\begin{document}
\begin{minipage}[t]{0.45\linewidth}
    My List of items:
    \begin{MyEnumerate}
        \item First Item.
        \item Second Item.
        \item Third Item.
        \item Fourth Item.
    \end{MyEnumerate}%
    End of list.
\end{minipage}%
\hfill%
\begin{minipage}[t]{0.45\linewidth}
    My List of items:
    \begin{MyEnumerate}[series=foo]
        \item First Item.
    \end{MyEnumerate}
    \begin{MyEnumerate}[resume*=foo]
        \item Second Item (resumed).
    \end{MyEnumerate}%
    \begin{MyEnumerate}[resume*=foo]
        \item Third Item (resumed).
    \end{MyEnumerate}%
    \begin{MyEnumerate}[resume*=foo]
        \item Fourth Item (resumed).
    \end{MyEnumerate}%
    End of resumed list.
\end{minipage}%
\end{document}
  • 1
    The gap is actually \topsep+\parskip. If you place \vspace{\dimexpr-\topsep-\parskip} as the first thing inside MyEnumerate, the two align vertically. – Werner Jun 28 '14 at 18:11
  • @Werner: Indeed, that works if I place them in every resumed list (but not the initial list). Now, can I apply that when I apply a resume? – Peter Grill Jun 28 '14 at 18:17
  • note that you get the same spacing even when you remove the resume stuff – cmhughes Jun 28 '14 at 18:18
  • @cmhughes: Yep. But a new list will be proceeded by text so that is ok. So, I guess I could set something like itemsep=\dimexpr\topsep+\parskip (not quite right), but I'd prefer to leave the new list spacing as is, just tweak the resumed list spacing to match. – Peter Grill Jun 28 '14 at 18:36
  • @PeterGrill: The instance you show may be very particular, as you're actually using a list setup in 4 separate lists while representing a single list. It may be possible to patch the resume key to also adjust the topsep key, I think. – Werner Jun 28 '14 at 19:57
2

You could use a new environment for resuming the list. This isn't as cool as defining a new Resume key or redefining resume but...

\documentclass{article}
\usepackage{enumitem}

\newlist{MyEnumerate}{enumerate}{3}
\setlist[MyEnumerate]{label*=(\arabic*)}
\newenvironment{MyResume}[1]{%
  \begin{MyEnumerate}[resume*=#1,topsep=\itemsep,partopsep=\parsep]}{%
  \end{MyEnumerate}}

\begin{document}
\begin{minipage}[t]{0.45\linewidth}
    My List of items:
    \begin{MyEnumerate}
        \item First Item.
        \item Second Item.
        \item Third Item.
        \item Fourth Item.
    \end{MyEnumerate}%
    End of list.
\end{minipage}%
\hfill%
\begin{minipage}[t]{0.45\linewidth}
    My List of items:
    \begin{MyEnumerate}[series=foo]
        \item First Item.
    \end{MyEnumerate}
    \begin{MyResume}{foo}
        \item Second Item (resumed).
    \end{MyResume}%
    \begin{MyResume}{foo}
        \item Third Item (resumed).
    \end{MyResume}%
    \begin{MyResume}{foo}
        \item Fourth Item (resumed).
    \end{MyResume}%
    End of resumed list.
\end{minipage}%
\end{document}

Resumed list

| improve this answer | |

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.