150

The enumitem package documentation says:

\topsep, \itemsep, \partopsep, \parsep?

Ok, it doesn't quite say that, but it also doesn't illustrate what these dimensions mean. Can I get a diagram with what each of these means? And what's the equivalent of \bottomsep?

9
  • 4
    you find definitions texdoc.net/texmf-dist/doc/latex/base/source2e.pdf
    – touhami
    Commented Mar 22, 2016 at 17:08
  • 4
    @m13r why do you keep deleting OPs content ?
    – percusse
    Commented Jan 19, 2017 at 7:42
  • 7
    @percusse I've never seen any jokes or 1337-speak in any of stackoverflows questions! And I don't think this is what people want to read in a serious question. This is why stackoverflow is THE platform for such questions and I want to keep it this way :-/
    – m13r
    Commented Jan 19, 2017 at 16:07
  • 18
    @m13r: You have never seen. You don't think. You want to keep it that way. It's not your site and not your question. Others have ever seen; others do think; others don't want to have it your way. The question was also upvoted by quite a few people the way it was before. Now, I removed the image as a sort of a compromise what the sentiment you were expressing, but - you're not removing my joke.
    – einpoklum
    Commented Jan 19, 2017 at 17:10
  • 27
    +1 for "Look it up, n00bz. L0L". I felt the same way when reading the enumitem docs.
    – mrzool
    Commented Sep 6, 2017 at 8:09

2 Answers 2

147

The book by Leslie Lamport, LaTeX: a document preparation system (1994) has a figure like the one you asked for on page 113, which explains, among other things, that the vertical space at the bottom of a list is always the same as the space at the top. The latter depends on the circumstances, namely, on whether the list was or was not started in vertical mode.

This is the corresponding figure in “The LaTeX Companion”

enter image description here

5
  • @egreg: Are you sure that we are not infringing any copyright by posting the figure? I avoided doing so exactly for this reason…
    – GuM
    Commented Mar 23, 2016 at 13:14
  • 6
    Just reproducing a picture from a book, acknowledging the source, shouldn't be copyright infringement. But the decision is yours.
    – egreg
    Commented Mar 23, 2016 at 13:16
  • 2
    @GustavoMezzetti -- It will likely depend on the existence (and extent) of any 'fair use' provisions in the relevant regime. However, a single page of a book for ostensibly educative purposes is likely to be OK.
    – jon
    Commented Mar 23, 2016 at 14:26
  • 2
    Is the bottom \topsep the following text's, or the list's?
    – einpoklum
    Commented Mar 23, 2016 at 15:58
  • @egreg perhaps it should be added that some of these parameters can't be influenced from outside of standard pre-defined list environements, depending on the class. One must use \list directly to fully control the situation (or possibly a package such as enumitem). Else the picture will give false hopes. As I have bitterly experienced in a distant past when I was moving from TeX to LaTeX.
    – user4686
    Commented Mar 23, 2016 at 17:27
57

Ok since you've asked the question with a picture, I'll answer with one (more or less).

Summary

  • \itemsep = vertical space added after each item in the list.
  • \parsep = vertical space added after each paragraph in the list.
  • \topsep = vertical space added above and below the list.
  • \partopsep = vertical space added above and below the list, but only if the list starts a new paragraph.

Sample document

\documentclass[]{article}
\usepackage[margin=1in]{geometry}
\parindent=0pt
\usepackage{enumitem}
\usepackage{fancyvrb}
\DefineShortVerb{\|}
\newcommand{\longline}{This is a line of text that will form a paragraph which we can use in various places.\par}
\newcommand{\printvalues}{topsep=\the\topsep; itemsep=\the\itemsep; parsep=\the\parsep; partopsep=\the\partopsep}
\begin{document}
\hrulefill
\begin{enumerate}[topsep=0pt,itemsep=0pt,parsep=0pt,partopsep=0pt]
\item\printvalues
\item With all |*sep| values set to 0pt there is no space above or below the enumeration nor between the items or paragraphs within the items.
\item\longline
\end{enumerate}
\hrulefill\par
\hrulefill
\begin{enumerate}[topsep=0pt,itemsep=20pt,parsep=0pt,partopsep=0pt]
\item\printvalues
\item When we set |\itemsep| then this much space is placed between items but no space between paragraphs within an item.
\item\longline\longline
\end{enumerate}
\hrulefill\par
\hrulefill
\begin{enumerate}[topsep=0pt,itemsep=0pt,parsep=20pt,partopsep=0pt]
\item\printvalues
\item When we set |\parsep| then this much space is placed after  every paragraph within an item.  This will effectively also separate items too, since each single paragraph item will have the |\parsep| space after it.
\item\longline\longline
\end{enumerate}
\hrulefill\par

\hrulefill
\begin{enumerate}[topsep=20pt,itemsep=0pt,parsep=0pt,partopsep=0pt]
\item\printvalues
\item When we set |\topsep| this much space is placed above and below the enumeration. 
\end{enumerate}
\hrulefill
\begin{enumerate}[topsep=0pt,itemsep=0pt,parsep=0pt,partopsep=20pt]
\item\printvalues
\item When we set |\partopsep| this much space will be placed before and after a list only if the list is preceded by a |\par| (i.e., starts a new paragraph)
\item This enumerate is not preceded by a |\par| so no space is added.
\end{enumerate}
\hrulefill\par
\hrulefill\par
\begin{enumerate}[topsep=0pt,itemsep=0pt,parsep=0pt,partopsep=20pt]
\item\printvalues
\item When we set |\partopsep| this much space will be placed before and after a list only if the list is preceded by a |\par| (i.e., starts a new paragraph)
\item This enumerate is  preceded by a |\par| so space is added.
\end{enumerate}
\hrulefill
\end{document}

output of code

You must log in to answer this question.

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