groff
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [Groff] Short Orphan Lines


From: Andrew Piziali
Subject: RE: [Groff] Short Orphan Lines
Date: Thu, 25 Mar 2004 14:58:21 -0600

Ted, you wrote:

>   >    I noticed a case, while formatting with -ms macros, where a
>   > single word line spilled to the top of the next page.  The line
>   > following that is the chapter heading of the next section.  A
>   > footnote appears on the bottom of the page preceding the spill.
>   > [...]

>   >    How do I restrict the minimum number of words (or lines)
>   > spilled to the top of the next page?  I would prefer two lines at
>   > a minimum.

>   Tricky!  There is no built-in "widow" control, and making this
>   automatic would require re-writing the paragraph macros.  "Orphan"
>   control (preventing the last line on the page being the first line
>   of a new paragraph) is quite easy: all you need to do is to follow
>   the new paragraph request (e.g. .PP) with something like

>   .PP
>   .ne 2
>   Text of paragraph ...

>   which would trigger a page break unless there was space for at least
>   two lines remaining (allowing for additional space taken by
>   footnotes etc.).

Is there any reason I shouldn't just wrap .PP with my own paragraph
macro and use it instead?

        .de Para
        .  PP
        .  ne 2
        ..

>   One way to handle your problem, which requires "manual intervention"
>   and is therefore far from ideal, is to again use something like ".ne
>   2", where you place this in the input text somewhere in the text
>   which gets printed out as the last line but one (or last but two,
>   with ".ne 3", if you prefer) of the paragraph.

As you point out later, this is not really a good solution because final
formatting responsibility is shifted from groff to the author.  As soon
as the text is changed, is may no longer work.

Given the size of the document (200+ pages), I really need an automated
solution.  Hence, the .Para macro above is appealing.


-- 
        Andrew Piziali, <address@hidden>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]