groff
[Top][All Lists]
Advanced

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

RE: [Groff] Short Orphan Lines


From: Ted Harding
Subject: RE: [Groff] Short Orphan Lines
Date: Thu, 25 Mar 2004 19:58:16 -0000 (GMT)

[I'm re-sending this, since it seems not to have reached the list
 though sent this morning.Apologies if you receive it twice.]

On 24-Mar-04 Andrew J. Piziali 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.).

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. Then,
if this last line but one were going to be the last line of the
page, the ".ne 2" would trigger a page break because there
would not be two lines available.

For example, suppose that you have input text like

.PP
This is the text of a paragraph
....
but I do not want the last printed line of this
paragraph to be the first line at the top of a new page.

and this prints out like

   This is the text of a paragraph ...
   ... this paragraph to be the first line at the top of a new
----------------------------------------------------------------
   page.

then you could insert ".ne 2" as follows:

.PP
This is the text of a paragraph
....
but I do not want the last printed line of this
.ne 2
paragraph to be the first line at the top of a new page.

and it would then print as

   This is the text of a paragraph ...
----------------------------------------------------------------
   ... this paragraph to be the first line at the top of a new
   page.

However, if you subsequently edited your text you could find
yourself getting a page break when you did not want one. With
".ne 2" this would at worst give you one line short at the bottom
of the page, but this is still not desirable. So this solution
is best applied when the text is in final form (or pretty close to it).

Hoping this helps,
Ted.


--------------------------------------------------------------------
E-Mail: (Ted Harding) <address@hidden>
Fax-to-email: +44 (0)870 167 1972
Date: 25-Mar-04                                       Time: 10:35:41
------------------------------ XFMail ------------------------------

--------------------------------------------------------------------
E-Mail: (Ted Harding) <address@hidden>
Fax-to-email: +44 (0)870 167 1972
Date: 25-Mar-04                                       Time: 19:58:16
------------------------------ XFMail ------------------------------


reply via email to

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