# Tikz, tcolorbox overprint issue

How to rid of overprint issues using tikz and tcolorbox packages in my tex files? Please find my MWE file is as below:

\documentclass{book}
%\usepackage{color}
\usepackage[most]{tcolorbox}
\usepackage{%color, % automatically loaded by overprint
overprint}

\newtcolorbox{casestudy}{enhanced,boxrule=0pt,boxsep=0pt,colframe=red,colback=yellow,
sharp corners, arc=5pt, rounded corners=southwest,left=9pt,right=0pt,top=5.5pt,bottom=3.8pt,
toptitle=0pt,bottomtitle=0pt,lefttitle={0pt},toprule=0pt,bottomrule=0pt,leftrule=0pt,rightrule=0pt,
width=420.56pt,after skip=0pt,before skip=0pt,
titlerule=0pt,titlerule style={green,line width=0pt},frame hidden,
}

\definecolor{mg}{cmyk}{0,1,0,0}
\definecolor{cn}{cmyk}{1,0,0,0}
\definecolor{bk}{cmyk}{0,0,0,1}

\begin{document}
\colorbox{mg}{bk test-1}

\colorbox{mg}{bk test-2}

\colorbox{cn}{text}

\colorbox{mg}{text}%

\colorbox{cn}{text}

\bigskip

\begin{casestudy}
Throughout the unit, students will apply the design and development
stages of the problem-solving methodology. They will acquire and apply
the knowledge and skills to work with different data types to create
solutions that can be used to persuade, educate, inform and entertain.
This unit also examines the role of networked information systems
in the communication of data within a global environment and an
exploration of mobile devices.
\end{casestudy}

\end{document}


• package overprinet, for what you need it? it is not available on CTAN. what is your problem, what you like to obtain? Jul 15 '19 at 10:22
• I tried below link and copied style file from following site to rid of overprint issues? tex.aanhet.net/overprint Jul 15 '19 at 10:32
• What is your problem? What would you expect to happen instead? Jul 15 '19 at 10:36
• This is printer issues, files will not moved with overprint issues, in Acrobat professional PDF when we turnoff black color, white should not appear in the PDF. Jul 15 '19 at 10:42

# Update

Here's a very simple overprint implementation for XeLaTeX. It works with (and in fact requires) pgf. tcolorbox loads pgf so this is no problem.

\documentclass{book}
\usepackage[cmyk]{xcolor}
\usepackage{tcolorbox}
\newtcolorbox{casestudy}{%
sharp corners, colback=yellow, left=0pt, right=0pt, top=0pt, bottom=0pt,
before skip=0pt, after skip=0pt, frame empty}

% Simple overprint implementation for XeLaTeX. Does not respect the colour
% stack, so you have to explicitly turn it on and off.
\makeatletter
\special{pdf:obj @spcko << /Type /ExtGState /op false /OP false >>}
\special{pdf:obj @spcop  << /Type /ExtGState /op true /OP true /OPM 1 >>}
\def\overprinton{\special{pdf:literal direct /SPCop gs}}
\def\overprintoff{\special{pdf:literal direct /SPCko gs}}
\makeatother

\begin{document}
\textcolor{cyan}{Cyan}
\textcolor{magenta}{Magenta}
\textcolor{yellow}{Yellow}
\textcolor{black}{Black}

\colorbox{magenta}{\overprinton text\overprintoff}

\colorbox{cyan}{\overprinton text\overprintoff}

\begin{casestudy}
\overprinton
Throughout the unit, students will apply the design and development stages
of the problem-solving methodology. They will acquire and apply the
knowledge and skills to work with different data types to create solutions
that can be used to persuade, educate, inform and entertain. This unit also
examines the role of networked information systems in the communication of
data within a global environment and an exploration of mobile devices.
\overprintoff
\end{casestudy}
\end{document}


I take it you want to overprint the black text on the coloured screens. You can do this using the colorspace package.

## MWE

