2

I am using tcolorboxes with grey frames for examples in my PhD thesis. It will be printed professionally and the sample print I received shows inconsistent colors. The tcolorboxes are created identically with a grey frame \definecolor{framegrey}{cmyk}{0,0,0,0.15}.

However when inspecting the PDF with Acrobat Professional I see that on some pages the grey frame is defined with the correct cmyk color (0,0,0,0.15), on other pages it is set with a different cmyk color (0.09,0.07,0.07,0)! These pages tend to have colorful pixel graphics inside the tcolorbox.

The framecolors looks identical on the screen, the resulting colors in print are different!

Does anybody know how to get consistent colors from LaTeX?

  • \usepackage[cmyk]{xcolor} does not solve the problem
  • colframe=white!85!black results in similar problems

I cannot give a minimal working example at the moment, as I don't know what exactly is producing this behaviour.

The two colors look very similar.

wrong color in tcolorbox

Additional information

I found out, that compiling the document on Fedora 30 results in the above problem, while compiling it on Debian Stretch yields correctly defined framegrey in CMYK.

I did check the tikz version as suggested in the comments, but both systems have version 3.0.1a installed (< version 3.1.3).

Here you find a list of all differences in the tex environment on both systems:

--- Fedora 30
+++ Debian Stretch
[...]
   xcolor.sty    2016/05/11 v2.12 LaTeX color extensions (UK)
    color.cfg    2016/01/02 v1.6 sample color configuration
-  pdftex.def    2018/01/08 v1.0l Graphics/color driver for pdftex
+  pdftex.def    2017/01/12 v0.06k Graphics/color for pdfTeX
+infwarerr.sty    2016/05/16 v1.4 Providing info/warning/error messages (HO)
+ ltxcmds.sty    2016/05/16 v1.23 LaTeX kernel commands for general use (HO)
[...]
-graphicx.sty    2017/06/01 v1.1a Enhanced LaTeX Graphics (DPC,SPQR)
+graphicx.sty    2014/10/28 v1.0g Enhanced LaTeX Graphics (DPC,SPQR)
-graphics.sty    2017/06/25 v1.2c Standard LaTeX Graphics (DPC,SPQR)
+graphics.sty    2016/10/09 v1.0u Standard LaTeX Graphics (DPC,SPQR)
[...]
-fancyhdr.sty    2017/06/30 v3.9a Extensive control of page headers and footers
-multicol.sty    2018/04/20 v1.8s multicolumn formatting (FMi)
+fancyhdr.sty    2016/09/06 3.8 Extensive control of page headers and footers
+multicol.sty    2016/04/07 v1.8p multicolumn formatting (FMi)
[...]
-inputenc.sty    2018/04/06 v1.3b Input encoding file
-microtype.sty    2018/01/14 v2.7a Micro-typographical refinements (RS)
-microtype-pdftex.def    2018/01/14 v2.7a Definitions specific to pdftex (RS)
-microtype.cfg    2018/01/14 v2.7a microtype main configuration file (RS)
-mathtools.sty    2018/01/08 v1.21 mathematical typesetting tools
-    calc.sty    2017/05/25 v4.3 Infix arithmetic (KKT,FJ)
- mhsetup.sty    2017/03/31 v1.3 programming setup (MH)
+inputenc.sty    2015/03/17 v1.2c Input encoding file
+    utf8.def    2017/01/28 v1.1t UTF-8 support for inputenc
+   t1enc.dfu    2017/01/28 v1.1t UTF-8 support for inputenc
+  ot1enc.dfu    2017/01/28 v1.1t UTF-8 support for inputenc
+  omsenc.dfu    2017/01/28 v1.1t UTF-8 support for inputenc
+microtype.sty    2016/05/14 v2.6a Micro-typographical refinements (RS)
+microtype-pdftex.def    2016/05/14 v2.6a Definitions specific to pdftex (RS)
+microtype.cfg    2016/05/14 v2.6a microtype main configuration file (RS)
+mathtools.sty    2015/11/12 v1.18 mathematical typesetting tools
+    calc.sty    2014/10/28 v4.3 Infix arithmetic (KKT,FJ)
+ mhsetup.sty    2010/01/21 v1.2a programming setup (MH)
[...]
-pgfplots.sty    2018/03/28 v1.16 Data Visualization (1.16)
+pgfplots.sty    2016/08/10 v1.14 Data Visualization (1.14)
     tikz.sty    2015/08/07 v3.0.1a (rcs-revision 1.151)
      pgf.sty    2015/08/07 v3.0.1a (rcs-revision 1.15)
   pgfrcs.sty    2015/08/07 v3.0.1a (rcs-revision 1.31)
