这是我的代码:
\usemodule[tikz]
\usetikzlibrary{positioning}
\starttext
Some Text
\startcolumns[n=2]
\placefigure[force] {First Figure} {
\midaligned{
\starttikzpicture
\node[draw] {A};
\stoptikzpicture
}}
\column
\placefigure[force] {Second Figure} {
\midaligned{
\starttikzpicture
\node[draw] (A) {A};
\node[draw,below=of A] (B) {B};
\draw[->] (A) -- (B);
\stoptikzpicture
}}
\stopcolumns
More Text
\stoptext
它输出:
我想让两个浮动图片的标题对齐。左边的图片可能会和标题一起向下移动。我该怎么做?
答案1
使用floatcombination
。我发现使用\start...\stop
所有命令的版本非常方便,因为您不必记住位置参数(例如\placefigure
)。
\usemodule[tikz]
\usetikzlibrary{positioning}
\starttext
Some Text
\startfloatcombination[distance=0pt]
\startplacefigure[title={First Figure}]
\startframed[frame=off,offset=none,width=.5\textwidth]
\starttikzpicture
\node[draw] {A};
\stoptikzpicture
\stopframed
\stopplacefigure
\startplacefigure[title={Second Figure}]
\startframed[frame=off,offset=none,width=.5\textwidth]
\starttikzpicture
\node[draw] (A) {A};
\node[draw,below=of A] (B) {B};
\draw[->] (A) -- (B);
\stoptikzpicture
\stopframed
\stopplacefigure
\stopfloatcombination
More Text
\stoptext