如何在 ConTeXt 中浮动/换行图形?

如何在 ConTeXt 中浮动/换行图形?

我有一个简单的两列文档ConTeXt。我尝试使用“placefigure”将图形浮动/包装在文本中,但它会将图形准确地插入到它们所在的位置。如果图形不适合,这会在前一列中留下空白。 在此处输入图片描述

此外,ConTeXt忽略、等图形浮动定位命令topbottom在文本中浮动/换行的标准图形位置应该是什么?

\starttext
\startcolumns[n=2,tolerance=verytolerant]
\section{Introduction}
LaTeX is based on the idea that authors should be able to focus on the content of what they are writing without being distracted by its visual presentation. In preparing a LaTeX document, the author specifies the logical structure using familiar concepts such as chapter, section, table, figure, etc., and lets the LaTeX system worry about the presentation of these structures. It therefore encourages the separation of layout from content while still allowing manual typesetting adjustments where needed. This is similar to the mechanism by which many word processors allow styles to be defined globally for an entire document or the use of Cascading Style Sheets to style HTML.
\placefigure[top,bottom][fig:1]{LaTeX can be arbitrarily extended by using the underlying macro language to develop custom formats. Such macros are often collected into packages, which are available to address special formatting issues such as complicated mathematical content or graphics. Indeed, in the example below, the align environment is provided by the amsmath package.
}
{\externalfigure[1.png][width=\textwidth]}
LaTeX is based on the idea that authors should be able to focus on the content of what they are writing without being distracted by its visual presentation. In preparing a LaTeX document, the author specifies the logical structure using familiar concepts such as chapter, section, table, figure, etc., and lets the LaTeX system worry about the presentation of these structures.
\stopcolumns
\stoptext

答案1

要浮动图像,contextgarden 的使用图形描述了两种方法。要么使用starthanging,例如:

\starttext
\starthanging[location=right,n=2,distance=1cm]{\externalfigure[cow][width=4cm]}
    \input tufte
\stophanging
\stoptext

或使用漂浮物体,它们由 ConTeXt 编号和放置,并可获得标题,例如:

\placefigure[right]{My Caption}{\externalfigure[cow.jpg]}

相关内容