"Clever tricks" for using \outer macros

As egreg said, the standard way is with \csname: as long as there is no \outer token at the time of the definition, you are safe.

So another possibility is, in a group, make the macro non-outer, define your macro, and then reset everything:


The problem with this version is that if you need to pass the \outer macro as argument to an auxiliary, you can't. A handier version is to define a non-outer wrapper to the \outer macro, then you can use it freely:


The standard trick is \csname:

  \csname newdimen\endcsname#1%

Or \noexpand:

\edef\myproclaim#1#2\endmyproclaim{\noexpand\proclaim #1. \ignorespaces #2\par}

This is better syntax.

\proclaim Theorem.
This is worse syntax.


enter image description here

The famous \cleartabs, \settabs and \+ macros from plain.tex show one such trick (TeXbook p. 354):

\let\+=\relax % in case this file (plain.tex) is being read in twice
\def\sett@b{\ifx\next\+ \let\next=\relax % turn off \outerness


  1. \let\+=\relax is done before defining \sett@b in case \+ would already be an \outer token (otherwise, the \+ token in the replacement text of \sett@b would cause an error when \sett@b is defined).

  2. When the \ifx\next\+ test is true during normal usage of \settabs in the document, \next is an \outer token since in normal usage, \+ is \outer. Thus, Knuth does \let\next=\relax before redefining \next with \def\next{\afterassignment\s@tt@b\let\next}, otherwise the \next token at the end of the replacement text in this definition would cause an error.