73

The enumitem package documentation says:

\topsep, \itemsep, \partopsep, \parsep? Look it up, n00bz. L0L

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?

  • 2
    you find definitions texdoc.net/texmf-dist/doc/latex/base/source2e.pdf – touhami Mar 22 '16 at 17:08
  • 2
    @m13r why do you keep deleting OPs content ? – percusse Jan 19 '17 at 7:42
  • 5
    @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
  • 11
    @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
  • 11
    +1 for "Look it up, n00bz. L0L". I felt the same way when reading the enumitem docs. – zool Sep 6 '17 at 8:09
70

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

  • @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
  • 1
    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
  • @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
  • 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. – user4686 Mar 23 '16 at 17:27
28

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

Summmary

  • \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

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.