Tell me more ×  Knowing about \addvspace I wrote my own
environment that adds a minimum space before and after it. But
using memoir, if a \section precedes it, \addvspace always adds
all its space to the space that usually follows a section. MWE:
\section{Sec 1}   \section{Sec 2}   \section{Sec 3}
\section{Sec 4}   You can see that the second section has way
too much vspace after it. I had a look at the memoir
\@startsection code and found that it does (rightly) use \vskip
and \addvspace. After reading this question I suspect it is
maybe a \noindent problem since \@afterindent is used. But there
must be a trick somewhere that I am missing because Sec 3 and
Sec 4 have the proper space. Any ideas of how to fix this?
share|improve this question The problem is that the last skip
called by \section is \vskip-\parskip which is 0pt plus -1pt and
so when \addvspace tests whether the last skip is zero (in which
case it always adds its space), the test will be true because
the first component of the skip is 0pt (