I was wondering if anyone knew of a way to add colors to two successive verbatim text blocks without adding an extra blank line in between. For instance, the spacing I desire is the output of:
Code: Select all
\begin{verbatim}
line 1
line 2
\end{verbatim}
\begin{verbatim}
line 3
line 4
\end{verbatim}
1. (using \usepackage[usenames]{color})
Code: Select all
{\color{red}\begin{verbatim}
line 1
line 2
\end{verbatim} }
\color{blue}{\begin{verbatim}
line 3
line 4
\end{verbatim}}
2. (here, using \usepackage{fancyvrb} also)
Code: Select all
\begin{Verbatim}[formatcom=\color{red}]
line 1
line 2
\end{Verbatim}
\begin{Verbatim}[formatcom=\color{blue}]
line 3
line 4
\end{Verbatim}
Thanks very much!
Stephen