[OS X TeX] workaround for the lack of color stack in pdftex?

Gary L. Gray gray at engr.psu.edu
Fri May 19 21:24:57 CEST 2006


The \textcolor command in the color package has a problem in pdftex  
because of the lack of a color stack. The problem is that  
occasionally (that is, when the right stuff happens around it, e.g.,  
marginal notes) a construct like the following:

\textcolor{red}{binormal unit vector}

when it is broken at the end of a line, will have the text before the  
break colored red and the text after the break not. We have been told  
(and have found when searching Google) that this is due to the fact  
that there isn't a color stack in pdftex. Heiko Oberdiek has a  
package called pdfcolmk that works around this problem, but it has  
the unfortunate side-effect that it changes the page layout so as to  
stretch the page such that the text at the bottom of some pages goes  
past the end of the page.

One brute force workaround seems to be to wrap each individual word  
in \textcolor, as in:

\textcolor{red}{binormal} \textcolor{red}{unit} \textcolor{red}{vector}

(since \textcolor seems to prevent hyphenation of its argument). This  
is clearly not good solution from the writer's standpoint. Therefore,  
we would like to have a command that takes its argument and wraps  
\textcolor around each individual word in the argument. Can any (La) 
TeX guru tell how we might do this?

Thanks in advance.

-- Gary
------------------------- Info --------------------------
Mac-TeX Website: http://www.esm.psu.edu/mac-tex/
          & FAQ: http://latex.yauh.de/faq/
TeX FAQ: http://www.tex.ac.uk/faq
List Archive: http://tug.org/pipermail/macostex-archives/




More information about the macostex-archives mailing list