Received: by nummer-3.proteosys id <01C19442.D3D724EC@nummer-3.proteosys>; Thu, 3 Jan 2002 11:38:48 +0100 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01C19442.D3D724EC" x-vm-v5-data: ([nil nil nil nil nil nil nil t nil][nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil]) X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message Subject: Re: environment error recovery Date: Wed, 22 Aug 1990 16:30:21 +0100 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: From: "Leslie Lamport" To: "Rainer Schoepf" Reply-To: "LaTeX-L Mailing list" Status: R X-Status: X-Keywords: X-UID: 230 This is a multi-part message in MIME format. ------_=_NextPart_001_01C19442.D3D724EC Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable 4) There is one thing that is left open in the implementation: the question whether we will provide commands that are only allowed at the outer level of environments. Something like the \outer primitive on LaTeX level. The reason for such commands is that they can catch problems of forgotten end tags that will otherwise produce error which are very difficult to track down. Take for example a \begin{figure} without an \end. LaTeX will typeset stuff into the figure until it will run out of space and depending on the TeX version this can be a few chapters later. So making, for example, section command to pop the environment stack would prevent those problems. On the other hand it would make it difficult to allow them in userdefined environments. Any suggestions and proposals? First of all, "popping the stack" is not necessary. Producing an error message, which lists the current "stack", will suffice. When such an error is encountered, the input is probably too screwed up for popping the stack to help much. Also, the problem might just as easily be a misplaced "outer" command as a missing \end command. (One possibilty would be to ask the user whether he wants to pop the stack, but I'm not sure that's worth the effort; and I don't know what TeX does when it's running a file in "batch mode" that asks for user input.) Secondly, I propose a \setinner declaration, which causes "outer" commands like \section to produce an error message. If the user doesn't want to allow outer commands within an environment he defines, then he can begin the definition with a \setinner command. The \setinner command doesn't need to be restricted to environments. For example, one could write \newcommand{\foo}[1]{\marginpar{\setinner #1}} Leslie ------_=_NextPart_001_01C19442.D3D724EC Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Re: environment error recovery

  4) There is one thing that is left open in the = implementation:
     the question whether we will = provide commands that are only
     allowed at the outer level = of environments. Something like
     the \outer primitive on = LaTeX level. The reason for such commands
     is that they can catch = problems of forgotten end tags that will
     otherwise produce error = which are very difficult to track down.
     Take for example a = \begin{figure} without an \end. LaTeX will
     typeset stuff into the = figure until it will run out of space
     and depending on the TeX = version this can be a few chapters later.
     So making, for example, = section command to pop the environment
     stack would prevent those = problems. On the other hand it would
     make it difficult to allow = them in userdefined environments.
     Any suggestions and = proposals?

First of all, "popping the stack" is not = necessary.  Producing an error
message, which lists the current "stack", = will suffice.  When such an
error is encountered, the input is probably too = screwed up for popping
the stack to help much.  Also, the problem might = just as easily be a
misplaced "outer" command as a missing \end = command.  (One possibilty
would be to ask the user whether he wants to pop the = stack, but I'm not
sure that's worth the effort; and I don't know what = TeX does when it's
running a file in "batch mode" that asks = for user input.)

Secondly, I propose a \setinner declaration, which = causes "outer"
commands like \section to produce an error = message.  If the user
doesn't want to allow outer commands within an = environment he defines,
then he can begin the definition with a \setinner = command.

The \setinner command doesn't need to be restricted to = environments.
For example, one could write

  \newcommand{\foo}[1]{\marginpar{\setinner = #1}}

Leslie

------_=_NextPart_001_01C19442.D3D724EC--