我正在尝试在 ConTeXt 的框架中插入空白;以下是我尝试使用的选项:
\defineframedtext[experiment]
[frame=on,
rulethickness=1pt,
offset=0pt,
width=fit,
height=broad,
strut=no,
location=middle]
\starttext
\startexperiment
Plop \\
\blank[3cm]
\stopexperiment
\stoptext
但是,框架始终位于文本正下方,空白被忽略。我该如何实现这个空白空间?
答案1
如果您不想或根本无法切换到framed
环境,请不要\lastskip
在空白后清零。
\defineframedtext
[experiment]
[
frame=on,
rulethickness=1pt,
offset=0pt,
width=fit,
height=broad,
strut=no,
location=middle,
]
\starttexdefinition zerolastskip
\ifvmode
\scratchdimen=\prevdepth
\hrule height \zeropoint
\prevdepth=\scratchdimen
\fi
\stoptexdefinition
\starttext
\startexperiment
Plop \\
\blank[3cm]\zerolastskip
\stopexperiment
\stoptext
您可以experiment
通过引入额外的包装来将其添加到每个中。
\defineframedtext
[doexperiment]
[
frame=on,
rulethickness=1pt,
offset=0pt,
width=fit,
height=broad,
strut=no,
location=middle,
]
\definestartstop
[experiment]
[
before={\startdoexperiment},
after={\zerolastskip\stopdoexperiment},
]
\starttexdefinition zerolastskip
\ifvmode
\scratchdimen=\prevdepth
\hrule height \zeropoint
\prevdepth=\scratchdimen
\fi
\stoptexdefinition
\starttext
\startexperiment
Plop \\
\blank[3cm]
\stopexperiment
\stoptext