[Xy-pic] Default color model

Ross Moore ross.moore at mq.edu.au
Tue Aug 3 21:47:25 CEST 2010


Hi Vadim,

On 03/08/2010, at 11:49 PM, Vadim Radionov <vadim.radionov at gmail.com> wrote:

> Hi Ross,
> 
> thank you for the explanation.
> 
>> Why do you need this?
>> 
>> Once before I had to do this, since a publisher objected to having RGB in the PDF.
>> Is yours a similar problem?
> 
> Yes, it's exactly my case.

Thought so. Which publisher?

> I used your recipe with \dump and \usePSheaders.  There's no explicit
> "0 0 0 setrgb" in the dump, so is it the line
> 
> /xycolor{0 1 2{xycolarray exch get}for setrgbcolor}def
> 

It's so long since I've worked in PostScript that I forget the exact names.
Also whether '0 setgray' gives black or white.


> that I have to change?  And is
> 
> /xycolor{0 setgray}def

Yes, this forces a single color.

Another way is to define setrgbcolor to throw away 2 components and invert the 3rd.
E.g.  /setrgbcolor{pop pop 1 sub neg}def
Or take a weighted sum of the components to convert to grayscale
  /setrgbcolor{1 sub .6 mul neg 
            exch 1 sub .15 mul neg add
            exch 1 sub .25 mul neg add
            }def

I don't understand why the publisher doesn't just do this kind of thing as a matter of course. It's not rocket science, and was a pretty standard technique for grayscale conversion years back.

> 
> a suitable replacement (it looks fine in my case, but probably I'm
> breaking something)?

The PostScript to PDF translation would fail if there was an error in this coding.
So test it using any distiller, and printing a few pages that have Xy-pic diagrams.

Daniel Müllner's solution should work too, as it avoids my PostScript stuff altogether, going directly to PDF.

> Thank you again,
> 
> Vadim


Hope this helps,

      Ross



And it is good to have this problem and solution in the Xy-pic mailing list archives.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://tug.org/pipermail/xy-pic/attachments/20100804/abf2af78/attachment.html>


More information about the xy-pic mailing list