# avoid empty vert space after lstlisting

After some \begin{lstlisting} ... \end{lstlisting}, LaTeX adds some additional vertical space. How can I avoid that?

• please provide a MWE, which produces the given output – Micha Jun 11 '13 at 20:40
• The answers here or here might help out. – Scott H. Jun 11 '13 at 20:43

Thanks to Scott H for the reference. It didn't directly helped me but it pointed out that the problem was my redefinition of \parskip and \baselineskip.
\begin{lstlisting}[belowskip=-0.8 \baselineskip]

• You should never redefine \baselineskip directly in latex (use \linespread or a font size command) and \parskip can only be changed with some care. – David Carlisle Jun 11 '13 at 21:17
• Actually, the space above/below any listing is given by \medskipamount. See the listings documentation (section 2.7 Layout elements, p 15, under the heading Vertical space). – Werner Jul 11 '13 at 21:21