I am using listings from the listings-package. I'm having a problem with spaces below the listings. I use both, float- with h and non-float listings. The problem now is, that the spaces below the listings that are defined with float are larger than the spaces without the float definition (see MWE).
I want to reduce the space below the floated listing. I already have tested to set belowcaptionskip=-10pt, but then the space of the non floated listing is also reduced.
How do I reduce the space below the floated listing without changing the space below the non-floated listing?
\documentclass[a4paper,12pt]{scrreprt}
\usepackage{listings}
\usepackage[utf8]{inputenc}
\usepackage{caption}
\lstset{captionpos=b,
breaklines=true,
breakatwhitespace=true,
xleftmargin=20pt,
belowcaptionskip=0pt,
basicstyle=\ttfamily\small
}
\begin{document}
\begin{lstlisting}[caption={space below is smaller}]
The space below is smaller
\end{lstlisting}
Some text, that appears below the listing.
Some text, that appears below the listing.
Some text, that appears below the listing.
Some text, that appears below the listing.
Some text, that appears below the listing.
\begin{lstlisting}[float=h, caption={space below is larger}]
The space below is larger
\end{lstlisting}
Some text, that appears below the listing.
Some text, that appears below the listing.
Some text, that appears below the listing.
Some text, that appears below the listing.
Some text, that appears below the listing.
\end{document}
