我有一份包含书籍文档类的文档,我试图在同一页面上包含两个环绕图,每侧一个(理想情况下是在相邻的段落中,但此时我只是试图将它们放在页面上而不弄乱任何其他格式。)
我遇到的一个问题似乎类似于这个问题,在我使用 wrapfigure 的那一页之后的每一页上,我的所有文本都被推到右侧,就像在一列中一样。我尝试了那里给出的解决方案,但无法让它为我工作。
另一个问题是我似乎无法让两个图形正确换行;好像它们以某种方式互相干扰,但无论我更改什么设置,都无法使它们正确换行。
text text text
\begin{wrapfigure}[9]{r}{0.4\textwidth}
\vspace{-20pt}
\begin{center}
\includegraphics[width=0.38\textwidth]{images/hausdorffShapes}
\end{center}
\vspace{-20pt}
\caption{An example showing $\vec{d}_H(B, A)$ and $\vec{d}_H(B, A)$}
\label{hausdorffShapes}
\vspace{10pt}
\end{wrapfigure}
text text text
\begin{wrapfigure}[7]{l}{0.4\textwidth}
\vspace{-20pt}
\begin{center}
\includegraphics[width=0.38\textwidth]{images/hausdorffBadExample}
\end{center}
\vspace{-20pt}
\caption{An example where the Hausdorff distance fails}
\label{hausdorffBadExample}
\vspace{-10pt}
\end{wrapfigure}
text text text
如果我尝试不同的行高、垂直空间或宽度等,或者尝试移动 wrapfigure 命令的位置,就会出现各种其他定位问题。我发现没有一种组合有效。
此外,在下一页中,所有文本都被挤压到右侧,就像在一列中一样。
如能得到任何帮助都将不胜感激,如果我应该上传 ps 或 pdf 的副本或者发布更多的乳胶代码,请告诉我。
编辑:事实证明,其余文本仅被强制放入该部分其余部分的一列中,而不是论文的其余部分。
答案1
它应该可以正常工作,如果不行,请编辑您的问题,以使用完整的文档(例如下面的文档)显示问题。我使用了您问题中的 wrapfig 示例(但删除了一些负间距)。
\documentclass{article}
\usepackage[demo]{graphicx}
\usepackage{wrapfig}
\def\a{One two three four five six. }
\def\b{\a\a Red green blue yellow white black. }
\def\c{\b\b\a\b\b\b\a\b\b}
\begin{document}
\begin{wrapfigure}{r}{0.4\textwidth}
\centering
\includegraphics[width=0.38\textwidth]{images/hausdorffShapes}
\caption{An example showing $\vec{d}_H(B, A)$ and $\vec{d}_H(B, A)$}
\label{hausdorffShapes}
\end{wrapfigure}
\c
\begin{wrapfigure}{l}{0.4\textwidth}
\centering
\includegraphics[width=0.38\textwidth]{images/hausdorffBadExample}
\caption{An example where the Hausdorff distance fails}
\label{hausdorffBadExample}
\end{wrapfigure}
\b\b\c
\end{document}
来自链接的文档
另一个问题是,您在段落中没有足够的文本来包裹第一张图片,通常 wrapfig 会从下一段中获取文本,但您那里有另一个图。限制第一张图片所占用的行数,然后添加一些空间,就可以解决问题,如上图所示。
which is in fact a metric, given that $M$ is also compact.
\begin{wrapfigure}[5]{r}{0.4\textwidth}
\centering
\includegraphics[width=0.38\textwidth]{images/hausdorffShapes}
\caption{An example showing $\vec{d}_H(B, A)$ and $\vec{d}_H(B, A)$}
\label{hausdorffShapes}
\vspace{10pt}
\end{wrapfigure}
We now have a basic way to talk about the distance between sets of points. Figure \ref{hausdorffShapes} shows the two directed distances between $A$ and $B$, considered as sets of points. The undirected distance is, then, the larger of the two.
\vspace{2\baselineskip}
\begin{wrapfigure}{l}{0.4\textwidth}
\centering
\includegraphics[width=0.38\textwidth]{images/hausdorffBadExample}
\caption{An example where the Hausdorff distance fails}
\label{hausdorffBadExample}
\end{wrapfigure}
Before we get too excited, however, let us consider a case where the Hausdorff distance gives undesirable results. Figure \ref{hausdorffBadExample} shows two polygonal curves. Note that they have a very small Hausdorff distance, because for every point in $A$ there is a point in $B$ that is very close. If we think about them as curves, however, they seem about as dissimilar as could be! The Hausdorff distance is clearly inadequate for use in comparing the similarity of curves.