I specified two environment in a LaTeX document to highlight different lines of codes:
\newenvironment{code}{\color{blue}}{\ttfamily}{\par}
\newenvironment{codegrey}{\color{grey}}{\ttfamily}{\par}
In the document, I want the latter one appear right below the first one without any spacing. Here are the codes:
\begin{code}
\begin{verbatim}
\renewcommand{\arraystretch}{1.5}
\end{verbatim}
\end{code}
\begin{codegrey}
\begin{verbatim}
\begin{tabular}{|c|p{3cm}llcp{5cm}|}
\end{verbatim}
\end{codegrey}
My goal is to display them as:
Instead of this:
Any suggestions are appreciated! This is my first time using newenvironment command and I find it really powerful.