[XeTeX] CMYK to RGB conversion in xetex.def

Bruno Voisin bvoisin at mac.com
Thu Oct 6 17:23:02 CEST 2005


Hi Jonathan,

Le 6 oct. 05 à 16:30, Jonathan Kew a écrit :

> It might well be desirable to adjust xetex.def to match pdfTeX's  
> output more closely, if possible. But before assuming there's an  
> error, more research is probably in order. (Have you compared the  
> results of other paths, such as TeX->dvips->Distiller, TeX->dvips- 
> >ghostscript, TeX->dvipdfmx?)

I got from CTAN the source manual.tex for the hyperref manual, and  
modified it such that it uses the [colorlinks] option to the hyperref  
package also when processed with dvips; then TeXed it using either  
pdfTeX or TeX + dvips + GS. Here's a screenshot, showing the results  
and comparing them with XeTeX-notes.pdf. In all three cases the color  
red, corresponding to the table of contents (not visible in the part  
shown of XeTeX-notes.pdf), is the same; the color magenta,  
corresponding to links of the form http://[...], is the same for both  
variants of manual.pdf, but different for XeTeX-notes.pdf. The  
screenshot is with Preview, but the same happens with Adobe Reader.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: Image 3.png
Type: image/png
Size: 137007 bytes
Desc: not available
Url : http://tug.org/pipermail/xetex/attachments/20051006/04f28b1d/Image3-0001.png
-------------- next part --------------


> Note that you can also specify cmyk colors in XeTeX \special 
> {color ...} commands, but in this case, they'll be converted to rgb  
> by the xdv2pdf driver, and the results may not be the same as  
> pdfTeX gives. (xdv2pdf currently uses Ghostcript's formula, by the  
> way.) Or does pdfTeX put cmyk values directly into the pdf file? If  
> so, the result may depend on the viewer you use.

Yes, pdfTeX's definition file for the graphics package (/usr/local/ 
teTeX/share/texmf.tetex/tex/latex/graphics/pdftex.def) supports CMYK  
colors directly:

     % Colour Support. The following models may be used.
     %   * cmyk   supported directly.
     %   * rgb    supported directly.
     %   * RGB    converted to rgb by this file.
     %   * gray   supported directly.
     %   * named  converted to cmyk by this file.

On the other hand, for XeTeX, /usr/local/teTeX/share/texmf.local/tex/ 
xelatex/graphics/xetex.def contains:

     % Colour Support. The following models may be used.
     %   * rgb    supported directly, in HEX.
     %   * cmyk   converted to rgb (HEX) by this file.
     %   * RGB    converted to rgb (HEX) by this file.
     %   * gray   converted to rgb (HEX) by this file.
     %   * named  converted to rgb (HEX) by this file.
     %   * hsb    converted to rgb (HEX) by this file.

It's based on \special{x:textcolor=[...]} and \special{x:rulecolor= 
[...]}, and IIRC Ross wrote it before xdv2pdf supported the new  
dvips- and dvipdfm-style \special{color [...]}.

Bruno


More information about the XeTeX mailing list