I am comparing source in a paper and I would like to put them in a table, so the differences are easily spotted. I used the following LaTeX code:
\begin{tabular}{ | l | l | l |}
Option 1 & Option 2 & Option 3 \\
\begin{lstlisting}
Code A
\end{lstlisting} &
\begin{lstlisting}
Code B
\end{lstlisting} &
\begin{lstlisting}
Code C
\end{lstlisting} \\
\end{tabular}
When compiled, this becomes a mess, so that is why I would like to know what I can do to improve the outcome.


\documentclass, ending with\end{document}) that demonstrates the issue? – Torbjørn T. Nov 10 '13 at 17:59\lstinline. Also, instead of a tabular, have you consideredmulticol? – Sean Allred Nov 10 '13 at 18:53diffand Is there a ready solution to typeset a diff file? or Highlighting a .diff file – Mike Renfro Nov 10 '13 at 19:46