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

 Options: Use Forum View Use Monospaced Font Show Text Part by Default Show All Mail Headers Message: [<< First] [< Prev] [Next >] [Last >>] Topic: [<< First] [< Prev] [Next >] [Last >>] Author: [<< First] [< Prev] [Next >] [Last >>]

Achim wrote:

> > the problem with this and perhaps the problem with the whole mechanism
> > is that a lot of people have learned to write environments like this:
> >
> > \newenvironment{foo}{...\quote ...}{ ... \endquote ...}
> >
> > ie without using \begin/\end internally.
> >
> > if all such things like \quote internally use \EndThisEnviornment then
> > guess what happens. so this needs some thoughts.
> >
> >  a) do not allow above usage
>
> IMHO such hacks as above shouldn't be allowed anyway. If someone directly
> accesses internals of some package instead of using the defined
> interface he deserves his code breaking when the implementation is
> changed.

In theory I do agree with this but in practice one might have to be more
careful simply because this usage is so common. Unfortunately I was even used
(perhaps even is) by Leslie Lamport in its original class files.

It also has the side-effect of not changing \@currenvir and some people have
used this deliberately to get proper error messages for their environments.

> Besides, what happenes if someone uses two nested lists in the
> above way? So you have the problem regardless of whether all templates
> share a common name or each uses its own one.

true, which is why I said one probably has to think about it more generally.

> One way to allow hacks like this could be to define \newenvironment as
>
>   \newenvironment <name> <begin-code> <end-code> :=
>     \def\<name>{
>       \begingroup
>       <begin-code>
>     }
>     \def\end<name>{
>       <end-code>
>       \endgroup
>     }
>
> that is, to move the \begingroup, \endgroup from \begin and \end
> into the \foo, \endfoo commands.