[OS X TeX] feed env contents to command

Bruno Voisin bvoisin at mac.com
Mon Jun 19 11:09:07 CEST 2006


Le 19 juin 06 à 10:56, Alex Scorpan a écrit :

> How do I define an environment gaga so that
>
> 	\begin{gaga}
> 	blah
> 	\end{gaga}
>
> interprets to
> 	
> 	\gugu{blah}

Something along the lines of:

\newenvironment{gaga}
   {\gugu\begingroup}
   {\endgroup}

might work, though it's possible additional precautions have to be  
taken (so that the environment remains robust even with multi- 
paragraph content, or when a page break occurs within the  
environment; and also so that the environment content does not risk  
saturating TeX's memory before the end of the environment is  
reached). For insight into these issues, I'd recommend the TeXbook. I  
don't know whether LaTeX includes facilities for them; it may be that  
you have to study the LaTeX sources (such as latex.ltx) in order to  
see how the precautions are taken in LaTeX's built-in environments.

Not so helpful, then! I hope it can help a bit, though.

Bruno Voisin ------------------------- Info --------------------------
Mac-TeX Website: http://www.esm.psu.edu/mac-tex/
          & FAQ: http://latex.yauh.de/faq/
TeX FAQ: http://www.tex.ac.uk/faq
List Archive: http://tug.org/pipermail/macostex-archives/




More information about the macostex-archives mailing list