# create spacing command that eliminates extra spaces after

After a \section command, there is the same amount of space regardless of what follows. An itemize environment does not add extra space.

How can I achieve the same behavior after a custom environment?

\documentclass{article}

\newlength{\postinfoskip}
\setlength{\postinfoskip}{2ex}

\newenvironment{info}
{\itshape}
{\vspace{\postinfoskip}}

\begin{document}
\section{The spacing after this section \dots}
This is a line of text that begins with a normal amount of space after the section heading.

\section{\dots{} is the same as the spacing after this one}
\begin{itemize}
\item First line of text
\item Second line of text
\end{itemize}

\section{But when I use a custom environment \dots}
\begin{info}
See how much space there is after this environment before normal text.
\end{info}

This is a line of text that begins with a normal amount of space after the environment.

\section{\dots{} I can't get consistent spacing after}
\begin{info}
Compare to the amount of space before itemize.
\end{info}

\begin{itemize}
\item First line of text starts after a gap
\item Second line of text
\end{itemize}
\end{document}


In this case I'd suggest using \addvspace rather than \vspace:
\newlength{\postinfoskip}

• Thanks! I was reading the latex.ltx and article.cls source to try to figure out \addvspace but I couldn't see why it behaves this way. Could you explain? – musarithmia Sep 26 '16 at 18:24