12.7 \newsavebox

Synopsis:

\newsavebox{\cmd}

Define \cmd, the string consisting of a backslash followed by cmd, to refer to a new bin for storing material. These bins hold material that has been typeset, to use multiple times or to measure or manipulate (see Boxes). The bin name \cmd is required, must start with a backslash, \, and must not already be a defined command. This command is fragile (see \protect).

This allocates a bin and then puts typeset material into it.

\newsavebox{\logobox}
\savebox{\logobox}{LoGo}
Our logo is \usebox{\logobox}. 

The output is ‘Our logo is LoGo’.

If there is an already defined bin then you get something like ‘LaTeX Error: Command \logobox already defined. Or name \end... illegal, see p.192 of the manual’.

The allocation of a box is global.


Unofficial LaTeX2e reference manual