[tex-k] dvitomp update: support \Black, \Red, and similar colordvi commands

Eddie Kohler kohler at cs.ucla.edu
Sun Aug 29 01:09:40 CEST 2004


>>(3) Perhaps a mixed approach is best.  dvitomp would parse the
>>existing color names, but if it saw an unknown color name, it would
>>pass it through unchanged, as in your patch.  It would also parse
>>"rgb" specials.
>>
>>I think (3) is the best way to go.  What do you think?
> 
> 
> In total, agreed. It's then adding the xalloc/free for the names,
> push/pop them also and use them instead of black with warning, if colors
> don't match.

Hi all,

The following patch, against the dvitomp.ch in tetex-src-beta-2.96.7.20040721, 
changes the color support to parse "color push rgb", "color push cmyk", and 
"color push gray" specials -- all the specials understood by dvips -- as well as 
the existing named colors.  I think dvitomp is now as smart as dvips as far as 
colors are concerned.

LaTeX code like  \textcolor[rgb]{0,1,0.5}{Text}
gets translated into "... withcolor (0,1,0.5)".

LaTeX code like  \textcolor[cmyk]{0,1,0.5,0.5}{Text}
gets translated into "... withcolor cmyk(0,1,0.5,0.5)".  You have to provide a 
"cmyk" macro in MetaPost for this to work; the 'mfpic' package provides such a 
macro.  (Note also that the 'mfpic' package provides predefined macros for all 
the dvips Crayola colors!)

LaTeX code like  \textcolor[gray]{0.2}{Text}
gets translated into "... withcolor white*(0.2)".

Named colors are still hard-coded, as before.  But non-understood named colors 
are passed through to MetaPost unchanged.  So "\special{color push 
Whatever}text\special{color pop}" gets translated into "... withcolor Whatever". 
   (You have to use the specials because the color package will complain about 
unknown color names.)

Olaf/Thomas, any comments?

Thanks, Hartmut, for the ideas for this.
Eddie
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dvitomp.patch
Type: text/x-patch
Size: 15013 bytes
Desc: not available
Url : http://tug.org/pipermail/tex-k/attachments/20040828/917aee12/dvitomp.bin


More information about the tex-k mailing list