i want several code listings to be embedded in an item of a custom list environment. To achieve this i employ the lstlisting
environment of the listings
package. Unfortunately extra vertical space is appended to the lstlisting
environment inside a list
environment (see image below). Not a large skip but by all means annoying. This extra space vanishes if the same listing is placed outside the list environment. I can't figure out the reason for this extra space. Probably my current knowledge don't suffice to get rid of this space.
Maybe one of you experts can figure out the reason and can give me a hint how to remove the vertical extra space!? Maybe even a short explanation of this at least for the laymen strange behavior.
Thanks a lot for your effort...
Here is a minimal example which illustrates the problem:
\documentclass[10pt]{article}
\usepackage{listings}
\lstset{frame=lines, aboveskip=0pt, belowskip=0pt}
\begin{document}
\begin{list}{}{}
\item asd asd asd asd asd asd asd asd asd asd asd asd asd asd asd asd asd asd asd asd asd asd asd asd asd asd asd asd asd asd asd asd asd asd asd asd
\begin{lstlisting}
asdasd
\end{lstlisting}%
asd asd asd asd asd asd asd asd asd asd asd asd asd asd asd asd asd asd asd asd asd asd asd asd asd asd asd asd asd asd asd asd asd asd asd asd
\end{list}
asd asd asd asd asd asd asd asd asd asd asd asd asd asd asd asd asd asd asd asd asd asd asd asd asd asd asd asd asd asd asd asd asd asd asd asd
\begin{lstlisting}
asdasd
\end{lstlisting}%
asd asd asd asd asd asd asd asd asd asd asd asd asd asd asd asd asd asd asd asd asd asd asd asd asd asd asd asd asd asd asd asd asd asd asd asd
\end{document}
The crucial snippet of the compiled document is shown below: