0

topsep=0pt could help reduce vertical space before a enumitem list, making the vertical spacing identical to a normal document:

enter image description here

The space between reference line and 1st line of list is what I hope for. But it doesn't do exactly the same thing when used in a nested list:

enter image description here

In 2nd case, the space between label 1 and label 2 looks perfect to me but the vertical space between reference line and 1st line of list is larger than that of the 1st case. How do I fix it without changing the spacing of the external list?

full code:

\documentclass{article}
\usepackage{enumitem, lipsum, calc}

\setlength{\parindent}{0pt}

\begin{document}

{\bf 1st case:}

reference line (in document main body)
\begin{enumerate}[leftmargin=*, labelindent=0pt, label=\bfseries label \arabic*.,
    topsep=0pt, noitemsep
    ]
\item{1st line of list}
\item{2nd line of list}
\end{enumerate}

\vspace{1cm}

{\bf 2nd case:}

\begin{enumerate}[leftmargin=*, labelindent=0pt, label=\bfseries label \arabic*.,
    ]
\item{blah}
\item{reference line (in a list)
    \begin{enumerate}[leftmargin=*, labelindent=0pt, label=\bfseries (nested) label \arabic*.,
        topsep=0pt, noitemsep
        ]
    \item{1st line of list}
    \item{2nd line of list}
    \end{enumerate}
}
\end{enumerate}

\end{document}
3
  • 2
    Perhaps you need to apply topsep=0pt,noitemsep to both the outer and inner itemizations. In the 2nd example, you only apply it to the inner itemization. Jan 26, 2021 at 14:17
  • Off-topic: the \item instructions do not take arguments delimited by curly braces. Hence, please replace \item{1st line of list} with \item 1st line of list, etc.
    – Mico
    Jan 26, 2021 at 15:04
  • @StevenB.Segletes I know the solution, but I also hope to keep the itemsep for the outer list. That's why I wrote "fix it without changing the spacing of the external list".
    – Rahn
    Jan 26, 2021 at 16:21

1 Answer 1

1

Turned out the solution could be to set the topsep of the inner list to the negative topsep of the outer list:

\begin{enumerate}[leftmargin=*, labelindent=0pt, label=\bfseries label \arabic*.]
\item{
    blah
}
\item{
    \newlength{\negativeSep}
    \setlength{\negativeSep}{-\the\topsep}
    reference line (in a list)

    \begin{enumerate}[leftmargin=*, labelindent=0pt, label=\bfseries (nested) label \arabic*.,
        topsep=\negativeSep, noitemsep]
    \item{1st line}
    \item{2nd line}
    \end{enumerate}
}
\end{enumerate}

Now the spacing if the outer list doesn't change while the topsep of the inner list is 0:

enter image description here

You must log in to answer this question.

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