I am trying to use the subfigure package of LaTeX to display a code listing. Here was my first attempt:
\begin{figure}
\subfigure[Standard approach]{
{\footnotesize
\begin{verbatim}
var caps = new Capabilities(Messaging);
\end{verbatim}
}
}
\subfigure[Emerson approach] {
\includegraphics[width=3in]{fig/trust-emerson}
}
\caption{Some caption}
\end{figure}
(All I did was change code where I would have put an \includegraphics line into text.)
I've also tried the equivalent idea using the listings package and replacing the lines in the subfigure with
\begin{lstlisting}
Code
\end{lstlisting}
But that also didn't compile.