Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!uunet!mcsun!unido!sbsvax!yxoc
From: yxoc@sbsvax.UUCP (Ralf Treinen)
Newsgroups: comp.text
Subject: LaTeX environments and macros
Keywords: LaTeX, TeX, environments, macros, delimited parameters
Message-ID: <941@sbsvax.UUCP>
Date: 26 Sep 89 18:39:03 GMT
Organization: Universitaet des Saarlandes, Saarbruecken, W-Germany
Lines: 41


Hi,

I would like to define an environment that passes all its input text as a
parameter to a macro. An application of this is an environment that
prints its input text twice. The best thing I could do was

\def\doubleenv{\double}
\def\double#1\enddoubleenv{#1\par#1\par\end{doubleenv}}
\let\enddoubleenv\relax

so that I can write

normal textline
\begin{doubleenv}
This line to be printed twice
\enddoubleenv
normal textline

This solution has to drawbacks:

1.) it is not possible to use \end{doubleenv} since it seems not to be possible
    to include a begin group character in the parameter delimeter text. I don't
    want to change the catcodes of { and } as it is done in LaTeX's verbatim
    environment.

2.) it is not possible to use nested doubleenv environments since there is no
    matching of nested parameter delimeters.

I would appreciate any solution

     Ralf
-- 
------------------------------------------------------------------------------
EAN  :treinen%fb10vax.informatik.uni-saarland.dbp.de  (preferred!)
UUCP : ...!uunet!unido!sbsvax!treinen   | Ralf Treinen
        or treinen@sbsvax.UUCP          | Universitaet des Saarlandes        
CSNET: treinen%sbsvax.uucp@Germany.CSnet| FB 10 - Informatik (Dept. of CS)  
ARPA : treinen%sbsvax.uucp@uunet.UU.NET | Bau 36, Im Stadtwald 15          
Phone: +49 681 302 2065                 | D-6600 Saarbruecken 11, West Germany 
------------------------------------------------------------------------------