0

I'm typesetting a document for which I face certain constraints:

  • The .tex file contains unicode characters, therefore I need to use a unicode-capable engine such as XeLaTeX to compile it.
  • The paragraphs need to be delineated by vertical gaps rather than indents. I'd like to use the parskip package to implement this requirement as easily as possible.
  • The document contains many enumeration lists, and the labels for these need to follow a non-default scheme, e.g., using lower case letter labels for the outermost nesting level, as opposed to the usual standard of arabic numerals. I'd like to use the enumitem package to implement this requirement as easily as possible.

I've run into a problem. Given I'm using vertical spacing rather than indentation to visually delineate the paragraphs, I'd also like to adjust slightly how enumitem handles the vertical spacing when transitioning into and out of the enumerate environments, in order to offer the reader a subtle visual cue that a given list belongs with this paragraph and not that paragraph.

I've identified four distinct cases of vertical spacing that interest me:

  • Case 0: The standard vertical spacing ordinarily provided by the parskip package in transitioning from one paragraph to another
  • Case 1: The vertical spacing when jumping from the body of a paragraph to the first item of a list
  • Case 2: The vertical spacing when jumping from the last item of a list back to a continuation of the body text from the same paragraph
  • Case 3: The vertical spacing when jumping from the last item of a list to a brand new paragraph

Since Case 1 and Case 2 are both transitions that happen within a given paragraph, I'd like these spacings to be relatively small: about the same size as an ordinary line spacing (i.e., roughly about the size of \baselineskip) or perhaps just a bit larger. The intent is to visually cue the reader that we are still operating within the same paragraph.

In the opposite extreme, Case 0 and Case 3 are both transitions that happen between paragraphs. Therefore, I'd like these spacings to be about the same size as one another, and somewhat larger than Cases 1 and 2.

Below, I've created a minimal working example which:

  • Sizes the Case 1 and Case 2 spacings about comparably to what I might use in a real document
  • Exaggerates the Case 0 spacing in order to more easily see its effects
% Basic document setup
\documentclass[11pt]{article}
\usepackage[margin=1in]{geometry}
\geometry{letterpaper}

% Use this package because I need paragraphs delineated with vertical spacing
% instead of indents
\usepackage[skip=5ex]{parskip}

% Use this package because I want non-default settings for both the item
% labels as well as how they are spaced relative to one another
\usepackage{enumitem}
\setlist[enumerate]{label = (\alph*),
                    ref = (\alph*),
                    topsep = -4ex,
                    parsep = 0ex,
                    itemsep = 0.5ex,
                    partopsep = 20ex  % Large value to show it has no impact in this example
                   }

% Use this because my document contains unicode characters, and compiles with
% the XeLaTex engine
\usepackage{fontspec}
\setmainfont{Times New Roman}

\begin{document}

This is an ordinary paragraph.  It contains no lists.  It's sole purpose is to illustrate ordinary interparagraph spacing, as controlled by package \texttt{parskip}.  Below this is a Case 0 vertical space.

This is a paragraph that contains an enumeration list inside the body of the paragraph--the enumerate environment is bracketed by same-paragraph text both before and immediately afterward.  Below this line is a Case 1 vertical space: i.e., the space between some ordinary paragraph text and the first item of the list.
\begin{enumerate}
\item Here are some unicode characters: α, β, γ
\item Here's a second list item
\item Below this item is a Case 2 vertical space: i.e., the space between the final item in a list and the continuation of the paragraph.
\end{enumerate}
Here is a continuation of paragraph two. Below this line is another Case 0 vertical space, followed by a third paragraph.

Here is a third paragraph.  It contains an enumeration list at the \emph{end} of the paragraph.  Below this line is another Case 1 vertical space.
\begin{enumerate}
\item Here are some more unicode characters: δ and ε
\item Here's a second list item
\item Below this is a Case 3 vertical space: i.e., the space between a final list item and the start of a \emph{new} paragraph.
\end{enumerate}

This is a fourth and final paragraph.  In my example, it's squished up against the third paragraph, because the Case 3 spacing between them is too small.  How do I adjust the spacing parameters of the \texttt{parskip} and \texttt{enumitem} packages to make Case 3 look more like Case 0--but without affecting Case 1 or Case 2?

\end{document}

Here is the result of compiling on my system with XeLaTeX: parskip vs enumitem minimal working example

My question: How can I adjust the vertical spacing parameters of the parskip and enumitem packages to get Case 3 to look more like Case 0, without affecting the values I've already set for Cases 1 and 2? Or, if the two packages are fundamentally incomptible for this purpose, what's the best way to implement this type of spacing convention without messing up the vertical spacing in other parts of my document (e.g., in the Table of Contents, figure captions, etc.)?

