I have two lstlisting
areas that are shown side by side by using two minipages:
\noindent\begin{minipage}[t]{.43\textwidth}
\begin{lstlisting}[...]{part1}
// Code
\end{lstlisting}
\end{minipage}\hfill
\begin{minipage}[t]{.54\textwidth}
\begin{lstlisting}[...]{part2}
// Code
\end{lstlisting}
\end{minipage}
At the moment, both listings have their own caption (not shown above for the sake of simplicity). What I want to do is to display one single caption instead of two captions. The single caption should be centered below both listings. Is it possible to treat the two listings as one single listing? Thanks.
Best Answer
You could use the
\captionof
command from the packagecaption
: