[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

[xsl] [xsl-fo] tagging for poems (widows, orphans, keep-together)


Subject: [xsl] [xsl-fo] tagging for poems (widows, orphans, keep-together)
From: Christian Kirchhoff <christian.kirchhoff@xxxxxxxxxx>
Date: Fri, 24 Sep 2010 14:46:11 +0200

Hello,

I am trying to find a good solution for tagging poems in xsl-fo. The xsl-fo is then to be converted into a PDF with XEP/RenderX.

Right now I am having problems avoiding widows and orphans. It seems (but I am not sure about that) that when there are empty fo:block tags (serving as line breaks) within a parent fo:block, then the widows and/or orphans settings don't apply.

A tagging of a poem might look like this:
<fo:block widows="5" orphans="5" hyphenate="false">
    Er folgte seinem Regiment<fo:block/>
    Ins Land, wo hoch die Palmen stehen,<fo:block/>
    Die Sonne hei_ herniederbrennt<fo:block/>
    Auf Bombays Tempel und Moscheen,<fo:block/>
    Wo tausend Scenen bunt und wild<fo:block/>
    Den Sinn berauschen und umfloren,<fo:block/>
    Allein der fernen Heimat Bild<fo:block/>
    Blieb seiner Seele unverloren.<fo:block/>
</fo:block>

But though widows and orphans are set to 5, my experience is that sometimes less than 5 lines are on the beginning or the end of a page.

If I set keep-together to "always" another problem comes up. Because if a verse is very long and doesn't fit entirely on the current page, the whole verse is shifted to the next page, leaving a huge amount of white space on the current page.

My questions:
1. Is it true that settings for widows and orphans are only working when there are no sub-blocks in a block?
2. What would be an appropriate tagging for poems in order to achieve my goal (avoiding widows and orphans but NOT placing verses that are too big on the next page)


Any help would be appreciated.

--
Best regards

Christian Kirchhoff
Editura GmbH & Co. KG
Tempelhofer Damm 2 7 12101 Berlin
www.editura.de
AG Berlin-Charlottenburg 7 HRA 43189 B 7 USt.Id. DE217180548
Geschdftsf|hrer: Ralf Szymanski


Current Thread