## LATEX-L@LISTSERV.UNI-HEIDELBERG.DE

#### View:

 Message: [ First | Previous | Next | Last ] By Topic: [ First | Previous | Next | Last ] By Author: [ First | Previous | Next | Last ] Font: Proportional Font

Subject:

Re: environment templates

From:

Date:

Sun, 9 Jan 2000 18:36:23 +0100

Content-Type:

text/plain

Parts/Attachments:

 text/plain (48 lines)
 At 21:54 +0100 2000/01/08, Frank Mittelbach wrote: > > One way to allow hacks like this could be to define \newenvironment as > > > > \newenvironment := > > \def\{ > > \begingroup > > > > } > > \def\end{ > > > > \endgroup > > } > > > > that is, to move the \begingroup, \endgroup from \begin and \end > > into the \foo, \endfoo commands. > >That could be a solution to get the best of both (costing a few tokens per >defined environment but this is not really an issue) I have not followed this thread much. But when I worked on "environments with hooks", I arrived at the conclusion that the environment definition should be such that the user does not enter the \begingroup and \endgroup commands explicitly. The reason is that in order to control the nesting of environments, one needs to have some local variables, so the group localities must always be present. Further, in order to allow for proper nesting of environments also in the environment definition, I had to make use of more local variables than the current LaTeX. If one writes   \newenvironment{list}{...}{...}   \newenvironment{mylist}{...\begin{list}...}{...\end{list}...} I thus had to keep track of both the list'' and mylist'' environments when executing the mylist'' environment. In order to properly accomodate for the use of environment hooks, I had to make an additional difference with LaTeX: In LaTeX2, the \begingroup (resp \endgroup) command is executed by the \begin{...} (resp. \end{...}) commands. I had to change this, so that the \newenviroment{}{...}{...} command creates commands \/begin containing the \begingroup command and \/end containing the \endgroup command. The \begingroup (resp \endgroup) command then executes \/begin (resp. \/end) command. -- Perhaps this is the change you are looking for.   Hans Aberg