ConTeXt:如何追逐浮动?

ConTeXt:如何追逐浮动?

当将 \placefloat[right] 与 ConTeXt 结合使用时,它会自动将文本环绕在浮点周围,这通常非常有用。但是,如果我需要转到浮点后的第一行,我不知道该怎么做。是否有命令可以使以下 MWE 工作?

\setuppapersize[A4][A4]
\useexternalfigure[ctanlion][http://www.ctan.org/lion/ctan_lion_350x350.png][width=5cm]
\starttext
\placefigure[right,none]{}{\externalfigure[ctanlion]}
This text is placed left to the figure, which is exactly what I want.
% A command here ?
I would like this second text to be on the first line below the figure.
\stoptext

先感谢您。

答案1

我认为你可以使用\flushsidefloatsafterpar\flushsidefloats

\setuppapersize[A4][A4]
\useexternalfigure[ctanlion][http://www.ctan.org/lion/ctan_lion_350x350.png][width=5cm]
\starttext
\placefigure[right,none]{}{\externalfigure[ctanlion]}
\flushsidefloatsafterpar
This text is placed left to the figure, which is exactly what I want.   

I would like this second text to be on the first line below the figure.

\placefigure[right,none]{}{\externalfigure[ctanlion]}
This text is placed left to the figure, which is exactly what I want.

\flushsidefloats
I would like this second text to be on the first line below the figure.
\stoptext

在此处输入图片描述

答案2

您可以使用tall关键字让图形仅围绕下面的段落流动,并让其余部分继续在其后。

\useexternalfigure[ctanlion][http://www.ctan.org/lion/ctan_lion_350x350.png][width=5cm]

\starttext

\placefigure[right,tall,none]{}{\externalfigure[ctanlion]}
\input  knuth

\stoptext

将换行浮动限制为单个段落

相关内容