Wrapfigure:跳过一些行

Wrapfigure:跳过一些行

我在最后一段的页面底部有一个环绕图,它拒绝了一个美观的位置。

x -> 文本,# -> wrapfigure:

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ##################################
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ##################################
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ######### some equation ##########
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ##################################
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ##################################
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

因为公式比较小,所以我不需要那么多空白。我希望文本浮动在公式下方在环绕图上方,就像这样(整个段落长 14 行,因此有足够的空间):

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx    
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ##################################
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ######### some equation ##########
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ##################################
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

换行图(在代码中)位于段落上方,每当我将其在段落中向下移动时(即使在第一个句子的中间),它也会立即移动到下一页。

代码如下:

\begin{wrapfigure}[8]{R}{0.5\textwidth}
    \begin{small}
        \begin{gather}
            I_{in} =
            \begin{bmatrix}
                46 & 42 & 50 \\
                44 & 65 & 56 \\
                41 & 52 & 58 \\
            \end{bmatrix}
            \\
            I_{out}(2,2) = 131
        \end{gather}
    \end{small}
\end{wrapfigure}
% paragraph...

答案1

plaintex你可以用包来实现你想要的功能insbox。它定义了\InsertBoxL\InsertBoxR命令,带有两个参数:插入框之前未触及的行数和框的内容。还有一个可选参数:如果框的高度计算不正确,则补充换行的行数。

\documentclass[12pt]{article}

\usepackage{mathtools}
\input{insbox.tex}
\usepackage{lipsum}

\begin{document}
\InsertBoxR{3}{%
\parbox{0.5\linewidth-4mm}{\small
    \begin{gather}
        I_\text{in} =
        \begin{bmatrix}
            46 & 42 & 50 \\
            44 & 65 & 56 \\
            41 & 52 & 58 \\
        \end{bmatrix}
        \\[0.5ex]
        I_\text{out}(2,2) = 131
    \end{gather}}}[2]%
Some text. Some more text. Some more text. Some more text. Some more text. Some more text. Some more text. Some more text. Some more text. Some more text. Some more text. Some more text. Some more text. Some more text. Some more text. Some more text.Some more text. Some more text. Some more text. Some more text. Some more text. Some more text. Some more text. Some more text. Some more text. Some more text. Some more text. Some more text. Some more text. Some more text. Some more text. Some more text.Some more text. Some more text. Some more text. Some more text. Some more text. Some more text. Some more text. Some more text.

    \end{document} 

在此处输入图片描述

答案2

您可以使用 实现此效果wrapfig.sty。在其文档中,您可以找到:

放置和浮动
参数 #2(必需)是图形放置代码,但有效代码与常规图形不同。它们成对出现:大写版本允许图形浮动,小写版本将图形“精确地放在此处”。[...] 在
段落之间开始环境很方便,但如果您希望放置在段落中间,则必须将环境放在两个单词之间,其中有自然换行符。

替换Rr,并在段落中找到一个自然的换行符作为开头\begin{wrapfigure}。例如:

\documentclass{article}
\usepackage{lmodern,wrapfig,amsmath}
\begin{document}

Wrapfig.sty provides the environments wrapfigure and wraptable for
typesetting a narrow float at the edge of the text, and making the
text wrap around
\begin{wrapfigure}[8]{r}{0.5\textwidth}
  \small
  \begin{gather}
    I_{in} =
    \begin{bmatrix}
      46 & 42 & 50 \\
      44 & 65 & 56 \\
      41 & 52 & 58 \\
    \end{bmatrix}
    \\
    I_{out}(2,2) = 131
  \end{gather}
\end{wrapfigure}
it. The wrapfigure and wraptable environments interact properly with
the \verb|\caption| command to produce proper numbering, but they are
not regular floats like figure and table, so (beware!)  they may be
printed out of sequence with the regular floats.  [...]  Parameter
\verb|#2| (required) is the figure placement code, but the valid codes
are different from regular figures. They come in pairs: an uppercase
version which allows the figure to float, and a lowercase version that
puts the figure ``exactly here''.
\end{document}

在此处输入图片描述

相关内容