Info Node: (dvips.info)Color Subtleties

dvips.info: Color Subtleties
Color
Ted Turner
User Definable Colors
Back to Software Index
Subtleties in Using Color
=========================
These color macros are defined by use of specialized `\special'
keywords. As such, they are put in the `.dvi' file only as explicit
message strings to the driver. The (unpleasant) result is that certain
unprotected regions of the text can have unwanted color side effects.
For example, if a color region is split by TeX across a page boundary,
then the footers of the current page (e.g., the page number) and the
headers of the next page can inherit that color. To avoid this effect
globally, users should make sure that these special regions of the text
are defined with their own local color commands. For example in TeX,
to protect the header and footer, use
\headline{\Black{My Header}}
\footline{\Black{\hss\tenrm\folio\hss}}
This warning also applies to figures and other insertions, so be
careful!
Of course, in LaTeX, this is much more difficult to do because of the
complexity of the macros that control these regions. This is
unfortunate, but is somehow inevitable because TeX and LaTeX were not
written with color in mind.
Even when writing your own macros, much care must be taken. The color
macros that `colorize' a portion of the text work by prefixing the text
with a special command to turn the color on and postfixing it with a
different special command to restore the original color. It is often
useful to ensure that TeX is in horizontal mode before the first
special command is issued; this can be done by prefixing the color
command with `\leavevmode'.
automatically generated by info2www version 1.2