This is my code:
\usepackage{verbatim}
\newenvironment{listing}
{\begin{minipage}{\linewidth}\verbatim}
{\endverbatim\end{minipage}}
However, it doesn't compile:
Runaway argument?
! File ended while scanning use of \next.
<inserted text>
\par
What is wrong?
Best Answer
You have to do
There's almost the same example on page 3 of the package documentation, see the definition of the
fred
environment.Note that
\begin{minipage}
executes (among other things)\minipage
and similarly\end{minipage}
executes\endminipage
.