
왼쪽 상단에 아이콘이 있는 사용자 정의 tcolorbox를 만들고 싶습니다. 단순화를 위해 내가 의미하는 바를 설명하기 위해 몇 가지 tikzpicture를 사용하겠습니다. 그러나 tcolorbox 매뉴얼을 읽어보면 상자 안의 텍스트가 그림을 감싸도록 만드는 방법을 찾을 수 없습니다. 그림을 상자에 맞추는 유일한 방법은 "leftupper=[length]"를 통해 전체 상자 내용을 들여쓰는 것입니다.
\documentclass[12pt]{article}
\usepackage{tikz}
\usepackage[most]{tcolorbox}
\tcbuselibrary{skins}
%%% My custom box
\newtcolorbox{mybox}{%
breakable,
fonttitle=\bfseries,
colback=red!5!white,
enhanced jigsaw,
colframe=red!50!black,
colbacktitle=red!50!black,
colframe=red!50!black,
opacityback=0.35,
leftupper=16mm,
title=test}
%%% The command for the image
\newcommand{\test}{\begin{tikzpicture}
\path[use as bounding box] (-.1,1.6) rectangle +(0.3,.3);
\draw[fill=black] (0,0) circle (.5cm);
\end{tikzpicture}}
\begin{document}
\test
\begin{mybox}This is some random text. This is some random text. This is some random text. This is some random text. This is some random text. This is some random text. This is some random text. This is some random text. This is some random text. This is some random text. This is some random text. This is some random text. This is some random text. This is some random text. This is some random text. This is some random text.
\end{mybox}
\end{document}
답변1
이 같은?
\documentclass{article}
\usepackage[margin=1in]{geometry}
\usepackage{wrapfig}
\usepackage[most]{tcolorbox}
\usepackage{lipsum}
\begin{document}
\begin{tcolorbox}
\begin{wrapfigure}[11]{L}{5cm}
\includegraphics[width=\linewidth]{example-image}
\end{wrapfigure}%
\lipsum[1-2]
\end{tcolorbox}
\end{document}