Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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.

share|improve this question

1 Answer 1

Following the solution attempt by @Hanseat, the problem lies in specifying the interline glue between the lines within the paragraph. You could say for example:

 \showgrid
 \setuplayout[grid=yes,width=12cm]
 \starttext

 \dorecurse{5}{\input knuth}
 \blank

 \baselineskip=13.9pt
 \dorecurse{5}{\input zapf}
 \stoptext

And have the same non-grid-aligned effect than linecorrection environment, but it's not optimal. It's possible to have breaks across the pages too, but I don't think it is the best way to go.

You could also have a \vskip with a negative value within the linecorrection environment to obtain the non-grid-aligned text. But this is far from the answer. And Please, bear in mind that I have not looked at the sources for the aforementioned environment. So for example:

 \setuplayout [grid=yes, width=12cm]
 \definefont  [BigFont]  [Bold at 20pt] [24pt]
 \setuphead   [section]  [style=\BigFont]

 \showframe
 \showgrid

 \starttext
 \input knuth
 \break

 \startlinecorrection\vskip -4pt

   This creates a grid-aligned box.  The content of
   the box is not grid-aligned and paragraphs will be broken over
   pages.
 \stoplinecorrection

 \input zapf
 \blank
 \input knuth
 \stoptext

Might work but it is not a satisfactory solution, for \vskip works independently, although the output resembles the linecorrection environment. Also note that all these aforementioned examples have been with the sole purpose to have breaks, like Andrew Swann stated, across pages, or as Hanseat said, so it does not disable page breaking.

The ConTeXt manual states that some vertical space could be added. But it ought to be specified first, in the preamble of the document. I believe this is with intent to keep a consistent layout, lest a similar command throws everything off later in the document. So by \setupblank[medium] for example like in the following:

 \setuplayout [grid=yes, width=12cm]
 \definefont  [BigFont]  [Bold at 20pt] [24pt]
 \setuphead   [section]  [style=\BigFont]
 \setupblank[medium]
 \showframe
 \showgrid

 \starttext
 \input knuth
 \break

 \startlinecorrection\blank

   This creates a grid-aligned box.  The content of
   the box is not grid-aligned and paragraphs will be broken over
   pages.
 \stoplinecorrection

 \input zapf
 \blank
 \input knuth
 \stoptext

enter image description here

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.