创建一个带有包装的盒子?(图片)

创建一个带有包装的盒子?(图片)

你好,我想制作这种类型的盒子,但我不知道该怎么做,有人有解决方案吗? 在此处输入图片描述

在此处输入图片描述

答案1

对我来说,它看起来像使用装饰库中的一些具有适当线宽和段长度的路径变形tikz

\documentclass{report}
\usepackage[dvipsnames]{xcolor}
\usepackage[skins]{tcolorbox}
\usetikzlibrary{decorations.pathmorphing}
\usepackage{fontawesome5}
\begin{document}
\begin{tcolorbox}[
enhanced,
frame empty,
title=Example,
sharp corners,
colback=yellow!30,
fonttitle=\sffamily\bfseries,
boxrule=0pt,
detach title,
before upper={\tcbtitle\\[1ex]},
coltitle=black,
fontupper=\sffamily,
overlay={
\path[draw=YellowOrange,decorate,line width=2mm,
decoration={coil,aspect=0,segment length=3mm}]
(frame.north west) -- (frame.south west);}
]
This is an \textbf{Example}.
\end{tcolorbox}

\begin{tcolorbox}[
enhanced,
frame empty,
title=\faExclamationTriangle\space Attention,
sharp corners,
colback=red!10,
fonttitle=\sffamily\bfseries,
boxrule=0pt,
detach title,
before upper={\tcbtitle\\[1ex]},
coltitle=black,
fontupper=\sffamily,
overlay={
\path[draw=red!30,decorate,line width=2mm,
decoration={saw,segment length=2.75mm}]
(frame.north west) -- (frame.south west);}
]
This is an \textbf{Attention}.

{\vspace{2ex}\centering\fboxsep=4pt\fbox{\parbox{1.65cm}{$\displaystyle
\sum_{i\in\oslash}\mathrm{a}_i=0.$}}\par}
\end{tcolorbox}
\end{document}

在此处输入图片描述

相关内容