The place I want to print my document at needs the PDF to be provided in CMYK. The document is mostly text, except for a few graphs and plots which are done in TikZ or pgfplots.
As suggested in this forum, calling \usepackage[cmyk]{xcolor} should do the trick, but I have no way of verifying that my resulting document is indeed set using CMYK. Using imageMagick, the PDF is reported as:
$ identify -verbose test.pdf | grep Colorspace
Colorspace: Gray
Colorspace: sRGB
[... lots of Colorspace: sRGB lines here ...]
I tried the command provided in the accepted answer of this thread on stackoverflow:
$ gs -o test-cmyk.pdf -sDEVICE=pdfwrite -sProcessColorModel=DeviceCMYK -sColorConversionStrategy=CMYK -sColorConversionStrategyForImages=CMYK test.pdf
But the result when calling identify is the same: every single colorspace is reported as Colorspace: sRGB. The same happens when I use imageMagick directly to try and convert the PDF:
$ convert in.pdf -profile "/usr/share/ghostscript/9.07/iccprofiles/default_cmyk.icc" out.pdf
I found a few discussions in this channel, in particular the two below. However, neither give me a final answer as to how to check if my PDF is indeed using the CMYK color model.
Option cmyk for xcolor package does not produce a CMYK PDF
In particular, the latter sugests the use of the command \pdfcompresslevel=0. The problem with that is, that apparently XeLaTeX does not like that command:
! Undefined control sequence.
l.4 \pdfcompresslevel
=0
colormapexplicitly needs a color space and the special featuremesh/color input=explicitalso needs an interpolation color space. In both cases, the default is RGB. And: colorbars rely on TikZ shadings which are unavailable for CMYK (could be reimplemented by means of a pgfplots shading which do support CMYK...). – Christian Feuersänger Jul 22 '13 at 18:29colormapormesh/color input. I set all color definitions explicitly; e.g.color=redin an\addplotcommand. But the question remains: how do I verify that my PDF is actually using the CMYK color model? It seems like the only realiable method to find that out is using Adobe Pro, which is not very feasible from my side (restricted by both operating system and wallet). – mSSM Jul 22 '13 at 22:15\usepackage[cmyk]{xcolor}a CMYK PDF was created indeed. I am going to leave this question open; maybe somebody knows a reliable way check for CMYK without access to Adobe products. – mSSM Jul 23 '13 at 14:53xcolor, i.e. they use the correct colorspace. I added a switch to pgfplots which does the same formesh/color input=explicitautomatically as well. Concerning my last remark regarding color bars: pgfplots automatically checks for the requested colorspace and avoids tikz shadings automatically (part of the current stable). Consequently,\usepackage[cmyk]{xcolor}is honored by pgfplots. – Christian Feuersänger Jul 28 '13 at 15:26\pdfcompresslevel=0: you can usepdftk <input>.pdf cat output <output>.pdf uncompressto uncompress a pdf without losses. The uncompressed pdf allows the same analysis as done in http://tex.stackexchange.com/questions/13071/option-cmyk-for-xcolor-package-does-not-produce-a-cmyk-pdf – Christian Feuersänger Jul 28 '13 at 15:31