A. Gunes Koru wrote:
Hello,

May be this is not directly a LyX question but it would be nice to have such functionality in LyX too.

I avoided orphan and widow lines using

\clubpenalty=10000
\widowpenalty=10000

in the preamble. However, that cannot avoid widow headings (I hope i am using the terminology correctly, I mean the last line in a page which is a section heading).

Is there anything I can do to handle it automatically. This happens 7-8 times in a 150 pages document and may be I can manually add a pagebreak. However, the document tends to change often which requires this manual adjustmen often too.

I would deeply appreciate if someone could tell me how to achieve this automatically.

Is your widow heading followed by lines of normal text, or something else?


While writing a 230-page book I noticed lots of widow headings in unfinished
text, when headings for unwritten sections followed each other directly. I.e.:


other paragraphs ... ... 1.4.4 something --page break-- 1.4.5 something else

But filling in the sections with text always fixed this for me. Writing
normal text under the 1.4.4 heading moved it like this:

other paragraphs with slightly more vertical spacing between sections ...
--page break--
1.4.4 something
some paragraphs of text in this section

1.4.5 something else.


So it seems latex doesn't mind putting a heading as the last line, but it will try hard _not_ to separate the heading from the text it belongs to.

I also observed this breaking down when I had a section containing a float only.
Because the float floats around, and latex thinks it have two headings
following each other and doesn't care for that. Two headings followin each other
typically means "unfinished work" and why bother trying make that look good?


So, try to not have a heading with no actual text. A float alone won't do. If you have enough plain text following your headings, consider allowing more stretching of the vertical spacing between paragraphs. That ought to help, for it is these spaces that have to stretch when a heading is moved onto the next page. Also make sure that the page isn't a single big paragraph of text, because then there is nothing to stretch! (And you'll get a big penalty for having a page that ends early. It looks real bad in two-side print.)

Break your text up into several paragraphs per page, it gives latex a much easier job with the page layout. It is probably easier to read than
multipage paragraphs too. I guess this problem is worse if you use indents
instead of skips between paragraphs - there'll be nothing to stretch
unless there is another heading or float or display math on the page.


Helge Hafting




Reply via email to