# [texhax] \newcommand that spans \begin \end

Joey Coyle joeypics at xcoyle.com
Mon May 23 02:27:20 CEST 2005

Hi,

With all my experimenting of code blocks, I would just like to make up
a command so I don't have to change things all over the place.

\begin{Verbatim}[baselinestretch=1,fontsize=\small,frame=lines,numbers=l
eft]
<mycode>
<someCode/>
</mycode>
\end{Verbatim}

I would like to write something like

\codeStart
<mycode>
<someCode/>
</mycode>
\codeEnd

So I tried this... but it doesn't work

\newcommand{\codeStart}{\begin{Verbatim}[baselinestretch=1,fontsize=\sma
ll,frame=lines,numbers=left]}
\newcommand{\codeEnd}{\end{Verbatim}}

Here is the error I get
Runaway argument?
! File ended while scanning use of \FancyVerbGetLine.
<inserted text>

Am I taking the wrong approach to writing this command?

thanks,
joey