OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

docbook-apps message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: Re: [docbook-apps] Orphan Control Ideas


I am grappling with this myself as I near the end of a book. This is a TeX issue, not a stylesheet issue. I found helpful discussions at:

http://www.tex.ac.uk/cgi-bin/texfaq2html?label=widows
http://xpt.sourceforge.net/techdocs/Latex/OrphanSpaceControl/Latex11.001.html

Jadetex already increases \widowpenalty and \clubpenalty and increasing them further has no effect on my widows and orphans.

Ultimately I committed the following horrible kludge:

I put two files into the directory where I keep my images. Each consists of a single line.

enlargepage.tex
  \enlargethispage{\baselineskip}

reducepage.tex
  \enlargethispage{-\baselineskip}

The preamble of my docbook (sgml) source contains the following entities:

<!ENTITY enlargepage '
<INLINEMEDIAOBJECT>
<IMAGEOBJECT>
<IMAGEDATA FILEREF="images/enlargepage.tex" FORMAT="TEX">
</IMAGEOBJECT>
</INLINEMEDIAOBJECT>
'>
<!ENTITY reducepage '
<INLINEMEDIAOBJECT>
<IMAGEOBJECT>
<IMAGEDATA FILEREF="images/reducepage.tex" FORMAT="TEX">
</IMAGEOBJECT>
</INLINEMEDIAOBJECT>
'>

When I have an orphan I add &reducepage; to the paragraph before the orphan. The page size is reduced by one line, knocking the next paragraph to the next page. When I have a widow I add &enlargepage; to the paragraph which contains the widow. The page size is enlarged by one line, allowing the widow to appear with the rest of its paragraph.

These entities have no effect on html output. If it comes to pass that my souce document changes, altering the page breaks, the worst that happens is that some pages are a line longer or shorter than the rest. And it is easy to find and remove the entities if they are no longer needed.

Another useful trick if you have a chapter that ends with, for example, only three lines on the last page: add &enlargepage; to the previous three pages. The final, mostly blank page will be eliminated.

I wish there were a perfect automatic solution for widows and orphans, but if there is I didn't find it. And I looked pretty hard.



---------- Original Message ----------------------------------
From: Aaron Weber <aaron@ximian.com>
Date:  23 May 2003 14:34:00 -0400

>Hello, 
>
>Does anybody have any orphan control tips? I'm going for PDF/Print
>output, so I'm still using DSSSL stylesheets, which combined with my
>less-than-amazing programming ability has left me with the option of
>rewriting paragraphs to be slightly longer or shorter so that they break
>neatly. 
>
>I'm looking to move to XSL as soon as possible, which may be in the next
>couple of months. Or may not. I'm not entirely sure how the XSL:FO -->
>PDF transition is at this point-- mostly I've had poor luck trying to
>assemble the various bits of java or other code required to perform the
>transformations.
>
>Is there some Orphan-control="yes" variable I'm missing? Or minimum
>lines per page, minimum words per line?
>
>Aaron Weber
>
>
>

--
Kevin M. Dunn
Professor of Chemistry
Hampden-Sydney College
--


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]