从旧的开始问题使用用户代码@伊格纳西,
\documentclass{article}
\usepackage[most]{tcolorbox}
\usepackage{pifont}
\newtcolorbox{mybox}[2][]{%
colback=teal!10,
coltitle=black,
colframe=teal!30,
fonttitle=\bfseries,
title=#2,
sharp corners,
rounded corners=southeast,
arc is angular,
arc=3mm,
boxrule=0pt,
enhanced,
overlay={\node[font=\Huge, text=cyan!70!black] at ([yshift=-4mm]interior.north west) {\ding{228}};},
underlay={
\path[fill=tcbcolback!80!black] ([yshift=3mm]interior.south east)--++(-0.4,-0.1)--++(0.1,-0.2);
\path[draw=tcbcolframe,shorten <=-0.05mm,shorten >=-0.05mm] ([yshift=3mm]interior.south east)--++(-0.4,-0.1)--++(0.1,-0.2);
},
drop fuzzy shadow,
#1
}
\usepackage{lipsum}
\begin{document}
\begin{mybox}{An example}
\lipsum[1]
\end{mybox}
\end{document}
是否可以在浅青色框架上创建白色(或其他特定颜色)的蜘蛛线?
答案1
可以添加任何图形(或文本)作为水印。但除非overlays
您使用hooks
库中的选项(请参阅https://tex.stackexchange.com/a/593025/1952)。
以下代码添加蜘蛛网作为水印图形,并且原始overlay
选项已转换为overlay app
并放置在水印定义之后。
\documentclass{article}
\usepackage[most, hooks]{tcolorbox}
\usepackage{pifont}
\newtcolorbox{mybox}[2][]{%
colback=teal!10,
coltitle=black,
colframe=teal!30,
fonttitle=\bfseries,
title=#2,
sharp corners,
rounded corners=southeast,
arc is angular,
arc=3mm,
boxrule=0pt,
enhanced,
underlay={
\path[fill=tcbcolback!80!black] ([yshift=3mm]interior.south east)--++(-0.4,-0.1)--++(0.1,-0.2);
\path[draw=tcbcolframe,shorten <=-0.05mm,shorten >=-0.05mm] ([yshift=3mm]interior.south east)--++(-0.4,-0.1)--++(0.1,-0.2);
},
watermark graphics={SpiderWeb.png},
watermark opacity=0.35,
watermark overzoom=1,
overlay app={\node[font=\Huge, text=cyan!70!black] at ([yshift=-4mm]interior.north west) {\ding{228}};},
drop fuzzy shadow,
#1
}
\usepackage{lipsum}
\begin{document}
\begin{mybox}{An example}
\lipsum[1]
\end{mybox}
\end{document}