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? Thanks for any hints, Steffen
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 -----------------------------------------------------------------
On Mon, 9 Aug 2004 16:23:12 +0200, Steffen wrote:
Hi,
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?
There are a few TeX primitive commands that govern the final line of a paragraph: \finalhyphendemerits=\maxdimen % disables hyphenation of final line \parfillskip= 0pt plus .8\hsize % disallow final lines shorter than 20% of \hsize ConTeXT might alter the values of these primitives occasionally (unlikely but I am not certain) so maybe you have to repeat these settings a few times. -- groeten, Taco
participants (3)
-
Hans Hagen
-
Steffen Wolfrum
-
Taco Hoekwater