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:



\parsepto0ptsolved it, like you've written. Seen from my current level your answer has definitely the expertise i was looking for. And i share your feeling, that you was useful at this instant of time as you posted this answer :) I hope that my comforting words help you to get out of your depression =) ... just kidding – user1146332 Jul 21 '12 at 17:34