Index Page: Insert Current Indexterm(s) in The Header

View: New views
3 Messages — Rating Filter:   Alert me  

Index Page: Insert Current Indexterm(s) in The Header

by Thomas Schraitle :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

following situation: I have a document with lots of indexterms which is
transformed with the FO stylesheets and XEP to PDF. However, the
stylesheets give me in the header of each page the page number and the
word "Index" only.

My idea was to integrate the primary and a secondary term (if available)
into the header like this:

--------------------------------------------------
DocBook(W3-Schema) -- Validation(RELAX NG)
--------------------------------------------------
DocBook                     Fonts  123
  Converting 32,43            Avantgarde 123
  DTD 45                      Frutiger 124
  Entities 34                 Helvetica 156
  Tables 45                   Palatino 126
  RELAX NG 45
  Writing  23               Validation
  Validating 5                DTD 45
  W3C-Schema 46               RELAX NG 45

..................................................

It would be really nice to have at least the primary indexterm in the
header. I assume I have to insert a fo:marker element somewhere, and
retrieve it in fo:static-content. The question is which of the templates
should I adjust.

Any ideas?



Thanks,
Tom

--
Thomas Schraitle

---------------------------------------------------------------------
To unsubscribe, e-mail: docbook-apps-unsubscribe@...
For additional commands, e-mail: docbook-apps-help@...


Re: Index Page: Insert Current Indexterm(s) in The Header

by Bob Stayton :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,
I think you want to customize the this template in fo/autoidx.xsl:

<xsl:template match="indexterm" mode="index-primary">
  ...
  <fo:block>
    <xsl:if test="$axf.extensions != 0">
      <xsl:attribute
name="axf:suppress-duplicate-page-number">true</xsl:attribute>
    </xsl:if>
<!-- ******* insert fo:marker here ********* -->
    <xsl:value-of select="primary"/>
    ....

You need to put the fo:marker after any xsl:attribute lines and before any
text content of the block.  The context of this template is the indexterm,
so you can select "primary" and "secondary" elements and combine them in the
text of the marker.

Then you'll need to customize the header.content template with the
fo:retrieve-marker element to pick up the first or last marker on each page.

Bob Stayton
Sagehill Enterprises
bobs@...


----- Original Message -----
From: "Thomas Schraitle" <tom_schr@...>
To: <docbook-apps@...>
Sent: Saturday, October 11, 2008 2:19 AM
Subject: [docbook-apps] Index Page: Insert Current Indexterm(s) in The
Header


> Hi,
>
> following situation: I have a document with lots of indexterms which is
> transformed with the FO stylesheets and XEP to PDF. However, the
> stylesheets give me in the header of each page the page number and the
> word "Index" only.
>
> My idea was to integrate the primary and a secondary term (if available)
> into the header like this:
>
> --------------------------------------------------
> DocBook(W3-Schema) -- Validation(RELAX NG)
> --------------------------------------------------
> DocBook                     Fonts  123
>  Converting 32,43            Avantgarde 123
>  DTD 45                      Frutiger 124
>  Entities 34                 Helvetica 156
>  Tables 45                   Palatino 126
>  RELAX NG 45
>  Writing  23               Validation
>  Validating 5                DTD 45
>  W3C-Schema 46               RELAX NG 45
>
> ..................................................
>
> It would be really nice to have at least the primary indexterm in the
> header. I assume I have to insert a fo:marker element somewhere, and
> retrieve it in fo:static-content. The question is which of the templates
> should I adjust.
>
> Any ideas?
>
>
>
> Thanks,
> Tom
>
> --
> Thomas Schraitle
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: docbook-apps-unsubscribe@...
> For additional commands, e-mail: docbook-apps-help@...
>
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: docbook-apps-unsubscribe@...
For additional commands, e-mail: docbook-apps-help@...


Re: Index Page: Insert Current Indexterm(s) in The Header

by Thomas Schraitle :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

On Dienstag, 14. Oktober 2008, Bob Stayton wrote:

> I think you want to customize the this template in fo/autoidx.xsl:
>
> <xsl:template match="indexterm" mode="index-primary">
> [...]
>
> You need to put the fo:marker after any xsl:attribute lines and before
> any text content of the block.  The context of this template is the
> indexterm, so you can select "primary" and "secondary" elements and
> combine them in the text of the marker.
>
> Then you'll need to customize the header.content template with the
> fo:retrieve-marker element to pick up the first or last marker on each
> page.

Thanks Bob, it works! :-)


Tom

--
Thomas Schraitle

---------------------------------------------------------------------
To unsubscribe, e-mail: docbook-apps-unsubscribe@...
For additional commands, e-mail: docbook-apps-help@...

LightInTheBox - Buy quality products at wholesale price!