I have a macro that do side-by-side figures, below. It uses subfloats, and so it goes in a figure.
\newcommand{\listbylist}[6][showlines=true]{
\begin{figure}
\subfloat[ ]{
\lstinputlisting[showlines=true,#1]{#2}
\label{#4:A}
}
\hfill{}
\subfloat[ ]{
% by setting the frame to leftline, we avoid a box into oblivion
% turn off numbers
\lstinputlisting[showlines=true,frame=leftline,#1,numbers=none]{#3}
\label{#4:B}
}
\hfill{}
\caption[#5]{#6}
\label{#4}
\end{figure}
}
Unfortunately, this uses the Figure counters, not the Listings ones. It also shows up in the wrong table of contents, and uses the word "Figure" instead of "Listings" in the caption, references to it, etc. Is there a way to rectify this?
I would prefer a simple way, like adding the word "Listing" somewhere...