在我的 MWE 中,我以 4 种不同的方式在图层上放置了 4 个框架。来自命令的开始-停止版本的 2 个框架相对于其他 2 个框架向右偏移了约 1.5 毫米。为什么?
\showframe
\setuplayout[backspace=58mm, width=106mm, header=0mm, footer=5mm, leftmargindistance=5mm, leftmargin=32mm, topspace=20mm, height=220mm, footerdistance=5mm,]
% layer covers margin and body text
\definelayer[postlayer][x=21mm, y=\topspace, width=100mm, height=\makeupheight,]
\setupbackgrounds[page][background=postlayer,]
\defineframedtext[mycaption]
\starttext
\dorecurse{1}{\input{knuth} }
% layer with framedtext
\setlayer[postlayer][hoffset=0mm, voffset=0mm,]
{\framedtext
[width=\leftmarginwidth, height=20mm, frame=on, offset=0mm,]
{Text in the margin. }
}
% use start/stop
\setlayer[postlayer][hoffset=0mm, voffset=25mm,]
{\startframedtext
[width=\leftmarginwidth, height=20mm, frame=on, offset=0mm,]
{Text in the margin. }
\stopframedtext
}
\setlayer[postlayer][hoffset=0mm, voffset=50mm,]
{\mycaption
[width=\leftmarginwidth, height=20mm, frame=on, offset=0mm,]
{Text in the margin. }
}
% use start/stop
\setlayer[postlayer][hoffset=0mm, voffset=75mm,]
{\startmycaption
[width=\leftmarginwidth, height=20mm, frame=on, offset=0mm,]
{Text in the margin.}
\stopmycaption
}
\stoptext
答案1
这是 ConTeXt 的一个错误。最小示例:
\showmakeup[space]
\starttext
\hbox{.\startframedtext.\stopframedtext}
\stoptext
您可以应用此补丁来修复它:
--- texmf-context/tex/context/base/mkxl/pack-rul.old 2022-12-21 19:12:14.790830416 -0700
+++ texmf-context/tex/context/base/mkxl/pack-rul.mkxl 2022-12-21 19:12:26.193652551 -0700
@@ -2693,7 +2693,7 @@
\tolerant\protected\def\pack_framed_text_start[#1]#*[#2]#*[#3]% or #1#*[#2]#*[#3]% and pass {#1}
{\bgroup
- \edef\currentframedtext{#1}
+ \edef\currentframedtext{#1}%
\doifelseassignment{#2}
{\pack_framed_text_start_indeed\empty{#2}}
{\pack_framed_text_start_indeed{#2}{#3}}}
我已向开发人员报告此问题,所以如果您不想修补您的 ConTeXt 文件,您可以等待几天然后更新。