答案1
以下是tornpage
cmhughes 在其回答中最初定义的环境的改编版本撕页效果。
与原始环境相比,我在左上角添加了小标题框。我还稍微改变了颜色,限制了框的宽度并删除了阴影:
\documentclass{article}
\usepackage[many]{tcolorbox}
\usetikzlibrary{decorations.pathmorphing}
\usetikzlibrary{shadows}
\definecolor{paper}{RGB}{254,246,101}
\usepackage{lipsum}
\newtcolorbox{tornpage}[1]{%
enhanced jigsaw, % allow page breaks
frame hidden, % hide the default frame
overlay={%
\draw [
fill=paper!75!white, % fill paper
draw=red, % boundary colour
decorate, % decoration
decoration={random steps,segment length=2pt,amplitude=1pt},
% drop shadow, % shadow
]
% top line
(frame.north west)--(frame.north east)--
% right line
(frame.north east)--(frame.south east)--
% bottom line
(frame.south east)--(frame.south west)--
% left line
(frame.south west)--(frame.north west);
},
finish={%
\node[%
draw=red,
rounded corners,
fill=paper,
anchor=west,
xshift=0.25cm,
yshift=2pt,
minimum width=2cm] at (frame.north west) {#1};},
% paragraph skips obeyed within tcolorbox
parbox=false,
text width=5cm,
}
\begin{document}
\begin{tornpage}{my title}
\lipsum[1][1-3]
\end{tornpage}
\lipsum[1]
\end{document}