I have three simple files which load colour-related packages although they don't attempt to use any fancy colours. These are file col.tex
:
\documentclass{minimal}
\usepackage{color}
\begin{document}
ABC
\end{document}
file col-black.tex
:
\documentclass{minimal}
\usepackage{color}
\begin{document}
\textcolor{black}{ABC}
\end{document}
and file xcol.tex
:
\documentclass{minimal}
\usepackage{xcolor}
\begin{document}
ABC
\end{document}
I latex
and then dvips
(with dvips(k) 5.994) each of them, and I look at the postscripts. I was expecting to get "ABC" in black in all cases, as if I had not loaded any colour package at all. However, when visualizing the files with evince
, this is not the case for file col.ps
, I get the "ABC" in a very dark grey, but clearly not black. If I ps2pdf
the postscripts the differences are even more clear using a large magnification in acroread
.
If I diff the three postscript files, apart from three mentions in each of them to the dvi file names, a couple of lines show differences: in col.ps
:
%%Page: 1 1
TeXDict begin 1 0 bop Black Black 166 83 a Fa(ABC)p Black
Black eop end
%%Trailer
in col-black.ps
:
%%Page: 1 1
TeXDict begin 1 0 bop Black Black 0 TeXcolorgray 166
83 a Fa(ABC)p Black Black Black eop end
%%Trailer
and in xcol.ps
:
%%Page: 1 1
TeXDict begin 1 0 bop 0 TeXcolorgray Black 0 TeXcolorgray
166 83 a Fa(ABC)p 0 TeXcolorgray 0 TeXcolorgray eop end
%%Trailer
Am I doing anything wrong? Is this the expected behaviour of the color
package? If it is, is there any way to set the default color in the header?
The problem seems to be with the definition of Black
. In all files it is defined as
/Black{0 0 0 1 setcmykcolor}
If I change the definition in col.ps
to
/Black{0 setgray}
I get the proper black I expected.
Best Answer
The choice of default colour is not really in the control of the
color
package, it is handled in thedef
file for the back end in use (dvips
here. I'm not sure why its cmyk black isn't as black as rgb but anyway you can force it to use rgb black as the default by setting the colour in the preamble, compare the effect with or without the commented line.