From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/28828 Path: news.gmane.org!not-for-mail From: Aditya Mahajan Newsgroups: gmane.comp.tex.context Subject: Re: Preventing page breaks (needspace) Date: Sun, 25 Jun 2006 00:34:01 -0400 (EDT) Message-ID: References: Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1151210260 6727 80.91.229.2 (25 Jun 2006 04:37:40 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 25 Jun 2006 04:37:40 +0000 (UTC) Original-X-From: ntg-context-bounces@ntg.nl Sun Jun 25 06:37:35 2006 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org 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 1FuMNK-0007Pw-Kl for gctc-ntg-context-518@m.gmane.org; Sun, 25 Jun 2006 06:37:34 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id B9221127B3; Sun, 25 Jun 2006 06:37:34 +0200 (CEST) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 06250-02; Sun, 25 Jun 2006 06:37:34 +0200 (CEST) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id A6515127B5; Sun, 25 Jun 2006 06:34:08 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 0DE62127B5 for ; Sun, 25 Jun 2006 06:34:07 +0200 (CEST) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 05741-07 for ; Sun, 25 Jun 2006 06:34:05 +0200 (CEST) Original-Received: from hackers.mr.itd.umich.edu (smtp.mail.umich.edu [141.211.14.81]) by ronja.ntg.nl (Postfix) with SMTP id 86D72127B3 for ; Sun, 25 Jun 2006 06:34:05 +0200 (CEST) Original-Received: FROM aditya.annarb01.mi.comcast.net (c-68-40-50-205.hsd1.mi.comcast.net [68.40.50.205]) BY hackers.mr.itd.umich.edu ID 449E123B.6874E.22456 ; 25 Jun 2006 00:34:03 -0400 Original-To: mailing list for ConTeXt users In-Reply-To: X-Virus-Scanned: amavisd-new at ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.7 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: amavisd-new at ntg.nl Xref: news.gmane.org gmane.comp.tex.context:28828 Archived-At: On Sat, 24 Jun 2006, Joshua Ellis wrote: > While using \obeylines for some poetry there would sometimes be page breaks > in the middle of stanzas, even if there was very stretchy space on either > side. So I borrowed some code from needspace.sty, basically to tell TeX I'd > be much happier w/ a ragged bottom than a break between lines: > > \def\needspace#1{% > \begingroup > \vskip#1\lineheight\penalty -100\vskip-#1\lineheight > \vskip#1\lineheight\penalty 9999\vskip-#1\lineheight > \endgroup} > > So if there is a stanza of four lines that *really* shouldn't be split > across pages, it looks like this: > > \needspace{4} > Line 1 > Line 2 > Line 3 > Line 4 > > However, I suspect I'm not the first person to run into this. So my > question is if there is a more ConTeXt-y way to do this? Or does ConTeXt > already have something to do this? \testpage[4] will check if there is space for 4 lines, and would otherwise cause a pagebreak. I do not know how testpage compares with needspace defined above. Aditya