答案1
我刚刚快速搜索了 tcolorboxes,发现这是 cfr 的,用一些图形替换标题文本,它立即起作用了。当然,你可以删除阴影,但我相信阴影对于这个功能来说并不重要。通常,在其中进行谷歌图片搜索是一个好主意site:tex.stackexchange.com
,通常你几乎可以立即找到问题的答案。
\documentclass[12pt]{article}
\usepackage[papersize={5.5in,8.5in},margin=1.5cm]{geometry}
\usepackage[many]{tcolorbox}
\usetikzlibrary{calc,shadows.blur}
\tcbuselibrary{skins}
\newtcolorbox{resp}[1][]{%
enhanced jigsaw,
colback=gray!20!white,%
colframe=gray!80!black,
size=small,
boxrule=1pt,
title={\includegraphics[width=2.5cm]{example-image-duck}},
halign title=flush center,
coltitle=black,
breakable,
drop shadow=black!50!white,
attach boxed title to top left={xshift=1cm,yshift=-\tcboxedtitleheight/2,yshifttext=-\tcboxedtitleheight/2},
minipage boxed title=3cm,
boxed title style={%
colback=white,
size=fbox,
boxrule=1pt,
boxsep=2pt,
underlay={%
\coordinate (dotA) at ($(interior.west) + (-0.5pt,0)$);
\coordinate (dotB) at ($(interior.east) + (0.5pt,0)$);
\begin{scope}
\clip (interior.north west) rectangle ([xshift=3ex]interior.east);
\filldraw [white, blur shadow={shadow opacity=60, shadow yshift=-.75ex}, rounded corners=2pt] (interior.north west) rectangle (interior.south east);
\end{scope}
\begin{scope}[gray!80!black]
\fill (dotA) circle (2pt);
\fill (dotB) circle (2pt);
\end{scope}
},
},
#1,
}
\begin{document}
\begin{resp}
A cfr--made box with a shadow and some graphics as title.
\end{resp}
\end{document}