Thanks!, Wolfgang. As ever, you are a life saver. I was able to remove all but one of the weird page breaks using your suggestions. The last one was resolved by moving a \startegister a few words further along in the paragraph.

Alan

On Sun, Jun 10, 2012 at 3:13 PM, Wolfgang Schuster <schuster.wolfgang@googlemail.com> wrote:

Am 10.06.2012 um 20:52 schrieb Alan Bowen:

> Is there a way in MKII to ensure that there is never a page break between a heading and the following text?
>
> \setuphead[after={\page[no]}] does not seem to work without entering vertical mode before \page. But, so far, I have not found a way to enter vertical mode in after={…} that does not add interlinespace and thus place the text too far from the heading.
>
> Any suggestion or alternatives?

Do you have a example where you get an unwanted page break because context tries to prevent it.

When you can’t make one in a short time try one of the following methods:


1. Insert a page break before the heading when not enough space is available.

\setuphead[…][before={\testpage[6]\blank[…]}]


2. Add a big penalty before the vertical space after the heading (don’t use this method in mkiv).

\setuphead[…][after={\nobreak\blank[…]}]


Wolfgang
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________