Re: [xep-support] Orphans and widows

From: Alexander Peshkov (peshkov@renderx.com)
Date: Wed Oct 22 2003 - 03:03:06 PDT

  • Next message: Nikolai Grigoriev: "Re: [xep-support] Postscript problems"

    Hello Anders,

    XEP handles orphans/widows properties as prescribed by XSL FO spec.
    These properties defines how line areas produced by your block will be
    divided across the page boundary. These properties do not governs how
    block areas produced by the formatting object will be placed with
    respect to the page break.
    Consider following fragment:
      <fo:block orphans="3" widows="2">
        This is text line number 1. This is text line number 1. This is text line number 1.
        This is text line number 2. This is text line number 2. This is text line number 2.
        This is text line number 3. This is text line number 3. This is text line number 3.
        This is text line number 4. This is text line number 4. This is text line number 4.
        This is text line number 5. This is text line number 5. This is text line number 5.
      </fo:block>
    While formatting such a block XEP will never leave less than 3 lines of
    text at the end of the page.
    Now take a look at the next example:
      <fo:block orphans="3" widows="2">
        <fo:block>
          This is text line number 1. This is text line number 1. This is text line number 1.
          This is text line number 2. This is text line number 2. This is text line number 2.
        </fo:block>
        <fo:block>
          This is text line number 1. This is text line number 1. This is text line number 1.
          This is text line number 2. This is text line number 2. This is text line number 2.
          This is text line number 3. This is text line number 3. This is text line number 3.
          This is text line number 4. This is text line number 4. This is text line number 4.
          This is text line number 5. This is text line number 5. This is text line number 5.
        </fo:block>
      </fo:block>

    Since orphans/widows properties are inheritable they will be passed to
    the nested blocks so that first block will became unbreakable - if
    formatter will try to split it, it will violate one of constraints.
    If page have to break somewhere inside first block when formatter will
    move both blocks to the next page (given that first page would not became
    empty).
    If page have to break somewhere between blocks or at very beginning of
    second one when formatter will leave first block alone one the first
    page and move whole second block to the next one, since it should
    respect orphans/widows constraints of the second block.

    I hope that this explanation clarifies the situation. If you still
    believe that XEP behavior is incorrect - please send me (off-list)
    short XSL FO sample that demonstrates it.

    Best regards,
    Alexander Peshkov mailto:peshkov@renderx.com
    RenderX

    AS> Hi,

    AS> I've tried sending this message before, but it doesn't seem to work so I
    AS> joined the list again... Hopefully it works now...

    AS> I'm having trouble using the orphans and widows features. I'm trying to
    AS> make sure certain elements do not appear as orphans and widows, say with
    AS> only 1 or 2 lines of text. I've tried the following on the "Para"
    AS> element, e.g., which is obviously our element for plain paragraph text.
    AS> I've also tried it on the element which is the parent of this one, and
    AS> which holds a number of different elements such as tables, paragraphs or
    AS> images. But the widows and orphans don't seem to have any effect
    AS> whatsoever. I still get the same single lines of text at the end of the
    AS> page...

    AS> What am I doing wrong???

    AS> <xsl:template match="Para">

    AS> <fo:block font-size="11pt" font-family="Times" line-height="14pt"
    AS> orphans="10" widows="10">

    AS> <xsl:apply-templates/>

    AS> </fo:block>

    AS> </xsl:template>

    AS> Regards,

    AS> Anders

    AS> ------------------------------------------------
    AS> Anders Svensson
    AS> Animech AB
    AS> www.animech.com <http://www.animech.com/>
    AS> Ekeby Bruk A10
    AS> 752 75 UPPSALA, Sweden
    AS> Mobil: 070-607 43 33
    AS> E-post: anders.svensson@animech.com
    AS> ------------------------------------------------

    -------------------
    (*) To unsubscribe, send a message with words 'unsubscribe xep-support'
    in the body of the message to majordomo@renderx.com from the address
    you are subscribed from.
    (*) By using the Service, you expressly agree to these Terms of Service http://www.renderx.com/tos.html



    This archive was generated by hypermail 2.1.5 : Wed Oct 22 2003 - 02:57:50 PDT