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

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

 Re: template interfaces and what they mean Hans Aberg <[log in to unmask]> Tue, 25 Jan 2000 18:30:02 +0100 text/plain (48 lines) At 14:42 +0100 2000/01/25, Frank Mittelbach wrote: >to formulate those a bit more abstractly: > > 1) how much freedom has a template to interpret its arguments (ie data passed > to it from the document)? > > 2) what is the scope a template instance apply itself? is it well-defined? > >let's tackle 1) first. Achim suggests that the pshape type should get two >arguments those meaning should depend on the template. in my opinion this is >likely to result in chaos. > >the main idea behind the template types is that logical structure of the >document, i.e., the commands and environments therein, are transformed into >instance calls of templates of certain types. this is defined via, say, an >xpare interface and does define the document class (no formatting yet) >structure. -- Perhaps this input can be used for the template discussion: One idea that comes to my mind in connection with the "environments with hooks" is to build up two layers, one which takes care of the semantics, and one which takes of the syntax by which the environments are called. The semantics for environments with hooks is (where is the environment name)   \/before     \begingroup       \/begin         ... % User code within the environment       \/end     \endgroup   \/after Here, some arguments should (when required by the environment definition) be passed to the commands \/before, \/begin, \/end, \/after. This one might do with simplified arguments, say   \/before#1[#2]#3{...} etc, if one semantically wants to allow for optional arguments. This provides an underlying semantic layer for the environments. On top of this, one should call the environment by some syntax, which could be the old LaTeX2 \begin{} ... \end{}, but which again could be something different, say a HTML look-alike, or one a syntax which simplifies math typing.   Hans Aberg