我正在使用tcolorbox
来解决颜色框内的挖空文本问题。当我取消选择“分离PDF 中的“选项输出预览,打印有白色文字的盒子背景。
梅威瑟:
\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}
答案1
使用 pdfmanagement(您加载的\DocumentMetadata
)您可以执行以下操作:
\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}