0

I'm using tcolorbox to tackle a knockout text issue inside a colour box. When I deselect the black color in "Separation" option in the PDF Output Preview, a box backdrop with white text is printed.

enter image description here

MWE:

\documentclass{book}

\RequirePackage[many]{tcolorbox}

\definecolor{lightblue}{cmyk}{0.25,0.08,0.01,0.05} \definecolor{darktabblue}{cmyk}{1.0,0.9,0.1,0.0}

\newtcolorbox{tablebox}[1]{% %breakable, arc=0pt,outer arc=0pt,boxrule=0.0pt,boxsep=0pt,top=0pt,left=6pt,right=6pt,bottom=6pt,middle=0pt, toptitle=5.5pt,bottomtitle=14.4pt, colback=lightblue!150, colbacktitle=darktabblue,%bottomrule=0pt,toprule=0pt,rightrule=0pt,leftrule=0pt, colframe=black, coltitle=white,lefttitle=6pt,righttitle=6pt, titlerule=0pt,left skip=0pt,right skip=-13pt,%titlerule style={tenprcntblack,line width=0pt}, title=#1, before app={\par\addvspace{0pt}\noindent}, after app={\par\addvspace{0pt}} }%

\begin{document}

\begin{tablebox}{Title}{ The distribution of data is really a theoretical concept that is usually an assumption underlying any statistical test. In informal terms, the distribution is the probability that particular values of data are likely to turn up. To make this more concrete, let's start with one of the simplest types of data, Likert item data, where people respond with numbers between 1 (strongly disagree) and 5 (strongly agree).} \end{tablebox}

\end{document}

Ingmar
  • 6,690
  • 5
  • 26
  • 47
  • 1
    The default black is not a true black. If you want true black, you need to define it as \definecolor{trueblack}{cmyk}{1,1,1,1} and then set the text color accordingly. – Jasper Habicht Aug 01 '23 at 07:29
  • 1
    you can try \usepackage[overprint]{colorspace}. Or with the pdfmanagement you can do it similar to this https://tex.stackexchange.com/a/681368/2388. You then need probably << /op~true /OP~true /OPM~1 >> in the dictionary. – Ulrike Fischer Aug 01 '23 at 08:16
  • @JasperHabicht I tried your suggestion but it doesn't work for me – Rajesh Kumar Aug 01 '23 at 12:11
  • @UlrikeFischer, thanks for your suggestion. Even after include \usepackage[overprint]{colorspace}, this problem not sort out. Is there any other to fix this issue? – Rajesh Kumar Aug 01 '23 at 12:41

1 Answers1

5

With the pdfmanagement (that you load with \DocumentMetadata) you can do something like this:

\DocumentMetadata{}
\documentclass{book}

\ExplSyntaxOn \pdfmanagement_add:nnn { Page / Resources / ExtGState } { text.overprinttrue } { << /op~true /OP~true /OPM~1 >> } \pdfmanagement_add:nnn { Page / Resources / ExtGState } { text.overprintfalse } { << /op~false /OP~false >> } \ExplSyntaxOff

\usepackage{iftex} \ifpdftex \newcommand \enableoverprint {% \pdfliteral page {/text.overprinttrue gs}% } \newcommand \disableoverprint {% \pdfliteral page {/text.overprintfalse gs}% } \else \RequireLuaTeX \newcommand \enableoverprint {% \pdfextension literal page {/text.overprinttrue gs}% } \newcommand \disableoverprint {% \pdfextension literal page {/text.overprintfalse gs}% } \fi

\RequirePackage[many]{tcolorbox} \selectcolormodel{cmyk}

\definecolor{lightblue}{cmyk}{0.25,0.08,0.01,0.05} \definecolor{darktabblue}{cmyk}{1.0,0.9,0.1,0.0}

\newtcolorbox{tablebox}[1]{% %breakable, arc=0pt,outer arc=0pt,boxrule=0.0pt,boxsep=0pt,top=0pt,left=6pt,right=6pt,bottom=6pt,middle=0pt, toptitle=5.5pt,bottomtitle=14.4pt, colback=lightblue!150, colbacktitle=darktabblue,%bottomrule=0pt,toprule=0pt,rightrule=0pt,leftrule=0pt, colframe=black, coltitle=white,lefttitle=6pt,righttitle=6pt, titlerule=0pt,left skip=0pt,right skip=-13pt,%titlerule style={tenprcntblack,line width=0pt}, title=#1, before app={\par\addvspace{0pt}\noindent}, after app={\par\addvspace{0pt}} }%

\begin{document}

\begin{tablebox}{Title}{ \enableoverprint The distribution of data is really a theoretical concept that is usually an assumption underlying any statistical test. In informal terms, the distribution is the probability that particular values of data are likely to turn up. To make this more concrete, let's start with one of the simplest types of data, Likert item data, where people respond with numbers between 1 (strongly disagree) and 5 (strongly agree).} \disableoverprint \end{tablebox}

\begin{tablebox}{Title}{ The distribution of data is really a theoretical concept that is usually an assumption underlying any statistical test. In informal terms, the distribution is the probability that particular values of data are likely to turn up. To make this more concrete, let's start with one of the simplest types of data, Likert item data, where people respond with numbers between 1 (strongly disagree) and 5 (strongly agree).} \end{tablebox}

\end{document}

enter image description here

Ulrike Fischer
  • 327,261