How do I place a two column appendix in a single column report? I want it so that at the beginning of the appendix I'm in single column mode, then I want to place some source code listings in 2 column format within my appendix.

3 Answers
3

For multi-column typesetting of listings the listings package provides the multicols=n option, which in fact is a built-in interface to the multicol package.

\documentclass{report}
\usepackage{listings,multicol}
\usepackage{lipsum}
\begin{document}
\chapter{foo}
\lipsum[1]
\begin{lstlisting}[numbers=left,xleftmargin=3em, multicols=2]
First line.
Second line.
Third line.
Next line.
Next Line
Next line.
Next Line
Next line.
Next Line
Next line.
Next Line
\end{lstlisting}
\lipsum[2]
\end{document}

Note that you have to load multicol explicitly with \usepackage{multicol} in the preamble.

You can use the package multicol or you can switch your document via \twocolumn in the new mode:

\documentclass{report}
\usepackage{listings}
\usepackage{multicol}
\usepackage{lipsum}
\begin{document}
\chapter{foo}
\lipsum[1]
\begin{multicols}{2}
\begin{lstlisting}[numbers=left,xleftmargin=3em]
First line.
Second line.
Third line.
Next line.
Next Line
Next line.
Next Line
Next line.
Next Line
Next line.
Next Line
\end{lstlisting}
\end{multicols}
\lipsum[2]
\clearpage
\twocolumn
\lipsum[1]
\lipsum[2]
\begin{lstlisting}[numbers=left,xleftmargin=3em]
First line.
Second line.
Third line.
Next line.
Next Line
Next line.
Next Line
Next line.
Next Line
Next line.
Next Line
\end{lstlisting}
\lipsum[2]
\end{document}