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] icon for chapter number on the edge of page

Hi Lily,
I implemented bleed tabs that operate in a similar fashion using the side 
regions in an FO page-master.  There are a lot of details to make it work, 
but it can be done.  The advantage of using side regions is that the content 
is static and doesn't need an anchor in the body flow on each page to work. 
The side regions are named "start" for the left side in left-to-write 
writing mode, and "end" for the right side in that mode.  Here is an outline 
of the solution:

1.  Create custom page masters that add fo:region-start and fo:region-end 
elements to each fo:simple-page-master:

    <fo:simple-page-master master-name="blank-odd"
      <fo:region-body display-align="center"
        <xsl:if test="$fop.extensions = 0">
          <xsl:attribute name="region-name">blank-body</xsl:attribute>
      <fo:region-before region-name="xsl-region-before-blank-odd"
      <fo:region-after region-name="xsl-region-after-blank-odd"
      <fo:region-start region-name="xsl-region-start-blank-odd"
      <fo:region-end region-name="xsl-region-end-blank-odd"

2.  Customize the user.pagemasters template to call your new page masters.

3.  Customize the template named running.head.mode from fo/pagesetup.xsl to 
create several new fo:static-content elements. Use these for the "start" 

  <fo:static-content flow-name="xsl-region-start-first">
    <xsl:call-template name="bleed.tab">
      <xsl:with-param name="pageclass" select="$pageclass"/>
      <xsl:with-param name="sequence" select="'first'"/>
      <xsl:with-param name="side" select="'start'"/>
      <xsl:with-param name="gentext-key" select="$gentext-key"/>

  <fo:static-content flow-name="xsl-region-start-odd">
    <xsl:call-template name="bleed.tab">
      <xsl:with-param name="pageclass" select="$pageclass"/>
      <xsl:with-param name="sequence" select="'odd'"/>
      <xsl:with-param name="side" select="'start'"/>
      <xsl:with-param name="gentext-key" select="$gentext-key"/>

  <fo:static-content flow-name="xsl-region-start-even">
    <xsl:call-template name="bleed.tab">
      <xsl:with-param name="pageclass" select="$pageclass"/>
      <xsl:with-param name="sequence" select="'even'"/>
      <xsl:with-param name="side" select="'start'"/>
      <xsl:with-param name="gentext-key" select="$gentext-key"/>

4.  Create another set replacing "start" with "end" everywhere.  These 
static-content elements put content into the side regions.

5.  Create a template named "bleed.tab" that accepts those params and uses 
an xsl:choose to compute the content for each combination of pageclass, 
sequence, side, and gentext-key (maybe only when it is "chapter").   Many 
combinations won't have content, so only create xsl:when elements for those 
combinations that do (sequence="odd" and side="end" for example).  The 
context for the call to this template is the element that creates a 
page-sequence, so the context is chapter when doing a chapter element.  You 
can count preceding chapter elements to compute a position in the side 
margin for each chapter so they march down the page.

6.  The static content for each combination is an fo:block-container with 
absolute positioning:

                    top="1.15in">  <!-- === compute this value -->
          <fo:external-graphic ...

You'll have to experiment with sizes and positioning to get it to work.

I didn't try this with FOP, so I hope it works for you.

Bob Stayton
Sagehill Enterprises

----- Original Message ----- 
From: "Lily Galle" <lily.galle@gmx.net>
To: <docbook-apps@lists.oasis-open.org>
Sent: Thursday, October 23, 2008 1:49 AM
Subject: [docbook-apps] icon for chapter number on the edge of page

> Hi,
> My docBook ist double-sided. I would like to set one small icon on the 
> outside of each page.   In the icon is the chapter number. In the CHAPTER 
> ONE there is “1” in the icon. In the CHAPTER TWO, there is “2” in the 
> icon.
> This icon should be POSITIONED differently. In the CHAPTER ONE it has a 
> distance of “3in” to the top of the page. In the CHAPTER TWO it has a 
> distance of “4in” to the top of the page.
> Could someone tell me how to manage it? Thanks.
> Lily
> -- 
> Psssst! Schon vom neuen GMX MultiMessenger gehört? Der kann`s mit allen: 
> http://www.gmx.net/de/go/multimessenger
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: docbook-apps-unsubscribe@lists.oasis-open.org
> For additional commands, e-mail: docbook-apps-help@lists.oasis-open.org

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