From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/19476 Path: news.gmane.org!not-for-mail From: Vit Zyka Newsgroups: gmane.comp.tex.context Subject: Re: widow and orphan control Date: Thu, 31 Mar 2005 01:23:40 +0200 Message-ID: <424B34FC.1080005@seznam.cz> References: Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1112224929 22981 80.91.229.2 (30 Mar 2005 23:22:09 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 30 Mar 2005 23:22:09 +0000 (UTC) Original-X-From: ntg-context-bounces@ntg.nl Thu Mar 31 01:22:04 2005 Return-path: Original-Received: from ronja.vet.uu.nl ([131.211.172.88] helo=ronja.ntg.nl) by ciao.gmane.org with esmtp (Exim 4.43) id 1DGmVK-0002Tt-0i for gctc-ntg-context-518@m.gmane.org; Thu, 31 Mar 2005 01:21:42 +0200 Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id C1C8C128F6; Thu, 31 Mar 2005 01:22:47 +0200 (CEST) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (ronja.vet.uu.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 25582-01; Thu, 31 Mar 2005 01:22:45 +0200 (CEST) Original-Received: from ronja.vet.uu.nl (localhost.localdomain [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 58293128F2; Thu, 31 Mar 2005 01:22:44 +0200 (CEST) Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 4A126128F2 for ; Thu, 31 Mar 2005 01:22:43 +0200 (CEST) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (ronja.vet.uu.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 25490-08 for ; Thu, 31 Mar 2005 01:22:42 +0200 (CEST) Original-Received: from smtp.seznam.cz (smtp.seznam.cz [212.80.76.43]) by ronja.ntg.nl (Postfix) with SMTP id 3EE27128EE for ; Thu, 31 Mar 2005 01:22:42 +0200 (CEST) Original-Received: (qmail 6643 invoked from network); 30 Mar 2005 23:22:41 -0000 Original-Received: from unknown (HELO ?127.0.0.1?) (vit.zyka@62.240.166.134) by smtp.seznam.cz with SMTP; 30 Mar 2005 23:22:41 -0000 User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) X-Accept-Language: en-us, en Original-To: mailing list for ConTeXt users In-Reply-To: X-Antivirus: avast! (VPS 0512-2, 26.03.2005), Outbound message X-Antivirus-Status: Clean X-Virus-Scanned: by amavisd-new at ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.5 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: ntg-context-bounces@ntg.nl Errors-To: ntg-context-bounces@ntg.nl X-Virus-Scanned: by amavisd-new at ntg.nl Xref: news.gmane.org gmane.comp.tex.context:19476 X-Report-Spam: http://spam.gmane.org/gmane.comp.tex.context:19476 phthenry@iglou.com wrote: > From: Vit Zyka > >> >>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 -------------