Skip to main content

{expansion} is about expanding tokens, including the manipulation of expansion order and the suppressing of expansion.

(La)TeX has a macro programming language that expands the macros to their definitions. Only TeX primitives for the direct typesetting, boxing and assignments are not expandable, but must be executed by TeX. In advanced macros the order of expansion must sometimes be changed, content must be fully expanded or certain macros must not be expanded until later.

Often used TeX macros for this are:

  • \expandafter
  • \noexpand
  • \edef and its global form \xdef
  • \unexpanded (e-TeX)