At 14:51 +0200 98/10/22, Chris Rowley wrote:
>Here are some desirable features of such a specification:
>
>-- provide a straightforward means of extending the available
>document-level environments (and commands), with clearly
>defined rules for what is allowed;
>
>-- distinguish (to both humans and software) clearly between such
>extensions (where the detailed syntax is very flexible) and an
>inner-level which has a rigorously defined syntax that is extensible
>only in more complex ways within (something like) package files;

The second rule translates into saying "provide an interface for the
implementation" (unless I have misunderstood what you are trying to say),
which should be avoided. Instead the desirable cause of action would be to
keep track of the information needed for defining environments: The
interface must be sufficiently general. (People trying to beat this
interface is to ask for trouble.)

With respect to nesting environment definitions, one needs some extra
variables keeping track of both the name of the defining environment and
the environment currently at the top of the stack.

I think LaTeX3 should define an entirely environment definition
structure, and try to make old environments works reasonably well in a
compatibility mode.

This may not be as difficult as it sounds, because new and old
environments would doffer mainly in the number of variables they use and
where the commands are executed: For example, in LaTeX, I recall the
\begingroup & \endgroup commands are executed by the \begin{foo} and
\end{foo} commands; for environments with hooks, it should be executed by
what corresponds to \foo and \endfoo, according to my analysis. I recall
that I tried a version where old style environments could be used to define
new style environments (even though there were some problems).

In addition, one should cut out the illogical stuff: For example, the
\begin{document} is not a start of an environment: It instead cancels a
\begingroup, I recall. This is used to force a Pascal-like top level
structure, but will cause problems if one will want to group documents
together in larger structures (say a journal).

I think that the things I did will not require a major effort to
implement. It is however imperative that it is implemented as a part of the
LaTeX macro package itself: I recall that when LaTeX2e changed, some of the
quick-and-dirty stuff stopped working.

When defining new style environments one needs to have special knowledge
about the special typesetting variables some environments need to have: So
perhaps only some of Them have it.

Hans Aberg