ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Hans Hagen <pragma@wxs.nl>
Subject: Re: The last line
Date: Mon, 09 Aug 2004 22:45:05 +0200	[thread overview]
Message-ID: <4117E251.3090800@wxs.nl> (raw)
In-Reply-To: <a06002001bd3d35b822f3@[62.134.72.212]>

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
-----------------------------------------------------------------

  reply	other threads:[~2004-08-09 20:45 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-08-09 14:23 Steffen Wolfrum
2004-08-09 20:45 ` Hans Hagen [this message]
2004-08-10  7:34 ` Taco Hoekwater
2004-08-10 14:46 Steffen Wolfrum
2004-08-10 15:58 ` Hans Hagen
2004-08-10 18:07 Steffen Wolfrum
2004-08-11  7:09 ` Hans Hagen

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=4117E251.3090800@wxs.nl \
    --to=pragma@wxs.nl \
    --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).