[comp.text.tex] LaTeX: widow lines

alexande@grover.cs.unc.edu (Geoffrey D. Alexander) (03/15/91)

Is there a general way to avoid widow lines in LaTeX?  In particular, I would
like to avoid a single line followed by display math at the top of a page.
Also, having the display math at the top the page is not vaiable soltion; I
would rather have two lines of text followed by the display math.

Thanks,
Geoff Alexander
alexande@cs.unc.edu

eijkhout@s41.csrd.uiuc.edu (Victor Eijkhout) (03/15/91)

alexande@grover.cs.unc.edu (Geoffrey D. Alexander) writes:

>Is there a general way to avoid widow lines in LaTeX?  In particular, I would
>like to avoid a single line followed by display math at the top of a page.
>Also, having the display math at the top the page is not vaiable soltion; I
>would rather have two lines of text followed by the display math.

Hm. This question once again shows that Lamport doesn't
treat the TeX primitives in his book sufficiently.
Comment in general for LaTeX users:
buy the TeX book too, for more info on math and such.

The above question can be answered as follows:
the parameters \widowpenalty and \displaywidowpenalty
control exactly the two phenomena described.
Currently they are 150 and 50 respectively,
try setting them to 1000 or so. If you set them
to 10000 TeX will absolutely never break in these
places, which may be a bit too rigorous.

Victor.

alexande@snuffy.cs.unc.edu (Geoffrey D. Alexander) (03/15/91)

In article <1991Mar14.212743.20145@csrd.uiuc.edu> eijkhout@s41.csrd.uiuc.edu (Victor Eijkhout) writes:
|alexande@grover.cs.unc.edu (Geoffrey D. Alexander) writes:
|
||Is there a general way to avoid widow lines in LaTeX?  In particular, I would
||like to avoid a single line followed by display math at the top of a page.
||Also, having the display math at the top the page is not vaiable soltion; I
||would rather have two lines of text followed by the display math.
|
|Hm. This question once again shows that Lamport doesn't
|treat the TeX primitives in his book sufficiently.
|Comment in general for LaTeX users:
|buy the TeX book too, for more info on math and such.
|
|The above question can be answered as follows:
|the parameters \widowpenalty and \displaywidowpenalty
|control exactly the two phenomena described.
|Currently they are 150 and 50 respectively,
|try setting them to 1000 or so. If you set them
|to 10000 TeX will absolutely never break in these
|places, which may be a bit too rigorous.
|
|Victor.

I was aware of these commands.  The questions is can I use them in LaTeX?
If so, where and how do I specify them?

Thanks,
Geoff

dougcc@csv.viccol.edu.au (Douglas Miller) (03/19/91)

In article <2312@borg.cs.unc.edu>, alexande@snuffy.cs.unc.edu (Geoffrey D. Alexander) writes:
> In article <1991Mar14.212743.20145@csrd.uiuc.edu> eijkhout@s41.csrd.uiuc.edu (Victor Eijkhout) writes:
> |alexande@grover.cs.unc.edu (Geoffrey D. Alexander) writes:
> |
> ||Is there a general way to avoid widow lines in LaTeX?  In particular, I would
> ||like to avoid a single line followed by display math at the top of a page.
> ||Also, having the display math at the top the page is not vaiable soltion; I
> ||would rather have two lines of text followed by the display math.
> |
> |Hm. This question once again shows that Lamport doesn't
> |treat the TeX primitives in his book sufficiently.
> |Comment in general for LaTeX users:
> |buy the TeX book too, for more info on math and such.
> |
> |The above question can be answered as follows:
> |the parameters \widowpenalty and \displaywidowpenalty
> |control exactly the two phenomena described.
> |Currently they are 150 and 50 respectively,
> |try setting them to 1000 or so. If you set them
> |to 10000 TeX will absolutely never break in these
> |places, which may be a bit too rigorous.
> |
> |Victor.
> 
> I was aware of these commands.  The questions is can I use them in LaTeX?
> If so, where and how do I specify them?

Q1:  Yes --- LaTeX is really just TeX after all :-)

Q3:  Like this:  \widowpenalty=1000

Q2:  Anywhere you like.  Actually, in keeping with the Hosek/Miller principle
     of structuralism I would recommend putting them in a style file, e.g.,
     you could make a style file called MYARTICLE.STY as follows:

        \input article.sty
        \widowpenalty=1000
        \displaywidowpenalty=1000

     and then start your document with

        \documentstyle{myarticle}

dhosek@euler.claremont.edu (Don Hosek) (03/19/91)

In article <1991Mar18.194506.6616@csv.viccol.edu.au>, dougcc@csv.viccol.edu.au (Douglas Miller) writes:
> In article <2312@borg.cs.unc.edu>, alexande@snuffy.cs.unc.edu (Geoffrey D. Alexander) writes:
>> In article <1991Mar14.212743.20145@csrd.uiuc.edu> eijkhout@s41.csrd.uiuc.edu (Victor Eijkhout) writes:
>> |alexande@grover.cs.unc.edu (Geoffrey D. Alexander) writes:
>> ||Is there a general way to avoid widow lines in LaTeX?  
>> |The above question can be answered as follows:
>> |the parameters \widowpenalty and \displaywidowpenalty
>> |control exactly the two phenomena described.
>> I was aware of these commands.  The questions is can I use them in LaTeX?
>> If so, where and how do I specify them?
> Q2:  Anywhere you like.  Actually, in keeping with the Hosek/Miller principle
>      of structuralism I would recommend putting them in a style file, e.g.,
>      you could make a style file called MYARTICLE.STY as follows:
 
>         \input article.sty
>         \widowpenalty=1000
>         \displaywidowpenalty=1000
 
>      and then start your document with
 
>         \documentstyle{myarticle}

Hmm, my name was just used in vain... ;-)

Actually I usually recommend that a declaration like this be
placed in the preamble, but only if necessary (much like
\sloppy). 

Document styles can and do set these parameters which is why the
"if necessary" clause is there.

Why the preamble approach? Mostly because it's simpler for most
people to deal with.

-dh

 
---
Don Hosek   To retrieve files from ymir via the    | dhosek@ymir.claremont.edu
            mailserver, send a message to          | Quixote TeX Consulting
            mailserv@ymir.claremont.edu with a     | 714-625-0147
            line saying send [DIRECTORY]FILENAME 
            where DIRECTORY is the FTP directory (sans "anonymous") and 
            FILENAME is the filename, e.g. "send [tex]00readme.txt". There is
            a list of files in each directory under the name 00files.txt
            Binary files are not available by this technique.