5

This question is heavily inspired by How to remove the whitespace BEFORE itemize/enumerate? (thus the name).

From what I understand topsep affects both white space before and after the enumerate/itemize. And I couldn't find anything in the documentation

I would like to have differing amounts of white space before and after my enumerates/itemize, and preferably do so with a global setting.

Something like \setlist[itemize]{topsep=0pt} would be ideal (if it worked).

2
  • 3
    As always on this site: you problably get more help if you provide a minimal example. For example, you'd probably need to mention that you are using enumitem which is not clear until one take a closer look at our links
    – daleif
    Dec 19, 2016 at 12:43
  • You can create a custom itemize environment which sets \topsep=0pt and adds its own \vspace before and after. IIRC, that is how amsmath does equations. Dec 19, 2016 at 14:22

2 Answers 2

6

LaTeX's lists are expressly designed to have the same amount of vertical spacing before and after. That is coded deep in LaTeX's bowels in the \@trivlist macro. So changing that would require that macro to be adapted, which enumitem doesn't. I think it would have been sensible to both have \topsep and \botsep but apparently Leslie lamport didn't think so.

However, with the enumitem package you can insert text before and after the itemize, and if you set topsep=0pt and insert your own \vspace before and after you get basically what you want. And then with \setlist you can make these settings global if you want, or just apply them individually, or define your own list type.

\documentclass{article}
\usepackage{enumitem}
\begin{document}
\noindent
Text before the itemize.
\begin{itemize}[topsep=0pt,itemsep=0pt,parsep=0pt,before=\vspace{1cm},after=\vspace{1mm}]
\item An item
\end{itemize}
Text after itemize.
\end{document}

enter image description here

2

You can change the relevant length (\@topsepadd) in the after key:

\documentclass{article}
\usepackage{enumitem}
\begin{document}
\noindent
Text before the itemize.
\begin{itemize}[topsep=0cm,after={\advance\csname @topsepadd\endcsname by1cm}]
\item An item
\end{itemize}
Text after itemize.
\end{document}

enter image description here

You must log in to answer this question.

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