[...]
-pdftexcmds.sty    2018/01/30 v0.27 Utility functions of pdfTeX for LuaTeX (HO)
-infwarerr.sty    2016/05/16 v1.4 Providing info/warning/error messages (HO)
- ltxcmds.sty    2016/05/16 v1.23 LaTeX kernel commands for general use (HO)
-   ifpdf.sty    2017/03/15 v3.2 Provides the ifpdf switch
+pdftexcmds.sty    2016/05/21 v0.22 Utility functions of pdfTeX for LuaTeX (HO)
+   ifpdf.sty    2016/05/14 v3.1 Provides the ifpdf switch
[...]
-pgfplotstable.sty    2018/03/28 v1.16 Table typesetting and Pretty-printing (1.
-16)
-   array.sty    2018/04/30 v2.4h Tabular extension package (FMi)
+pgfplotstable.sty    2016/08/10 v1.14 Table typesetting and Pretty-printing (1.
+14)
+   array.sty    2016/10/06 v2.4d Tabular extension package (FMi)
[...]
- caption.sty    2018/05/01 v3.3-147 Customizing captions (AR)
-caption3.sty    2018/05/27 v1.8a caption3 kernel (AR)
+ caption.sty    2016/02/21 v3.3-144 Customizing captions (AR)
+caption3.sty    2016/05/22 v1.7-166 caption3 kernel (AR)
[...]
-algorithm2e.sty    2017/07/18 v5.2 algorithms environments
-ifoddpage.sty    2016/04/23 v1.1 Conditionals for odd/even page detection
+algorithm2e.sty    2013/01/06 v5.00 algorithms environments
[...]
-tcolorbox.sty    2018/07/26 version 4.14 text color boxes
+tcolorbox.sty    2016/11/18 version 3.96 text color boxes
[...]
-etoolbox.sty    2018/02/11 v2.5e e-TeX tools for LaTeX (JAW)
-  xparse.sty    2018-05-12 L3 Experimental document command parser
-   expl3.sty    2018-06-14 L3 programming layer (loader) 
-expl3-code.tex    2018-06-14 L3 programming layer 
-l3pdfmode.def    2018-06-14 v L3 Experimental driver: PDF mode
+etoolbox.sty    2017/01/02 v2.4 e-TeX tools for LaTeX (JAW)
+  xparse.sty    2016/11/21 v6760 L3 Experimental document command parser
+   expl3.sty    2016/11/21 v6760 L3 programming layer (loader) 
+expl3-code.tex    2016/11/21 v6760 L3 programming layer 
+l3pdfmode.def    2016/08/18 v6679 L3 Experimental driver: PDF mode
[...]
- siunitx.sty    2018/05/17 v2.7s A comprehensive (SI) units package
-l3keys2e.sty    2018-05-12 LaTeX2e option processing using LaTeX3 keys
-translator.sty    2018/01/04 v1.12 Easy translation of strings in LaTeX
-hyperref.sty    2018/02/06 v6.86b Hypertext links for LaTeX
+ siunitx.sty    2017/01/01 v2.7a A comprehensive (SI) units package
+l3keys2e.sty    2016/11/21 v6760 LaTeX2e option processing using LaTeX3 keys
+translator.sty    2010/06/12 ver 1.10
+translator-language-mappings.tex
+hyperref.sty    2016/06/24 v6.83q Hypertext links for LaTeX
[...]
-  pd1enc.def    2018/02/06 v6.86b Hyperref: PDFDocEncoding definition (HO)
+  pd1enc.def    2016/06/24 v6.83q Hyperref: PDFDocEncoding definition (HO)
[...]
- hpdftex.def    2018/02/06 v6.86b Hyperref driver for pdfTeX
+ hpdftex.def    2016/06/24 v6.83q Hyperref driver for pdfTeX
[...]
-  ts1enc.dfu    2018/04/05 v1.2c UTF-8 support for inputenc
+  ts1enc.dfu    2017/01/28 v1.1t UTF-8 support for inputenc
[...]
-siunitx-abbreviations.cfg    2017/11/26 v2.7k siunitx: Abbreviated units
+siunitx-abbreviations.cfg    2017/01/01 v2.7a siunitx: Abbreviated units
  • 1
    Can you share some code, that exhibits this behaviour? – DG' Nov 16 '19 at 20:31
  • I am not at all an expert on color theory but colors seem to be completely specified by three coordinates, R, G and B for example. So if a color model uses four coordinates, then there must be degeneracies. –  Nov 16 '19 at 20:36
  • what happen if you use \definecolor{framegrey}{HTML}{D9D9D9}? – vi pa Nov 16 '19 at 22:14
  • 1
    @Schrödinger'scat cmyk uses four values (for c=cyan, m=magenta,y=yellow,k=black). – Ulrike Fischer Nov 16 '19 at 22:17
  • @UlrikeFischer I understand that. My statement is that if three components are sufficient to fix a position of something, and someone comes with fourdimensional description, there will be degeneracies. It does not mean that the 4d description is crap. –  Nov 16 '19 at 22:20
  • 3
    This looks like the problem described in this answer. – Sveinung Nov 16 '19 at 22:33
  • 1
    @UlrikeFischer from this site seem that there is degeneracy. cmyk=(0.02,0,0,0.07) is the same as cmyk=(0.09,0.07,0.07,0) – vi pa Nov 16 '19 at 23:21
  • 1
    @Sveinung is probably right, but we need a MWE to be sure. But the good news is that tikz now supports CMYK shadings if you are using at least version 3.1.3. If you are stuck with earlier versions, then pgf-cmykshadings will help you. See the other answer in the linked question. – David Purton Nov 17 '19 at 09:53
  • 1
    Make sure that you are setting the colour model to CMYK before you load tikz. You could put \RequirePackage[cmyk]{xcolor} before your \documentclass line to make sure of this. Although, if your document class doesn't load xcolor then it is enough to load it early on. – David Purton Nov 17 '19 at 10:56
  • And check that your version of tikz is new enough. – David Purton Nov 17 '19 at 10:57
  • @Schrödinger'scat RGB is an additive colour model, while CMYK is a subtractive model. They have different optimal uses, where RGB is better for digital and CMYK is better for print. Google it, it's quite interesting material :-) – Holene Nov 18 '19 at 06:22
  • @Holene My statement does not contradict this. It is only that there are degeneracies. It is a very simple statement.. All I am saying is that if you have a mapping from R^3 -> R^4, there will be degeneracies. Just Google linear algebra, you will love it. ;-) –  Nov 18 '19 at 14:29
  • @Schrödinger'scat That's the other way around. Continuous embeddings R³ → R⁴ certainly exist (in particular linear); there is no continuous embedding in the other direction. The problem is that no homeomorphism exists from R³ to R⁴. – egreg Nov 18 '19 at 15:50
  • @egreg Yes, thanks. But what I want to say is that the coordinates in CMYK cannot be unique. Why on earth one wants to use 3 coordinates, I do not understand either, isn't that just a simple wave length? –  Nov 18 '19 at 15:52
  • @Schrödinger'scat In theory, yes. But screens and printers are not able to produce every wave length. Screens use three different base color and approximate the wave length; printers use four parameters. The purpose of color profiles is to provide an “exact” (actually well approximated) conversion from RGB to CMYK, which depends on the printer; xcolor tries to do the conversion, but it cannot be “exact”, so it's better to stick to a single color model. – egreg Nov 18 '19 at 15:56
  • @egreg I agree with that statement. Nonetheless there must be two different CMYK values that yield the same color. This is all I wanted to say. –  Nov 18 '19 at 16:04
  • @Schrödinger'scat That's a mapping R⁴ → R³, so, yes. ;-) – egreg Nov 18 '19 at 16:47
  • @egreg This is all I am saying. –  Nov 18 '19 at 16:55

