How can we ensure that the spacing before or after a \vbox is correct when using \addvspace?
In the following MWE, the two \addvspace{10pt} which follow each other behave like two \vspace{10pt}. The vertical space is 20 pt whereas I would like it to be only 10 pt when using \addvspace.
\documentclass{article}
\usepackage{lipsum}
\begin{document}
\newbox\testBox
\setbox\testBox\vbox{\addvspace{10pt}\lipsum[1]}
\lipsum[2]\par
\addvspace{10pt}
\unvbox\testBox
\clearpage
\setbox\testBox\vbox{\vspace{10pt}\lipsum[1]}
\lipsum[2]
\vspace{10pt}
\unvbox\testBox
\end{document}
\textfloatsepfollowed immediately afterwards by a section or similar command that also introduces a vertical space using\addvspace. However,\addvspacedoesn't work as expected (the maximum between the two vertical spaces is not taken). Searching through the LaTeX source code, I came across the\@cfltcommand. This MWE is intended to model the behavior of\@cfltin a simple way. – B Legrand Mar 06 '24 at 17:27\addvspace*{..}command which would be to\addvspace{..}what\vspace*{..}is to\vspace{..}? If so, I'll post a new question along these lines. – B Legrand Mar 06 '24 at 18:00