According to the TeXbook, the sole and intended purpose of \outer
is to detect runaway arguments to \long
macros and other situations where forbidding \par
won't help you (p. 206). Knuth explicitly notes that he hopes that format authors make discriminating choices as to their \outer
macros so that the document structure can inform TeX as to the presence of missing close-braces. To see what kind of choices he considered discriminating, here are the things he declared \outer
in the plain
style (Appendix B) and the TeXbook format (Appendix E):
In plain
:
\new
anything (count, dimen, etc.)
^^L
, as noted by Lev Bishop
\+
(the tab skip command)
\proclaim
(which functions as a theorem environment), \beginsection
\bye
(ends the document)
In the TeXbook:
\beginchapter
, \endchapter
, \begindisplay
, \enddisplay
, \begintt
, \exercise
, \dangerexercise
, \ddangerexercise
, \answer
(all of them basically sectioning commands)
\danger
, \ddanger
(for putting in the Bourbaki "dangerous bend" signs)
Will Robertson says that LaTeX2e doesn't use \outer
, so no lessons are forthcoming there, but based on this example, I would say that if it had been written by Knuth, then macros such as \section
and \chapter
, and likely environments in general, would all be \outer
.
To generalize, then, I would say that \outer
is supposed to be used to communicate the intent of the document structure from the author to TeX: to indicate which regions of the document are self-contained. Of course, as designed it functions entirely to save the author from themselves (it is only for error checking, not for layout), so given that its intended place is in high-level structural macros, it seems unlikely that the general TeX user will ever use any macros that they themselves define to be \outer
: how many people write formats for their own use, or at all for that matter?
Another problem with \outer
shows up in a few of TeX's design decisions and is related to the passage of time. Namely, this macro seems designed to minimize wasteful duplication of effort in that it helps provide useful diagnostics. My experience with LaTeX is that it does not provide useful diagnostics: whenever I get an error, I usually get a few dozen and only the first means anything. I correct that one, then recompile; often that eliminates all subsequent errors.
The careful use of \outer
would confine meaningless errors to small regions of the document, so that once a sectioning boundary is crossed no further errors should arise from unbalanced braces in any one macro. Thus, hopefully, the debugging process can proceed in sublinear time in the number of errors (or, at least, linear with a small coefficient). I think few young computer users (like me) have the habit of performing batch processing on their work, which was presumably more necessary back in the days of shared computing, paid computer time, and slower processors. For better or worse, we can have (sometimes hostile) dialogues with our machines these days.