1 Answers1

1

This question can be divided in sub-questions:

  1. How do I create a document for professional printing?
  2. How do I eliminate the differences between compiling a document in Fedora30 and Debian Stretch?

As a preferred Windows user I can only directly answer #1: You should create a document that directly complies to one of the PDF/X standards. As long as you want one document for the archives/libraries and for print, this standard should be PDF/X-4 and the base colour model should be CMYK. (PFD/X-1 is paper-only, PDF/X-3 is the outdated version of PDF/X-4.) A minimal example of PDF/X you can find in this answer.

Minimal working examples (MWE) take a while to create but they are incredibly useful. Does the problem persist when you compile the MWE fom above augmented by colour? In MikTeX with normal coloured text I do not see this behaviour.

I see your packages are outdated. Update your distribution to the latest version.

You do not specify how in Acrobat you read the colour values. There is no colour picker in Acrobat. The correct way to check is with the Output Preview of the Print Production tool. Select the OutputIntent as your simulation profile and choose only Process Color. Is your text visible? If yes, it's OK. An alternative way is to set \pdfobjcompresslevel=0, \pdfcompresslevel=0 and edit the file in a text editor. You should find the values 0 0 0 .15 if the colours were correctly written to PDF.

tanGIS
  • 1,645
  • 15
  • 32