ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Vit Zyka <vit.zyka@seznam.cz>
Subject: Re: widow and orphan control
Date: Thu, 31 Mar 2005 01:23:40 +0200	[thread overview]
Message-ID: <424B34FC.1080005@seznam.cz> (raw)
In-Reply-To: <E1DGeC4-0002MI-NT@iglou.com>

phthenry@iglou.com wrote:
> From: Vit Zyka <vit.zyka@seznam.cz>
> 
>> >>Hans Hagen wrote (8:53):
>>
>>>>Paul Tremblay wrote:
>>>>
>>>>>What I would need is some type of macro that can determine how much
>>>>>space is left on the page. If the space is less than some small,
>>>>>pretermined amount (say, 24 points, for example), then put the
>>
>>title on
>>
>>>>>the next page, or put in a \blank[24pt, flexible]
>>>>>
>>>>>I know nothing about writing macros, or if this is possible. 
>>>>
>>>>\testpage[24pt]
>>
>>Vit Zyka wrote (11:35):
>> >\penalty50
>> >\vskip3\baselineskip plus1fil
>> >\nobreak
>> >\vskip-3\baselineskip plus-1fil
>> >
>> >It is useful before section title etc. I believe it is implemented to
>> >ConTeXt, but I do not know the interface.
 >
> Actually, no! Both your responses help me out.
> 
> Could you explain your snippet of code? I don't quite know what 
> the \penalty50 means.

Penalty works for both vertical and horizontal mode.
Penalty is place where a break can occure (with some panalization).
Border values have these meanings:
   \penalty10000 => \nobreak,
   \penalty-10000 => force \break,
   \penalty0 => neutral value (same penalty as \par or space)

But, forget my 'solution', next example shows it does not work in 
ConTeXt (glues and penalty are not discarded at the top of next page). 
And in addition it has to cooperate with output routine (needs 
\raggedbotom).

Actually, Hans's \testpage is based on another trick (as I look up, it 
is defined by comparing \pagegoal and \pagetotal registers) and it is 
more general.

vit

-------------
\setuplayout[lines=10]

\showgrid

\starttext
   \dorecurse{9}{Line \recurselevel\hfill\break}%
   \par
   \penalty50
   \vskip 3\baselineskip
   \nobreak\vskip-3\baselineskip
   Hallo
\stoptext
-------------

  reply	other threads:[~2005-03-30 23:23 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-03-29  3:04 Paul Tremblay
2005-03-29 23:24 ` Paul Tremblay
2005-03-30  0:45   ` speter
2005-03-30  6:53   ` Hans Hagen
2005-03-30  9:53     ` Vit Zyka
2005-03-30 14:29       ` phthenry
2005-03-30 23:23         ` Vit Zyka [this message]
2005-03-30 23:03       ` Paul Tremblay
2005-03-30 23:02     ` Paul Tremblay
2005-03-31  7:11       ` Hans Hagen
2005-04-28 15:57       ` Using modes Matthias Weber
2005-04-28 19:00         ` Willi Egger
2005-04-28 21:43           ` Matthias Weber
2005-04-28 21:47           ` Matthias Weber
2005-04-28 22:17             ` David Munger
2005-03-30  7:31   ` widow and orphan control Patrick Gundlach
2005-03-30 23:05     ` Paul Tremblay
2005-03-30  9:35   ` Vit Zyka
2005-03-30  4:03 ` Paul Tremblay
2005-03-30  7:24   ` Patrick Gundlach
2005-03-30 23:08     ` Paul Tremblay

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=424B34FC.1080005@seznam.cz \
    --to=vit.zyka@seznam.cz \
    --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).