Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I need to provide a duotone pdf (say black and cyan). My figures are made with tikz, pgfplots and asymptote (3D but no prc), some with opacity effects. I compile with pdftex and luatex.

  1. What do I have to do so that it works smoothly? I can think of defining new cycle list for pgfplots and, of course, not using blue or red in tikz or in asymptote. Is there something else? Will opacity work?

  2. What kind of colors can I use? How can I define them with xcolors? What rationale do one use to name those colors?

  3. Regarding color pictures. Do I need to convert them outside of TeX or is there a way to do it from TeX?

share|improve this question
    
Would \selectcolormodel{gray} from xcolor package be sufficient? –  percusse Nov 8 '12 at 16:29
    
@percusse I may be wrong here but I think that the gray color model is monotone (only black). –  cjorssen Nov 8 '12 at 16:53
1  
Oops, so you want to blend black and cyan? Or better, say you have red in the document now what kind of mechanism do you have in mind? –  percusse Nov 8 '12 at 16:55
    
@percusse I have no color in my document yet. I just want to make the right decisions regarding color definition. Yes: I can blend black and cyan. –  cjorssen Nov 8 '12 at 22:42
    
Concerning pgfplots: if you use any code which relies on colormaps (like scatter or surf or contour variants), you may want to (a) use a suitable colormap and (b) ensure that you have the correct colorspace. Default is RGB, but you can also use colormap default colorspace=cmyk (applies only to newly generated colormaps, compare manual). Sounds as if CMYK might be a good choice here to simplify interpolation between black and cyan (?) –  Christian Feuersänger Nov 11 '12 at 21:25
add comment

2 Answers

From my experience, the most efficient way seems to use only user defined colors, within the cmyk color space (affecting 0 to both magenta and yellow channels).

For example, here are the definitions of the colors I used in my project.

\usepackage[cmyk]{xcolor}
\providecolor{PureDuotone}{cmyk}{1,0,0,0}
\providecolor{DarkDuotone}{cmyk}{1,0,0,0.4}
\providecolor{LightDuotone}{cmyk}{.3,0,0,.3}
\providecolor{PaleDuotone}{cmyk}{0.1,0,0,0}
\providecolor{LightGray}{cmyk}{0,0,0,.10}
\providecolor{Gray}{cmyk}{0,0,0,.15}
\providecolor{DarkGray}{cmyk}{0,0,0,.25}
\providecolor{VeryDarkGray}{cmyk}{0,0,0,.4}
\providecolor{UltraDarkGray}{cmyk}{0,0,0,.6}

For pgfplots, I used the following (I'm stuck to version 1.8).

\usepgfplotslibrary{colormaps}
\pgfplotsset{%
  colormap default colorspace = cmyk,
  colormap = {duotone}{cmyk(0cm)=(1,0,0,.4); cmyk(1cm)=(.4,0,0,1)}}

\pgfplotscreateplotcyclelist{duotonelinestyles*}{%
  {%
    solid,
    color = DarkDuotone,
    thick,
  },
  {%
    solid,
    color = black,
    thick,
  },
  {%
    solid,
    color = VeryDarkGray,
    thick,
  },
  {%
    dashed,
    color = DarkDuotone,
    thick,
  },
  {%
    dashed,
    color = black,
    thick,
  },
  {%
    dashed,
    color = VeryDarkGray,
    thick,
  }}

I suggest to call xcolor before all tikz related package with the option cmyk.

Unfortunately, it does not solve all issues: patterns and shadings in tikz are hard coded in the RGB colorspace in the resulting pdf file (even they are defined in terms of cmyk colors). A workaround is possible with patterns, but, at the time of writing, there is no equivalent for shadings that I'm aware of.

share|improve this answer
add comment

For asymptote figures, the cmyk command-line switch -cmyk may help, provided colors are defined in terms of cmyk pens inside the asy source. For some figures, I needed to use imagemagick's convert. Here is a little script that I found useful.

#!/bin/bash
for i in $(find -name "*.asy")
  do  asy -render 5 -cmyk -noV -noprc $i -o ${i%asy}eps
      convert -colorspace cmyk -channel c -fx 'c-y' -channel k -fx 'k+m' -channel y -fx '0' -channel m -fx '0' -density 300 -geometry 50%x eps:"${i%asy}eps" jpg:"${i%asy}jpg"
done
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.