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

Mon May 23 09:53:20 CEST 2005

E. Krishnan :

> On Sun, 22 May 2005, Joey Coyle wrote:
>
>> 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}}
>
> Try using the command "\CustomVerbatimEnvironment" available in
> the "fancyvrb" package to define your own verbatim environments.
>

This is the right way to go, you could also use listings, which might
even be better.

Regarding listings and other verbatim material, you cannot for technical
reasons make shortcuts like you did above. Please read the fancyvrb or the
like environments

--

/daleif

You cannot help men permanently by doing for them
what they could and should do for themselves. ''
-- Abraham Lincoln