ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* The last line
@ 2004-08-09 14:23 Steffen Wolfrum
  2004-08-09 20:45 ` Hans Hagen
  2004-08-10  7:34 ` Taco Hoekwater
  0 siblings, 2 replies; 7+ messages in thread
From: Steffen Wolfrum @ 2004-08-09 14:23 UTC (permalink / raw)


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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: The last line
  2004-08-09 14:23 The last line Steffen Wolfrum
@ 2004-08-09 20:45 ` Hans Hagen
  2004-08-10  7:34 ` Taco Hoekwater
  1 sibling, 0 replies; 7+ messages in thread
From: Hans Hagen @ 2004-08-09 20:45 UTC (permalink / raw)


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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: The last line
  2004-08-09 14:23 The last line Steffen Wolfrum
  2004-08-09 20:45 ` Hans Hagen
@ 2004-08-10  7:34 ` Taco Hoekwater
  1 sibling, 0 replies; 7+ messages in thread
From: Taco Hoekwater @ 2004-08-10  7:34 UTC (permalink / raw)


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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: The last line
  2004-08-10 18:07 Steffen Wolfrum
@ 2004-08-11  7:09 ` Hans Hagen
  0 siblings, 0 replies; 7+ messages in thread
From: Hans Hagen @ 2004-08-11  7:09 UTC (permalink / raw)


Steffen Wolfrum wrote:

>that means \placefigure{top,left}, WITH text around it, won't be doable in ConTeXt?
>not even in your idea of ConTeXt4?
>  
>
never say never, so far i managed to do more than i expected to be possible with tex so ...

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: The last line
@ 2004-08-10 18:07 Steffen Wolfrum
  2004-08-11  7:09 ` Hans Hagen
  0 siblings, 1 reply; 7+ messages in thread
From: Steffen Wolfrum @ 2004-08-10 18:07 UTC (permalink / raw)


Hans Hagen <pragma@wxs.nl> wrote:

> Steffen Wolfrum wrote:
> 
> >\placefigure{top,left} 
> >
> >or 
> >
> >\placefigure{bottom,outer}
> >
> >could be another ConTeXt4 feature? -)
> >
> >
> >Steffen
> >
> >(how still is waiting for a reliable way of placing many figures in large documents)
> >  
> >
> hm, graphic placement is and will always be tricky 
> 
> btw, \placefigure[outer]{}{} does work (see details.pdf)
> 
> as long as top/left i snot something with text aroun dit, it's doable -) 
> 
> Hans 



that means \placefigure{top,left}, WITH text around it, won't be doable in ConTeXt?
not even in your idea of ConTeXt4?

Steffen

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: The last line
  2004-08-10 14:46 Steffen Wolfrum
@ 2004-08-10 15:58 ` Hans Hagen
  0 siblings, 0 replies; 7+ messages in thread
From: Hans Hagen @ 2004-08-10 15:58 UTC (permalink / raw)


Steffen Wolfrum wrote:

>\placefigure{top,left} 
>
>or 
>
>\placefigure{bottom,outer}
>
>could be another ConTeXt4 feature? -)
>
>
>Steffen
>
>(how still is waiting for a reliable way of placing many figures in large documents)
>  
>
hm, graphic placement is and will always be tricky 

btw, \placefigure[outer]{}{} does work (see details.pdf)

as long as top/left i snot something with text aroun dit, it's doable -) 

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: The last line
@ 2004-08-10 14:46 Steffen Wolfrum
  2004-08-10 15:58 ` Hans Hagen
  0 siblings, 1 reply; 7+ messages in thread
From: Steffen Wolfrum @ 2004-08-10 14:46 UTC (permalink / raw)


Hans Hagen <pragma@wxs.nl> wrote:

...

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


Maybe something like 

\placefigure{top,left} 

or 

\placefigure{bottom,outer}

could be another ConTeXt4 feature? -)


Steffen

(how still is waiting for a reliable way of placing many figures in large documents)

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2004-08-11  7:09 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-08-09 14:23 The last line Steffen Wolfrum
2004-08-09 20:45 ` Hans Hagen
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

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