Loading ...
Sorry, an error occurred while loading the content.

2365Re: [XSL-FO] Visible chapter index on the side of a book

Expand Messages
  • W. Eliot Kimber
    Nov 3, 2002
      W. Eliot Kimber wrote:

      > I think you want retrieve-boundary="page-sequence", but I'm not sure
      > without testing your example, which I'll do when I get a chance.

      Here's a solution I came up with:

      The page master:

      <fo:simple-page-master master-name="body-page"
      margin-top="0.5in"
      margin-left="0.5in"
      margin-right="0.0in"
      margin-bottom="0.5in"
      page-height="11in"
      page-width="8.5in">
      <fo:region-before
      extent="1in"/>
      <fo:region-after
      extent="1in"/>
      <fo:region-end
      reference-orientation="-90"
      extent="1in"/>
      <fo:region-body
      margin-top="1.5in"
      margin-bottom="1.5in"
      margin-right="1.0in"/>
      </fo:simple-page-master>

      Notice that I'm setting the reference orientation on the region
      itself--I forgot before that you can do this. Also, the right page
      margin is "0" so that the end region will align with the page edge. The
      body region has to account for the lack of left page margin by
      specifying its own margin.

      In the page sequence:

      <fo:static-content flow-name="xsl-region-end">
      <fo:retrieve-marker
      retrieve-boundary="page"
      retrieve-class-name="thumb-tab"
      retrieve-position="first-within-page"/>
      </fo:static-content>

      Using retrieve-boundary="page" does limit the tab to just the page on
      which the marker appears, which is the desired affect in this case (if
      you used page-sequence, the tab would occur on every page).

      In my first-level section template. This results in a 1/2-inch square
      tab right up to the page edge, with the text rotated 90 degrees
      clockwise, white text on a black background:

      <xsl:template match="body/section/title">
      <fo:block
      break-before="page"
      ><fo:marker marker-class-name="section-2-title"/>
      <fo:marker marker-class-name="thumb-tab">
      <fo:block-container
      inline-progression-dimension="0.5in"
      block-progression-dimension="0.5in"
      background-color="black"
      color="white"
      font-weight="bold"
      display-align="center"
      text-align="center">
      <fo:block
      font-family="sans-serif"
      font-size="10pt"
      line-height="110%">
      <fo:inline>
      <xsl:choose>
      <xsl:when test="@tab-text">
      <xsl:value-of select="@tab-text"/>
      </xsl:when>
      <xsl:otherwise>
      <xsl:text>Sect. </xsl:text
      ><xsl:number
      count="section"
      level="multiple"
      from="body"
      format="1."
      />
      </xsl:otherwise>
      </xsl:choose>
      </fo:inline>
      </fo:block>
      </fo:block-container>
      </fo:marker>
      ...
      </xsl:template>

      Cheers,

      Eliot
      --
      W. Eliot Kimber, eliot@...
      Consultant, ISOGEN International

      1016 La Posada Dr., Suite 240
      Austin, TX 78752 Phone: 512.656.4139
    • Show all 17 messages in this topic