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] custom header table / current sect1 titles in header

On Tue, Oct 14, 2003 at 12:48:21PM +0200, Thomas.Gier@imperia.net wrote:
> Hi,
> I have some problems for which I can't find a solution. This amazes me 
> because my intentions aren't that extraordinary, I think. Maybe a solution 
> is obvious and I'm just missing it or these issues need a advanced 
> knowledge which I definitely have not. I'm fairly at a loss ...
> I'm using docbook-xsl version 1.61.3 for FO print output ...
> 1.
> I need customizing for header.table. The header of every odd or first page 
> should look like this:
> ------------------------------------------------
> |                                              | 
> |                          Chapter title (bold)|
> |                          Sect1 title (normal)|
> ------------------------------------------------
> The header of every even page should look like this:
> ------------------------------------------------
> |                                              |
> |                                              |
> |Sect1 title (normal)                          |
> ------------------------------------------------
> I added another variable (containing a second table) to my customized 
> version of header.table. The new table finds it's way into the document 
> but I don't know how to 'address' these new table cells and put the sect1 
> header (assumed this can be done at all -> 2.) into the leftmost (resp. 
> rightmost) cell. It already contains the chapter title as the original 
> table does but this is to be exchanged by the sect1 title. Which brings me 
> to my second problem:
> 2.
> Is there a way of putting the current sect1 title into the page headers at 
> all? I can easily put the title of the first section appearing on a page 
> into the page header using titleabbrev.markup, but I can't do this with 
> the current sect1 title. All I get is the title of the first section 
> heading appearing on the current page - this may be sect4 which should not 
> appear in the page header.
> Both issues together with some minor ones (which I hopefully can handle 

> with the help of the documentation) get in the way of finishing my 
> customization layer and thus prevent me from switching back to normal 
> operational mode which is writing technical documentation. I'm really 
> eager to start working with the new tool chain :-) ...
> As you can see by the character of my problems I'm a newbie to the whole 
> thing and I hope anybody understands what I'm talking about at all because 
> my English is rather poor ... my German is much better :-) ...

Yes, this is certainly possible.
The 'header.content' template generates the text for
each cell in the original page header table.  Your new
header table should also have a call to that template
in each fo:table-cell.

The header.content template is like a function call
that returns text based on the values of the various
parameters it is passed.  Each table cell passes a different
combination of parameters.  The template body is a big
choose statement that responds to the parameter values.

For an example, see:


In particular, see the fo:retrieve-marker used in
the example for section titles.  It is used to retrieve
the marker text placed with each section heading by
the 'section.heading' template in fo/sections.xsl.

In the current setup, the markers are placed on all
section headings, not just sect1.  To place the markers
only on sect1, you need to customize the section.heading
template slightly.  Here is the top of that template:

<xsl:template name="section.heading">
  <xsl:param name="level" select="1"/>
  <xsl:param name="marker" select="1"/>
  <xsl:param name="title"/>
  <xsl:param name="titleabbrev"/>

  <fo:block xsl:use-attribute-sets="section.title.properties">
    <xsl:if test="$marker != 0">
      <fo:marker marker-class-name="section.head.marker">
          <xsl:when test="$titleabbrev = ''">
            <xsl:value-of select="$title"/>
            <xsl:value-of select="$titleabbrev"/>

Change this line:

    <xsl:if test="$marker != 0">


    <xsl:if test="$marker != 0 and $level = 1">

Then the marker named 'section.head.marker'
will be output only for sect1 headings, and
the retrieve-marker property will find only
markers in sect1 elements to retrieve.

Bob Stayton                                 400 Encinal Street
Publications Architect                      Santa Cruz, CA  95060
Technical Publications                      voice: (831) 427-7796
The SCO Group                               fax:   (831) 429-1887
                                            email: bobs@sco.com

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