I have troubles trying to nest verbatim environment inside my \newenvironment definition one so I can include my source code faced to its result as on the most latex books printed. I can do it in a mechanical way:
\begin{minipage}[b]{5in}
\fbox{\begin{minipage}[t]{2.5in}
\makebox[0mm]{gorilla gorilla}\\
\framebox[2mm][l]{gorilla gorilla}\\
\framebox[2mm][r]{gorilla gorilla}\\
\end{minipage}}\hfill
\begin{minipage}[t]{2.5in}
\begin{verbatim}
\makebox[0mm]{gorilla gorilla}\\
\framebox[2mm][l]{gorilla gorilla}\\
\framebox[2mm][r]{gorilla gorilla}\\
\end{verbatim}
\end{minipage}\mbox{}
\end{minipage}
But I'm not able do it in an automatic way by means my \newenvironment:
\newenvironment{exe}[1]{\begin{minipage}{5in}
\begin{minipage}{2.5in} #1 \end{minipage}\hfill
\begin{minipage}{2.5in}\begin{verbatim}#1\end{verbatim}\end{minipage}}
{\end{minipage}}
\newcommand{\bex}{\begin{exe}}
\newcommand{\eex}{\end{exe}}
%Inside the body:
\bex{\framebox[2mm]{gorilla gorilla}\\
\framebox[2mm][l]{gorilla gorilla}\\
\framebox[2mm][r]{gorilla gorilla}\\
}\eex
The macro works if I remove \verbatim environment from the definition...
I'm desperate. Anyone can help me?
Thanks in advanced
Best Regards!
P.S.: For any extrange reason squared brackets are missed on the \newenvironment definition. 1



verbatimas an argument to a macro/environment. However, this question, https://tex.stackexchange.com/questions/128399/print-small-tex-code-verbatim-and-render-it, may help. – Steven B. Segletes Mar 01 '18 at 13:28