将图形包裹在浮动框内

将图形包裹在浮动框内

在我正在编写的教科书中,有一些带有文本的浮动框(我使用 tcolorbox 来定义它们)。我需要在其中一些框中放置一张小图片,并在它们周围环绕文本。

为了环绕图形,我使用了包wrapfig,但显然它不允许在浮点数内环绕。有什么解决方案可以建议吗?

答案1

您没有提供任何有关您尝试过什么或收到什么错误消息的信息,所以我只能注意到wrapfigure在浮点数中它可以正常工作。

在此处输入图片描述

\documentclass{article}

\usepackage{wrapfig,graphicx}
\begin{document}


\begin{figure}[pth]

  \begin{wrapfigure}{r}{2cm}
    \includegraphics[width=1.5cm]{example-image}
  \end{wrapfigure}
one two three four one two three four one two three four 
one two three four one two three four one two three four 
one two three four one two three four one two three four 
one two three four one two three four one two three four 
one two three four one two three four one two three four 
one two three four one two three four one two three four 
one two three four one two three four one two three four 
one two three four one two three four one two three four 
one two three four one two three four one two three four 
  \caption{zzzz}
\end{figure}
\end{document}

相关内容