答案1
根据 marmot 提供的盒子样式如何制作这个左侧带有图像的矩形?,这里有一个框,左边有一个小图标,update
右边有一个可选标签。由于我不知道这些框应该如何与文本对齐,我提供了两个选项:
\documentclass{article}
\usepackage[most]{tcolorbox}
\usepackage{lipsum}
\tcbset{%
update/.style={%
overlay app={%
\begin{tcbcliptitle}
\node[fill=green, font=\sffamily\bfseries, text=white, anchor=north east] at (frame.north east) {UPDATED};
\end{tcbcliptitle}
}
}
}
\newtcolorbox{imagebox}[3][]{
enhanced,
% show bounding box,
coltitle=black,
title filled=false,
colback=gray!20,
colbacktitle=gray!20,
boxrule=0.4pt,
top=2mm,
bottom=2mm,
toptitle=2mm,
left=12mm,
right=1mm,
drop fuzzy midday shadow,
titlerule=-0.1pt,
fonttitle=\sffamily\bfseries\large,
fontupper=\sffamily,
title={#2},
overlay={
\begin{scope}
\clip[rounded corners=1mm] ([shift={(-1cm,-.3cm)}]frame.north west) rectangle coordinate (center) ++(2cm,-2cm);
\node at (center) {\includegraphics[ width=2cm, height=2cm]{#3}};
\end{scope}
},
#1
}
\begin{document}
\lipsum[1]
\begin{imagebox}{some title}{example-image-duck}
\lipsum[2]
\end{imagebox}
\begin{imagebox}[enlarge left by=1cm, width=\linewidth-1cm, update]{some title}{example-image-duck}
\lipsum[2]
\end{imagebox}
\end{document}