From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/15998 Path: main.gmane.org!not-for-mail From: Hans Hagen Newsgroups: gmane.comp.tex.context Subject: Re: The last line Date: Mon, 09 Aug 2004 22:45:05 +0200 Sender: ntg-context-bounces@ntg.nl Message-ID: <4117E251.3090800@wxs.nl> References: Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: deer.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 1092124431 19475 80.91.224.253 (10 Aug 2004 07:53:51 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 10 Aug 2004 07:53:51 +0000 (UTC) Original-X-From: ntg-context-bounces@ntg.nl Tue Aug 10 09:53:29 2004 Return-path: Original-Received: from ronja.vet.uu.nl ([131.211.172.88] helo=ronja.ntg.nl) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1BuRRp-0002bp-00 for ; Tue, 10 Aug 2004 09:53:29 +0200 Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id CB67612784; Tue, 10 Aug 2004 09:53:28 +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 01718-05; Tue, 10 Aug 2004 09:53:27 +0200 (CEST) Original-Received: from ronja.vet.uu.nl (localhost.localdomain [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 9D44A12799; Tue, 10 Aug 2004 09:16:51 +0200 (CEST) Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id DDA541278F for ; Tue, 10 Aug 2004 09:16:50 +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 01216-10 for ; Tue, 10 Aug 2004 09:16:50 +0200 (CEST) Original-Received: from mailrelay02.solcon.nl (unknown [212.45.32.200]) by ronja.ntg.nl (Postfix) with ESMTP id 2F15012799 for ; Tue, 10 Aug 2004 09:00:47 +0200 (CEST) Original-Received: from server-1.pragma-net.nl (dsl-212-84-128-085.solcon.nl [212.84.128.85]) by mailrelay02.solcon.nl (8.12.11/SQL-8.12.11-5/8.12.11) with ESMTP id i7A70jl1027406 for ; Tue, 10 Aug 2004 09:00:45 +0200 Original-Received: by server-1.pragma-net.nl (Postfix, from userid 65534) id A97D02E8B0; Tue, 10 Aug 2004 09:00:40 +0200 (CEST) Original-Received: from [10.100.1.191] (unknown [10.100.1.191]) by server-1.pragma-net.nl (Postfix) with ESMTP id 049582E8AD for ; Tue, 10 Aug 2004 07:00:37 +0000 (UTC) User-Agent: Mozilla Thunderbird 0.6 (Windows/20040502) X-Accept-Language: en-us, en Original-To: mailing list for ConTeXt users In-Reply-To: X-Virus-Scanned: clamd / ClamAV version 0.75, clamav-milter version 0.75 on mailrelay02 X-Virus-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: , Errors-To: ntg-context-bounces@ntg.nl X-Virus-Scanned: by amavisd-new at ntg.nl Xref: main.gmane.org gmane.comp.tex.context:15998 X-Report-Spam: http://spam.gmane.org/gmane.comp.tex.context:15998 Steffen Wolfrum wrote: >Hi, > >as far as I know TeX has some internal rules (and penalties) for judging where to hyphenate words or not in order to keep a paragraph not too densed and not too loose. Some rules can be modified by commands like tolerance, spaceskip, emergencystretch et al. > >Now, I want to have control over the last line. I would like to avoid syllables smaller than (for example) 4 letters being the only element in a paragraphs last line. Like this: > >xxxx xx xxxxx xxxx >xx xxx xxxxxxx xx- >xxx. > > >Is there a way to make a kind of global definition for this for the entire document? > > \widowpenalty=4000 and alike, however, i recently added s bit more clever support for this, using setups and etex features; consider setups to be a kind of macro, not sensitive for funny spaces; system setups are those starting with a * \startsetups [*reset] \resetpenalties\widowpenalties \resetpenalties\clubpenalties \resetpenalties\interlinepenalties \stopsetups \startsetups [*default] \setups[*reset] \widowpenalty\defaultwidowpenalty \clubpenalty \defaultclubpenalty \stopsetups \startsetups [grid] [*default] \setups[*reset] \widowpenalty\defaultgridwidowpenalty \clubpenalty \defaultgridclubpenalty \stopsetups These are bound to the setuplayout command, In addition you can define your own: \startsetups [i-like-them-this-way] \setups[reset] \setpenalties\widowpenalties2{10000} \setpenalties\clubpenalties 2{10000} \brokenpenalty {10000} \stopsetups \setuplayout[setups=i-like-them-this-way] use those high values with care; 10000 is pretty high and a special number for tex and the scale is not lineair. If you want horrible results, try: \startsetups [only-if-we-are-forced-to] \displaywidowpenalty 10000 \widowpenalty 10000 \clubpenalty 10000 \brokenpenalty 10000 \doublehyphendemerits10000 \finalhyphendemerits 10000 \adjdemerits 5000 \stopsetups Esp with left/hyphenminvalues >=5 this will lead to rather bad paragraphs but we've run into designers who love this. (slowly a lot of internals will be defined this way, along with some fundamental redefinitions of other internals, consider it a kind of ConTeXt4 feature-) Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------