如何在我的 tex 文件中使用 tikz 和 tcolorbox 包消除叠印问题?请查看我的 MWE 文件如下:
\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}
答案1
更新
这是 XeLaTeX 的一个非常简单的套印实现。它与.loads配合使用(实际上需要 .loads),pgf
所以这没有问题。tcolorbox
pgf
\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 >>}
\pgf@sys@addpdfresource@extgs@plain{/SPCko @spcko /SPCop @spcop}
\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}
原始答案
我认为您想在彩色屏幕上套印黑色文本。您可以使用该colorspace
软件包执行此操作。
平均能量损失
\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}
复合输出
青色板
洋红板
黄色盘子
黑色盘子
答案2
您应该使用 cmyk 选项加载 xcolor,以便默认颜色为 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}