7

I am using \pagecolor to create a black background for white text. This was ok until by mistake I printed black text on the black background - the black text was clearly visible, which to me means that the black background isn't really black.

Trying the \definecolor{pitchblack}{cmyk}{0,0,0,1} which I found in xcolor black isn't black enough didn't help.

What am I doing wrong?

I hope below qualifies as an MWE despite me leaving the xelatex in. It dind't compile using LaTeX and I am not an expert...

%!TEX TS-program = xelatex 
%!TEX encoding = UTF-8 Unicode 

\documentclass{article}

\usepackage[cmyk]{xcolor} 

\definecolor{pitchblack}{cmyk}{0,0,0,1}

\begin{document}

\pagecolor{pitchblack}

{\Huge Test}

\end{document}
Thorsten
  • 461
  • 1
    I can't see a thing when I compile your code. It shows when you're using \definecolor{pitchblack}{cmyk}{1,1,1,1}. Perhaps you were using a different black? – Werner Oct 23 '17 at 18:49
  • On my system, with pdflatex it is black but with xelatex it is indeed gray. – Marijn Oct 24 '17 at 10:56
  • 1
    \usepackage[rgb]{xcolor} \definecolor{pitchblack}{rgb}{0,0,0} works also in XeLateX though. – Marijn Oct 24 '17 at 10:57
  • OK, I knew that CMYK stuff that I will need when dealing with a printer would be tough, but I hadn't expected to run into problem so early. Thanks for all your help! – Thorsten Oct 24 '17 at 19:52

1 Answers1

3

In cmyk, black looks rather gray on screen (see https://tex.stackexchange.com/a/209990/89417). There are differences between xelatex and pdflatex/lualatex in how this is handled. For pdflatex and lualatex the default text color follows the definition of the color model (i.e., gray), but for xelatex the default text color is 'mixed' black (1,1,1,1) which looks black on screen. Your MWE with xelatex therefore shows black text on a gray page:

enter image description here

You can solve the issue (for all engines) by explicitly declaring the text color to be the same as the page color:

\documentclass{article}
\usepackage[cmyk]{xcolor} 
\definecolor{pitchblack}{cmyk}{0,0,0,1}
\begin{document}
\color{pitchblack}      % set text color
\pagecolor{pitchblack}  % set page color

{\Huge Test}

\end{document}

enter image description here

Or \definecolor{pitchblack}{cmyk}{1,1,1,1} for 'mixed' black: enter image description here

Note that for professional printing you should ask your printer which values they prefer/advise to use for black (which is not always the same).

Alternatively you can use rgb:

\usepackage[rgb]{xcolor} 
\definecolor{pitchblack}{rgb}{0,0,0}
Marijn
  • 37,699