# [texhax] Changing font color of a saved box of text - is it possible?

Philip TAYLOR P.Taylor at rhul.ac.uk
Tue Sep 4 12:40:25 CEST 2012


Ivan Griffin wrote:

> I'd like to be able to save a box, and then change the color of the font
> in it when I come to use it.  Is this possible?

Not really a solution, but you could always save the material in a token
list register rather than a box.  Alternatively you might want to
consider using XeTeX, in which the solution is trivial :

% !TeX Program=XeTeX

\setbox 0 = \hbox {abcd}
\special {color push cmyk 0 1 1 0}
\copy 0
\special {color pop}
\special {color push cmyk 1 0 1 0}
\copy 0
\special {color pop}
\special {color push cmyk 1 1 0 0}
\copy 0
\special {color pop}
\end

Philip Taylor