From: MJD@MATH.AMS.ORG (Michael Downes)
Newsgroups: comp.text.tex
Subject: Re: \outer
Date: 8 Sep 92 14:10:00 GMT
Organization: Info-Tex<==>Comp.Text.Tex Gateway
X-Gateway-Source-Info: Mailing List

Dan Luecking wrote:

> On 3 Sep 92, eijkhout@cupid.cs.utk.edu (Victor Eijkhout) said (among other
> things):
>
> >
> >The outer-ness implies that such macros cannot appear as macro
> >arguments or in macro bodies,
> >something that makes sense for things such as \theorem.
>                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> Wrong. I write mathematical papers and am mostly content with plain TeX's
> \proclaim macro. But sometimes I have to add material in front of or after
> every theorem. The easiest way to do this is (or would be if not for
> \outer-ness)
>
> \def\Proclaim#1#2\par{%
> <preliminary stuff>\proclaim#1. #2\par<closing stuff>}
>
> Another possibility denied me: \def\lemma#1\par{\proclaim Lemma. #1\par}

An easy trick for getting around that hindrance was given by
\`Eamonn McManus in TeXhax vol 90 issue 64 (Oct 7 1990): Use

  \csname proclaim\endcsname

instead of \proclaim inside the definition. If TeX executes this
string it will turn into \proclaim, but if TeX is simply reading it
into a definition or skipping it on the false branch of an if
statement, it is innocuous. I suspect Victor might mention this
somewhere in his book (`TeX by Topic'), though I don't recall offhand.

> According to the TeXbook ``...a user shouldn't be stating a theorem as part
> of a definition...''
> I can't think of any sentence in the Texbook more absurd than this one!
> I don't want to state a theorem, just modify the definition of \proclaim
> without having to rewrite the whole thing.

Your point of view is based on your decision that you do not want the
error-catching capabilities of outer macros. I'll not beef against
that, but just say that there are others (at least myself) who find
them useful rather than annoying. I write a fair amount of TeX macro
code and find that one of my most frequent errors is leaving off a
closing brace for a definition (yes, even with Emacs and its
auto-matching braces, I still sometimes forget to check).  Lately I
have gone to using a \newmacro ... \endmacro structure around each
definition with \endmacro being \outer.  This pinpoints the source of
a missing close-brace error about as fast and accurately as possible.

> The stated reason (in the TeXbook) for \outer-ness is as an error
> catching tool. However, the error messages generated are singularly
> unhelpful.

It may be that the \outer attribute is more useful to macro writers
than to document writers. On the other hand, if you throw away all use
of \outer, then missing \fi's or closing braces for definitions are
only caught by end-of-file or by TeX running out of main memory. The
error messages for these are if anything less helpful in locating the
source of the problem than the error message generated by an outer
control sequence. And if you are running a big version of TeX, TeX
will usually not give you the error message until it has read an
entire article or book chapter without typesetting anything.

> ... Moreover \outer macros are forbidden ``where tokens are
> being absorbed at high spead''.  What has the speed of absorption
> got to do with error trapping?

It's not the speed that's important, it's the fact that the high-speed
absorption of tokens goes hand-in-hand with the possibility of a
runaway condition---the problem that \outer is designed to catch---in
places like the false branch of a conditional, or the replacement text
of a definition.

Michael Downes                              mjd@math.ams.org (Internet)