2

After an enumerate item, latex leaves a vertical space.

After an equation, latex leaves a vertical space.

If the equation is the last line in an enumerate environment, latex adds both vertical spaces.

How can I tell latex to leave out the smaller of the two vertical spaces?

Edit: To answer the remarks, I use

\usepackage{enumitem}   
\setlist[enumerate]{%
        leftmargin=15mm, 
        rightmargin=0mm,  
        labelwidth=13mm,  
        labelsep=2mm, itemindent=0mm, itemsep=0.0mm, 
        topsep=0mm plus 2mm}

and in the file

Text...
\begin{enumerate}[resume]
   \item  More text...
   \begin{equation}
    a^2+b^2=c^2  \;\;.
   \end{equation} 
\end{enumerate}
Even more text ...

It might well be that the \topsep command has reduced the upper spacing, and that one or two similar commands need to be added at the bottom, one for the enumerate and one for the equation.

In any case, the vertical spacing above the \item is much smaller than between the bottom and the "Even more text ..."

Remark: also setting

\setlength\belowdisplayskip{0ex}
\setlength\belowdisplayshortskip{0ex}

does not change the fact that in displayed equations inside normal text, the spacing above and below is ok. But when an equation is at the end of an item, the spacings below the equation at the end of an item and above the item differ.

Here is a simple file that shows the problem:

\documentclass[onecolumn,nofootinbib,aps,prd,preprintnumbers,11pt,longbibliography,floatfix]{revtex4-2}

\usepackage{enumitem}  
\setlist[enumerate]{label={\hbox to 13mm{%
        \hbox to 0mm{\small\sf\textbf{Nr.}~\small\sf\textbf{\arabic{enumi}:}\hss}%
           \hfill}},%
        leftmargin=15mm,  
        rightmargin=0mm,  
        labelwidth=13mm,  
        labelsep=2mm, itemindent=0mm, itemsep=0.0mm, 
        topsep=0mm plus 2mm}  
        
\renewcommand{\baselinestretch}{1.1}
\normalsize

\begin{document} 

Some text. 
Some text. 
Some text. 
Some text. 
Some text. 
Some text. 
Some text. 
Some text. 
Some text. 
Some text. 
Some text. 
Some text. 
Some text. 
Some text. 
Some text. 
Some text. 
\begin{enumerate}
    \item  
    This is also text. 
    This is also text. 
    This is also text. 
    This is also text. 
    This is also text. 
    This is also text. 
    This is also text. 
    This is also text. 
    This is also text. 
\begin{equation}
a^{2}+b^{2}=c^{2}.
\end{equation}
\end{enumerate}
More text.
More text.
More text.
More text.
More text.
More text.
More text.
More text.
More text.
More text.
More text.
More text.

\end{document}

The vertical spacing above the "Nr. 1" is much smaller than below the equation.

5
  • 5
    Can you provide a compilable example which reproduces the issue?
    – cfr
    Commented Jun 15 at 18:58
  • 3
    Doing your work for you, it looks to me that the vertical space around an equation is a bit more than the vertical space around an enumerate, and when the two are nested, the larger is used, but they aren't added. Which is exactly what you're asking for.
    – Teepeemm
    Commented Jun 15 at 19:29
  • 3
    the end of list space is added by \addvspace which adds the maximum of the space requested and any existing space on the vertical list, so what you describe should not happen. Commented Jun 15 at 19:42
  • 1
    @KlausK Instead of sharing a lot of tiny code fragments, please provide a small, but compilable test file which people can copy&paste to replicate your problem. Commented Jun 16 at 19:55
  • @samcarter_is_at_topanswers.xyz Done.
    – KlausK
    Commented Jun 16 at 20:18

1 Answer 1

2

You're forgetting to set \parsep to zero.

The label can also be simplified; and ref should be set.

\documentclass[
  onecolumn,
  nofootinbib,
  aps,
  prd,
  preprintnumbers,
  11pt,
  longbibliography,
  floatfix
]{revtex4-2}

\usepackage{enumitem}  

\setlist[enumerate,1]{
  label=\small\sffamily\bfseries Nr.\ \arabic*:,
  ref=Nr.~\arabic*,
  align=left,
  leftmargin=15mm,
  rightmargin=0mm,
  labelwidth=13mm,
  labelsep=2mm,
  itemindent=0mm,
  itemsep=0.0mm,
  topsep=0mm plus 2mm,
  parsep=0pt,
}
        
\linespread{1.1}

\begin{document} 

Some text. 
Some text. 
Some text. 
Some text. 
Some text. 
Some text. 
Some text. 
Some text. 
Some text. 
Some text. 
Some text. 
Some text. 
Some text. 
Some text. 
Some text. 
Some text. 
\begin{enumerate}
    \item  
    This is also text. 
    This is also text. 
    This is also text. 
    This is also text. 
    This is also text. 
    This is also text. 
    This is also text. 
    This is also text. 
    This is also text. 
\begin{equation}
a^{2}+b^{2}=c^{2}.
\end{equation}
\end{enumerate}
More text.
More text.
More text.
More text.
More text.
More text.
More text.
More text.
More text.
More text.
More text.
More text.

\end{document}

enter image description here

Aside, the command \sf, together with almost all two-letter font changing commands (excluding \em) have been deprecated for about 30 years.

4
  • Thank you! Indeed, I am a long-time Latex user... :-) And now, how do I reduce the vspace above and below the equation? (And what does ref do?)
    – KlausK
    Commented Jun 16 at 21:53
  • 1
    @KlausK You shouldn't be using \linespread{1.1}, to begin with… Possibly \usepackage[nodisplayskipstretch]{setspace} and \setstretch{1.1}. The space you get is the standard set by the class.
    – egreg
    Commented Jun 16 at 22:11
  • Using \linespread{1.1} was your own proposal! I use \renewcommand{\baselinestretch}{1.1} ... In any case, I will try the package you mention.
    – KlausK
    Commented Jun 17 at 12:05
  • 1
    @KlausK Don't set \baselinestretch. Using \linespread is the preferred method. I also proposed setspace because you told that you find the space excessive.
    – egreg
    Commented Jun 17 at 12:44

You must log in to answer this question.

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