在定理环境中包裹图形

在定理环境中包裹图形

我想将图形环绕在定理环境周围,但当我使用 wrapfig 或 \parpic 环境时,文本会与图形重叠。纯文本会自动环绕 \parpic 图形,但 itemize/enumerate 环境则不会。因此我想出了一个解决方法:

\documentclass[a4paper,11pt]{article}
\usepackage{graphicx,picins}%+any other needed packages..
\newcommand{\items}{\hspace{1.25em} \textbullet \hspace{0.55em}} %tried to replicate the alignment of the itemize environment.

\begin{document}
\parpic[r]{
\includegraphics[width=0.3\textwidth]{image.jpg}
}
\items this long text would have overlapped the picture if it would have been an 'itemize' environment
\items and so on..
\end{document}

这可行,但现在我想在项目符号后缩进每个新行,以便它正好位于上一行的下方(如 itemize 环境)。sth like\items{long text}

答案1

您可以使用该mdwlist包来执行此操作。

它看起来是这样的

\documentclass{article}

\usepackage[a6paper]{geometry} % for the sake of presentation

\usepackage{graphicx}
\usepackage{picins}
\usepackage{mdwlist}

\begin{document}

\noindent
Once upon a time, there was an image... and an enumeration...

\begin{enumerate}
\parpic[r]{\includegraphics[width=3cm]{image.jpg}}
\item it had line after line but didn't touch the image...
\item it had line after line but didn't touch the image...
\item it had line after line but didn't touch the image...
\item it had line after line but didn't touch the image...
\suspend{enumerate}
\resume{enumerate}
\item ...and filled the remaining space
\end{enumerate}

\newpage
\noindent
It could have been reset before the third line, like this:

\begin{enumerate}
\parpic[r]{\includegraphics[width=3cm]{image.jpg}}
\item it had line after line but didn't touch the image...
\item it had line after line but didn't touch the image...
\suspend{enumerate}
\resume{enumerate}
\item it had line after line but didn't touch the image...
\item it had line after line but didn't touch the image...
\item ...and filled the remaining space
\end{enumerate}

\noindent
But it wasn't.

\noindent
The End!

\end{document}

更新:您可能还想考虑使用双列环境(paracol例如),或者minipages。

相关内容