## 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: Monospaced Font

Subject:

Interface and Implemntation

From:

Date:

Mon, 24 Feb 1997 13:41:53 +0100

Content-Type:

text/plain

Parts/Attachments:

 text/plain (36 lines)
 About the the question of implementation and interface, I just developed my "environment with hooks" I posted here a few years ago, as a LaTeX2e .sty file, developed in an "object oriented" style, with names like     \Environment/@error and so on. This works out quite nicely.   The user style is like     \Environment{LaTeX}{equation} using the name \Environment as a "constructor" for converting an old LaTeX environment "equation" to one of the new type. This definition then calls the name    \Environment/@def/LaTeX with the "@" indicating that the name "def" is private to the locality "Environment/". More or less, this is C++ terminology straight on.   Some specs:   The environments can execute commands both before and after each of the \begingroup and \endgroup environment commands, and all of these four possible commands can take arguments, with definitions of the form   \new{Environment}%     {foo}par1{before cmds}{begin cmds}par2{end cmds}{after cmds} where the first parameter block par1 (like "#1#2..") is used by both the before and begin commands, and the second parameter block par2 is used by both the end and after commands, so one can send arguments to these commands quite freely.   The environments also keep track of environments nested in the definition of another environment. It is also possible to, as a user command, to exclude the name in the endgroup (corresponding to constructs like "\begin{foo} .. \end{}").   If I get time, I might work this up to something more serious -- perhaps introducing the ability of creating environments with optional arguments.   Hans Aberg