[Tikzdevice-bugs] Context and tikz?

Matthieu Stigler matthieu.stigler at gmail.com
Mon Apr 18 15:54:21 CEST 2011


Charlie

Thanks a lot for actually looking at my r-list e-mail, and trying to 
sort out, much appreciated!!!

So for the bad news: too bad indeed, hoped it would be possible, and 
would have been an elegant solution (current solution is to hack the 
.ps, very ugly).

For the good news, I could not evaluate how good they are :-) I'm 
getting more and more confused, discovering new Tex-like things at each 
e-mail :-) Basically, your suggestion is: should use context which 
should entail METAPOST figure code, right? And METAPOST code could be 
generated from the tikz one? I am totally fine to forget about features 
like raster or polypath, but you think conversion from tikz to metapost 
would be easy? Just watched the tikz and metapost code and still seemed 
quite different, no? If it would be done once, I guess it's on the far 
roadmap? We are in the situation where we need to be able to convert to 
pentone our R plots in a few days :-(

Thanks so much, your help is very precious!

Mat


Le 15/04/2011 22:41, Charlie Sharpsteen a écrit :
> I just found your post on R-Help:
>
> http://r.789695.n4.nabble.com/R-plots-pdf-does-not-allow-spotcolors-td3446696.html#none
>
> Which definitely puts what you are trying to achieve with colors into 
> context. I played around with context a little bit, and there is some 
> good and bad news.
>
> The bad news first: It appears TikZ won't work with ConTeXt colors, at 
> least not with spot colors. There are a couple of reasons for this:
>
>     * It appears that at a low level, the TikZ color engine only works
>       with RGB and Grayscale colors.
>
>     * For the new version of ConTeXt, MK IV, there is no code in that
>       links ConTeXt's "\definecolor" command to TikZ's color model,
>       which means "\pgfutil at definecolor{name}{rgb}{values}" must be used.
>
> This means TikZ graphics can be made just fine in ConTeXt, but I could 
> not find a way to link an RGB value to a spot color.  So, at this 
> moment it doesn't look like TikZ is a viable way to produce PDF files 
> that have correctly set spot color information.
>
>
> Now, for the good news.  ConTeXt has it's own graphics library called 
> METAPOST for which there is better support for ConTeXt color 
> definitions. For example, the following METAPOST graphic uses a CMYK 
> color that is linked to a PANTONE definition:
>
>
> \runMPgraphicstrue
>
> \definecolor
>   [PantoneThreeZeroEight]
>   [c=1,m=.05,y=0,k=.47]
>
> \definespotcolor
>   [DarkBlue]
>   [PantoneThreeZeroEight]
>   [p=1,e=PANTONE 308 CV]
>
> \setupcolors[spot=yes,state=start,overprint=yes]
>
> \starttext
> \startMPpage
>   fill unitsquare scaled 1cm withcolor \MPcolor{DarkBlue};
>   fill unitsquare shifted (0.5,0.5)
>     scaled 1cm withcolor transparent(1,0.5,red);
> \stopMPpage
> \stoptext
>
>
> The output PDF contains PANTONE 308 CV as a spot color channel that 
> contains the first square definition. Now, the syntax of METAPOST is 
> similar enough to TikZ that it may be possible to modify the 
> tikzDevice to output METAPOST code instead of TikZ code.  This may not 
> take much effort if you were willing to skip support for more exotic 
> features like polypath construction and raster images (which wouldn't 
> conform to Spot Colors anyway). In fact, I've always thought about 
> adding support for other TeX graphics libraries as a possible post-1.0 
> direction for the tikzDevice.
>
> -Charlie



More information about the Tikzdevice-bugs mailing list