6

Is there a possibility to deactive grid=yes in the text for a single paragraph only? It should be something like \nogrid{ paragraph.... }. There is \placeongrid{} - but this does not allow page-breaking, so the whole paragraph is set as one on a new page, if breaking is needed. I think no minexample is needed here, any paragraph does it.

1 Answer 1

1

You just put stuff in a \vbox and \vsplit it to break across pages. To not mess up the gridding around, use \snaptogrid when placing the boxes.

\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

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .