答案1
您可以尝试使用tcboxedraster
仅包含一个的tcolorbox
。展开的框包含图案,内框覆盖部分图案,模仿倾斜的破折号。
模式定义取自使用带有阴影的 tikz 形状内的图案
\documentclass{article}
\usepackage[most]{tcolorbox}
\usepackage{lipsum}
\usetikzlibrary{patterns}
\makeatletter
\tikzset{% customization of pattern
% based on <m.wibrow@gm...> - 2013-03-24 07:20:
hatch distance/.store in=\hatchdistance,
hatch distance=5pt,
hatch thickness/.store in=\hatchthickness,
hatch thickness=5pt
}
\pgfdeclarepatternformonly[\hatchdistance,\hatchthickness]{north east hatch}% name
{\pgfqpoint{-1pt}{-1pt}}% below left
{\pgfqpoint{\hatchdistance}{\hatchdistance}}% above right
{\pgfpoint{\hatchdistance-1pt}{\hatchdistance-1pt}}%
{
\pgfsetcolor{\tikz@pattern@color}
\pgfsetlinewidth{\hatchthickness}
\pgfpathmoveto{\pgfqpoint{0pt}{0pt}}
\pgfpathlineto{\pgfqpoint{\hatchdistance}{\hatchdistance}}
\pgfusepath{stroke}
}
\makeatother
\tikzset{
Pattern/.style={
pattern=north east hatch,
pattern color=black,
hatch distance=15pt,
hatch thickness=5pt
}
}
\begin{document}
\begin{tcboxedraster}[%
raster columns=1,
colframe=black,
colback=white,
]{
enhanced,
colframe=black,
colback=white,
underlay={%
\begin{tcbclipinterior}
\fill[Pattern] (frame.north west) rectangle (frame.south east);
\end{tcbclipinterior}
}
}
\begin{tcolorbox}
\lipsum[1]
\end{tcolorbox}
\end{tcboxedraster}
\end{document}