\documentclass{book}
\usepackage[cmyk]{xcolor}
\usepackage[overprint]{colorspace}
\usepackage{tcolorbox}
\newtcolorbox{casestudy}{%
sharp corners, colback=yellow, left=0pt, right=0pt, top=0pt, bottom=0pt,
before skip=0pt, after skip=0pt, frame empty}
\begin{document}
\textcolor{cyan}{Cyan}
\textcolor{magenta}{Magenta}
\textcolor{yellow}{Yellow}
\textcolor{black}{Black}

\colorbox{magenta}{\textoverprint{text}}

\colorbox{cyan}{\textoverprint{text}}

\begin{casestudy}
\overprintstate{1}%
Throughout the unit, students will apply the design and development stages
of the problem-solving methodology. They will acquire and apply the
knowledge and skills to work with different data types to create solutions
that can be used to persuade, educate, inform and entertain. This unit also
examines the role of networked information systems in the communication of
data within a global environment and an exploration of mobile devices.
\end{casestudy}
\end{document}


### Black plate

• following errors shown while compiling above document. (./colorspace.sty Package: colorspace 2019/03/25 v1.3 PDF color spaces ! Undefined control sequence. l.561 \immediate\spc@Obj {<< /Type /ExtGState /op false /OP false >>}% Jul 15 '19 at 12:07
• @DavidPurton I get no error. Jul 15 '19 at 12:16
• @RajeshN, if it works for Ulrike, then check to make sure your TeX distribution is up to date. colorspace 1.3 is the latest version. Jul 15 '19 at 12:17
• In PDFLaTeX, tcolorbox output hidden. we using XeLaTeX which shows an undefined control sequence as shown above error. Jul 15 '19 at 12:29
• You could probably with xelatex do \AtBeginShipout{\AtBeginShipoutAddToBox{\special{pdf:code /SPCop gs}}} to activate it on all pages. Jul 15 '19 at 14:05

You should load xcolor with the cmyk option so that the default color color is cmyk:

\documentclass{book}
\usepackage[cmyk]{xcolor}
\usepackage[overprint]{colorspace}
\usepackage[most]{tcolorbox}

\newtcolorbox{casestudy}{enhanced,boxrule=0pt,boxsep=0pt,colframe=red,colback=yellow,
sharp corners, arc=5pt, rounded corners=southwest,left=9pt,right=0pt,top=5.5pt,bottom=3.8pt,
toptitle=0pt,bottomtitle=0pt,lefttitle={0pt},toprule=0pt,bottomrule=0pt,leftrule=0pt,rightrule=0pt,
width=420.56pt,after skip=0pt,before skip=0pt,
titlerule=0pt,titlerule style={green,line width=0pt},frame hidden,
}

\definecolor{mg}{cmyk}{0,1,0,0}
\definecolor{cn}{cmyk}{1,0,0,0}
\definecolor{bk}{cmyk}{0,0,0,1}

\begin{document}

\colorbox{mg}{bk test-2}

\colorbox{mg}{bk test-2}

\begin{casestudy}
Throughout the unit, students will apply the design and development
stages of the problem-solving methodology. They will acquire and apply
the knowledge and skills to work with different data types to create
solutions that can be used to persuade, educate, inform and entertain.
This unit also examines the role of networked information systems
in the communication of data within a global environment and an
exploration of mobile devices.
\end{casestudy}

\end{document}


• Please advise that is the \usepackage[overprint]{colorspace} works in all types of TeX, i.e., LaTeX -> dvips -> ps2pdf, PDFLaTeX, XeLaTeX, etc.? Jul 15 '19 at 12:23
• @MadyYuvi colorspace works only for pdflatex and lualatex. It uses colorstacks and I don't know if it is possible to extend it to xelatex. dvips could work with \special{ps:true setoverprint} (untested). Jul 15 '19 at 12:28
• Thanks a lot Ulrike.... Jul 15 '19 at 13:01