पाठ-चित्र tcolorbox में लपेटें

Sep 10 2020

मैं एक कस्टम tcolorbox बनाना चाहता हूँ जिसमें ऊपरी बाएँ कोने में एक आइकन है। सादगी के लिए मैं कुछ tikzpicture का उपयोग करने के लिए मैं क्या मतलब है वर्णन करने के लिए होगा। लेकिन tcolorbox मेनुअल को पढ़ने से मुझे बॉक्स में फिगर लपेटने का कोई तरीका नहीं मिल रहा है। बॉक्स में फिगर को फिट करने का एकमात्र तरीका पूरे बॉक्स कंटेंट को "लेफ्टुपर = [लंबाई]" के माध्यम से इंडेंट करना है।

\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}

जवाब

3 Ignasi Sep 10 2020 at 16:56

कुछ इस तरह?

\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}