ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Hans Hagen <pragma@wxs.nl>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: Conditional keep-with-next rules
Date: Sat, 28 Jun 2014 10:57:00 +0200	[thread overview]
Message-ID: <53AE835C.5030508@wxs.nl> (raw)
In-Reply-To: <002e01cf9298$e38f3010$aaad9030$@tosovsky@email.cz>

On 6/28/2014 8:19 AM, Jan Tosovsky wrote:
> On 2014-06-27 Jan Tosovsky wrote:
>> Dear All,
>>
>> in my index I can see disturbing page breaks.
>>
>> primary-01
>> primary-02
>>     secondary-01
>> ------- ( next page ) -----
>>     secondary-02
>> primary-03
>>
>> instead of
>>
>> primary-01
>> ------- ( next page ) -----
>> primary-02
>>     secondary-01
>>     secondary-02
>> primary-03
>>
>> Is it possible to somehow define conditional keep-with-next rules?
>>
>> I'd like to express:
>> (1) keep always the primary with the first secondary (this seems to be
>> implemented)
>> (2) keep always the first secondary with the next secondary
>> (3) keep always the last secondary with the previous secondary
>>
>> And similarly for tertiary.

Deep down we have (spac-ver) this:

\definevspacing[preference][penalty:-500]  % goodbreak
\definevspacing[samepage]  [penalty:10000] % nobreak
\definevspacing[max]       [category:1]
\definevspacing[force]     [category:2]
\definevspacing[disable]   [category:5]
\definevspacing[nowhite]   [category:6]
\definevspacing[back]      [category:7]
%               together   [category:8]
\definevspacing[overlay]   [category:9]
\definevspacing[always]    [category:0]
\definevspacing[weak]      [order:0]
\definevspacing[strong]    [order:100]

so we can have weights and so. However, in practice the problem is that 
when combining different mechanisms their spacing settings might not be 
tuned to each other. I will extend this mechanism when we have a bit 
more control over some of the lists involved.

It's no big deal to set up something for an index, but it needs thinking 
about how to deal with worst case scenarios and these will happen for 
sure and you don't want to end up with a sequence of entries two pages 
height running of a page, certainly not in a fully automated workflow.

It is on the to-be-loked-into-list, but as all things, it has to fit 
into my agenda (read: to be done in what's left of my free time). I also 
have to make sure then it does not mess up existing files.

For the moment playing with the before/after keys is the way to go.

Hans

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
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
___________________________________________________________________________________


  parent reply	other threads:[~2014-06-28  8:57 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <00a601cf9246$fd71e6a0$f855b3e0$@tosovsky@tiscali.cz>
2014-06-28  6:19 ` Jan Tosovsky
     [not found] ` <002e01cf9298$e38f3010$aaad9030$@tosovsky@email.cz>
2014-06-28  8:57   ` Hans Hagen [this message]
2014-06-27 20:33 Jan Tosovsky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=53AE835C.5030508@wxs.nl \
    --to=pragma@wxs.nl \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).