From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/28827 Path: news.gmane.org!not-for-mail From: Joshua Ellis Newsgroups: gmane.comp.tex.context Subject: Preventing page breaks (needspace) Date: Sat, 24 Jun 2006 22:48:54 -0400 Message-ID: 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 1151203669 23769 80.91.229.2 (25 Jun 2006 02:47:49 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 25 Jun 2006 02:47:49 +0000 (UTC) Original-X-From: ntg-context-bounces@ntg.nl Sun Jun 25 04:47:47 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 1FuKf4-0004wP-Pb for gctc-ntg-context-518@m.gmane.org; Sun, 25 Jun 2006 04:47:46 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 2F8F712796; Sun, 25 Jun 2006 04:47:46 +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 26880-02; Sun, 25 Jun 2006 04:47:41 +0200 (CEST) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 8C355127B3; Sun, 25 Jun 2006 04:47:40 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id E1573127B3 for ; Sun, 25 Jun 2006 04:47:38 +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 24299-09 for ; Sun, 25 Jun 2006 04:47:37 +0200 (CEST) Original-Received: from host.apostate.com (unknown [38.118.74.199]) by ronja.ntg.nl (Postfix) with SMTP id 437F112796 for ; Sun, 25 Jun 2006 04:47:36 +0200 (CEST) Original-Received: from 69-162-58-73.stcgpa.adelphia.net ([69.162.58.73] helo=[192.168.0.100]) by host.apostate.com with esmtpa (Exim 4.52) id 1FuKes-0007qv-Kt for ntg-context@ntg.nl; Sat, 24 Jun 2006 21:47:34 -0500 User-Agent: Microsoft-Entourage/11.2.3.060209 Original-To: mailing list for ConTeXt users Thread-Topic: Preventing page breaks (needspace) Thread-Index: AcaYAeWJJFXesAP1EduTNwADk93n+A== X-Antivirus-Scanner: Clean mail though you should still use an Antivirus X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - host.apostate.com X-AntiAbuse: Original Domain - ntg.nl X-AntiAbuse: Originator/Caller UID/GID - [0 0] / [47 12] X-AntiAbuse: Sender Address Domain - apostate.com X-Source: X-Source-Args: X-Source-Dir: 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:28827 Archived-At: 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?