1
  • 1
    the default enumerate code (even if using the enumitem package interface to it) detects the case of a paragraph break before a list (and then uses \partopsep but it doesn't take special action for a paragraph break following a list. Oct 4, 2019 at 21:03

2 Answers 2

3

Normally a list ends in vertical mode and so a following blank line is not seen at all, however you can force a return to horizontal mode so starting a paragraph, then following text will flow into that paragraph, but a blank line will end the implicit paragraph and cause an additional \parskip glue to be added.

enter image description here

% Basic document setup
\documentclass[11pt]{article}
\usepackage[margin=1in]{geometry}
\geometry{letterpaper}

% Use this package because I need paragraphs delineated with vertical spacing
% instead of indents
\usepackage[skip=5ex]{parskip}

% Use this package because I want non-default settings for both the item
% labels as well as how they are spaced relative to one another
\usepackage{enumitem}
\setlist[enumerate]{label = (\alph*),
                    ref = (\alph*),
                    topsep = -4ex,
                    parsep = 0ex,
                    itemsep = 0.5ex,
                    partopsep = 20ex , % Large value to show it has no impact in this example
after=\aftergroup\leavevmode\aftergroup\ignorespaces
                   }

% Use this because my document contains unicode characters, and compiles with
% the XeLaTex engine
\usepackage{fontspec}
\setmainfont{Times New Roman}

\begin{document}

This is an ordinary paragraph.  It contains no lists.  It's sole purpose is to illustrate ordinary interparagraph spacing, as controlled by package \texttt{parskip}.  Below this is a Case 0 vertical space.

This is a paragraph that contains an enumeration list inside the body of the paragraph--the enumerate environment is bracketed by same-paragraph text both before and immediately afterward.  Below this line is a Case 1 vertical space: i.e., the space between some ordinary paragraph text and the first item of the list.
\begin{enumerate}
\item Here are some unicode characters: α, β, γ
\item Here's a second list item
\item Below this item is a Case 2 vertical space: i.e., the space between the final item in a list and the continuation of the paragraph.
\end{enumerate}
Here is a continuation of paragraph two. Below this line is another Case 0 vertical space, followed by a third paragraph.

Here is a third paragraph.  It contains an enumeration list at the \emph{end} of the paragraph.  Below this line is another Case 1 vertical space.
\begin{enumerate}
\item Here are some more unicode characters: δ and ε
\item Here's a second list item
\item Below this is a Case 3 vertical space: i.e., the space between a final list item and the start of a \emph{new} paragraph.
\end{enumerate}

This is a fourth and final paragraph.  In my example, it's squished up against the third paragraph, because the Case 3 spacing between them is too small.  How do I adjust the spacing parameters of the \texttt{parskip} and \texttt{enumitem} packages to make Case 3 look more like Case 0--but without affecting Case 1 or Case 2?

\end{document}
1
  • (+1) As I've already said, I'm no TeX specialist. I'll try to understand what after=… precisely does.
    – Bernard
    Oct 4, 2019 at 22:28
2

Does this code do what you want?

\documentclass[11pt]{article}
\usepackage[margin=1in]{geometry}
\geometry{letterpaper}

% Use this package because I need paragraphs delineated with vertical spacing
% instead of indents
\usepackage[skip=5ex]{parskip}
\newlength{\oldskip}
\setlength{\oldskip}{\parskip}
% Use this package because I want non-default settings for both the item
% labels as well as how they are spaced relative to one another
\usepackage{enumitem}
\setlist[enumerate]{label = (\alph*),
 ref = (\alph*)
 }

% Use this because my document contains unicode characters, and compiles with
% the XeLaTex engine
\usepackage{fontspec}
\setmainfont{Times New Roman}
\raggedbottom
\begin{document}

This is an ordinary paragraph. It contains no lists. Its sole purpose is to illustrate ordinary interparagraph spacing, as controlled by package \texttt{parskip}. Below this is a Case 0 vertical space.

This is a paragraph that contains an enumeration list inside the body of the paragraph--the enumerate environment is bracketed by same-paragraph text both before and immediately afterward. Below this line is a Case 1 vertical space: i.e., the space between some ordinary paragraph text and the first item of the list.
\begin{enumerate}[label=(\alph*), ref=(\alph*), nosep, itemsep=0.5ex, topsep =0.5ex, before={\parskip = 0pt}, after =\vspace*{-\oldskip}]
\item Here are some unicode characters: $ α, β, γ $
\item Here's a second list item
\item Below this item is a Case 2 vertical space: i.e., the space between the final item in a list and the continuation of the paragraph.
\end{enumerate}
Here is a continuation of paragraph two. Below this line is another Case 0 vertical space, followed by a third paragraph.

Here is a third paragraph. It contains an enumeration list at the \emph{end} of the paragraph. Below this line is another Case 1 vertical space.
\begin{enumerate}[label=(\alph*), ref=(\alph*), nosep, itemsep=0.5ex, topsep =0.5ex, before={\parskip = 0pt}]%,
\item Here are some more unicode characters: $ δ $ and $ ε $
\item Here's a second list item
\item Below this is a Case 3 vertical space: i.e., the space between a final list item and the start of a \emph{new} paragraph.
\end{enumerate}

This is a fourth and final paragraph. In my example, it's squished up against the third paragraph, because the Case 3 spacing between them is too small. How do I adjust the spacing parameters of the \texttt{parskip} and \texttt{enumitem} packages to make Case 3 look more like Case 0--but without affecting Case 1 or Case 2?

\end{document} 

enter image description here

2
  • this gets the desired output but doesn't I think answer the question as you are simply adjusting the space afterwards from the top, the fact that there is a blank line denoting a new para in the second case and no blank line denoting a continuation para in the first case isn't used at all. Oct 4, 2019 at 22:14
  • but +1 for after=, that gave me an idea... Oct 4, 2019 at 22:24

You must log in to answer this question.

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