是否有可能grid=yes
只在文本中对单个段落进行停用?应该是这样的\nogrid{ paragraph.... }
。有\placeongrid{}
- 但这不允许分页,因此如果需要分页,整个段落将在新页面上设置为一个段落。我认为这里不需要 minexample,任何段落都可以。
答案1
您只需将内容放入其中,\vbox
然后\vsplit
将其拆分成多页即可。为了不弄乱网格,请\snaptogrid
在放置框时使用。
\showgrid
\setuplayout[grid=yes]
\unexpanded\def\startnogrid{%
\setbox\scratchboxone=\vbox\bgroup}
\unexpanded\def\stopnogrid{%
\egroup
\scratchdimen=\dimexpr\pagegoal-\pagetotal-\topskip\relax
% ^^^^^^^^
% This should not be \topskip but something else, but I don't know what.
\ifdim\dimexpr\ht\scratchboxone+\dp\scratchboxone\relax>\scratchdimen
\setbox\scratchboxtwo=\vsplit\scratchboxone to \scratchdimen
\snaptogrid\hpack{\box\scratchboxtwo}
\snaptogrid\hpack{\box\scratchboxone}
\else
\snaptogrid\hpack{\box\scratchboxone}
\fi}
\starttext
\samplefile{knuth}
\samplefile{ward}
\samplefile{hawking}
\samplefile{knuth}
\startnogrid
\blank[small]
\samplefile{ward}
\blank[small]
\samplefile{knuth}
\blank[small]
\samplefile{knuth}
\blank[small]
\stopnogrid
\samplefile{ward}
\samplefile{hawking}
\stoptext