144

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?

MDCore
  • 103
einpoklum
  • 12,311
  • 4
    you find definitions http://texdoc.net/texmf-dist/doc/latex/base/source2e.pdf – touhami Mar 22 '16 at 17:08
  • 4
    @m13r why do you keep deleting OPs content ? – percusse Jan 19 '17 at 07: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 Jan 19 '17 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 Jan 19 '17 at 17:10
  • 2
    @percusse: This is the first time someone has ever done this to me on this site; and even on Stackoverflow, which is more shall we see, aggressive, it's never happened to me. I mean, people may vote to close, or downvote, or leave negative comments, but for someone to take words out of my mouth is very offensive to me. – einpoklum Jan 19 '17 at 17:26
  • @m13r Your premise of SO being serious is correct, TeX-SX being serious is not. – percusse Jan 19 '17 at 17:46
  • 27
    +1 for "Look it up, n00bz. L0L". I felt the same way when reading the enumitem docs. – mrzool Sep 06 '17 at 08:09
  • I realise this is an old question, but... Instead of Look it up, n00bz. L0L, it would have been more constructive to explain what in the documented explanations you didn't understand. It's also unclear why you didn't just alter these parameters to visually see the result yourself, as opposed to asking others to put in the effort to make a figure for you. – RTbecard May 15 '20 at 11:08

2 Answers2

143

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

GuM
  • 21,558
  • @egreg: Are you sure that we are not infringing any copyright by posting the figure? I avoided doing so exactly for this reason… – GuM Mar 23 '16 at 13:14
  • 4
    Just reproducing a picture from a book, acknowledging the source, shouldn't be copyright infringement. But the decision is yours. – egreg Mar 23 '16 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 Mar 23 '16 at 14:26
  • 2
    Is the bottom \topsep the following text's, or the list's? – einpoklum Mar 23 '16 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. –  Mar 23 '16 at 17:27
56

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

Eric
  • 669
Alan Munn
  • 218,180