docbook-apps

  • 1.  About Index chapter title

    Posted 01-25-2008 14:28
    Hi,

    After my question and Bob's help about my chapter/appendix/preface
    title customization I still have a problem with the Index title.

    I'made my titlepage spec with :
    <t:titlepage t:element="index" t:wrapper="fo:block">
    <t:titlepage-content t:side="recto">


  • 2.  Re: [docbook-apps] About Index chapter title

    Posted 01-29-2008 19:51
    The param: mechanism in the title page spec file passes parameters to the
    named template. Does your named template chapappendix.title declare a
    parameter named "pagewide", and then do something with the value? Something
    like:

    <xsl:template name="chapappendix.title">
    <xsl:param name="pagewide" select="0"/>

    and inside the template just after the fo:block opens, something like:

    <xsl:if test="$pagewide != 0">
    <xsl:attribute name="span">all</xsl:attribute>

    The span="all" on a block will cause it to span both columns in the two
    column layout.

    Bob Stayton
    Sagehill Enterprises
    bobs@sagehill.net





  • 3.  Re: [docbook-apps] About Index chapter title

    Posted 04-19-2008 08:56
    On 29 janv. 08, at 20:51, Bob Stayton wrote:
    > The param: mechanism in the title page spec file passes parameters
    > to the named template. Does your named template chapappendix.title
    > declare a parameter named "pagewide", and then do something with the
    > value? Something like:
    >
    > <xsl:template name="chapappendix.title">
    > <xsl:param name="pagewide" select="0"/>
    I had this param in my template.

    >
    > and inside the template just after the fo:block opens, something like:
    >
    > <xsl:if test="$pagewide != 0">
    > <xsl:attribute name="span">all</xsl:attribute>

    And this exactly as you said but...

    > The span="all" on a block will cause it to span both columns in the
    > two column layout.

    I know that the test is true because I've :

    <fo:block xsl:use-attribute-sets="chap.title.properties">
    <xsl:if test="$pagewide != 0">
    <xsl:attribute name="span">all</xsl:attribute>
    <xsl:text>FooBar</xsl:text>
    </xsl:if>
    <xsl:apply-templates select="$node" mode="title.markup"/>
    </fo:block>

    And the FooBar appears juste before the word "Index" but still right
    align on the first column.

    My titlepage spec define, for index, the pagewide param, set to 1.

    <xsl:template name="index.titlepage.recto">
    <fo:block xmlns:fo="http://www.w3.org/1999/XSL/Format" xsl:use-
    attribute-sets="index.titlepage.recto.style" margin-left="0pt" font-
    family="${title.fontset}">
    <xsl:call-template name="chapappendix.title">
    <xsl:with-param name="node" select="ancestor-or-
    self::d:index[1]"/>
    <xsl:with-param name="pagewide" select="1"/>
    </xsl:call-template>
    </fo:block>
    <xsl:choose>
    <xsl:when test="d:indexinfo/d:subtitle">
    <xsl:apply-templates mode="index.titlepage.recto.auto.mode"
    select="d:indexinfo/d:subtitle"/>
    </xsl:when>
    <xsl:when test="d:docinfo/d:subtitle">
    <xsl:apply-templates mode="index.titlepage.recto.auto.mode"
    select="d:docinfo/d:subtitle"/>
    </xsl:when>
    <xsl:when test="d:info/d:subtitle">
    <xsl:apply-templates mode="index.titlepage.recto.auto.mode"
    select="d:info/d:subtitle"/>
    </xsl:when>
    <xsl:when test="d:subtitle">
    <xsl:apply-templates mode="index.titlepage.recto.auto.mode"
    select="d:subtitle"/>
    </xsl:when>
    </xsl:choose>
    </xsl:template>

    It still very strange for me.

    jacques



  • 4.  Re: [docbook-apps] About Index chapter title

    Posted 04-27-2008 09:34

    On 19 avr. 08, at 10:56, Jacques Foucry wrote:

    > On 29 janv. 08, at 20:51, Bob Stayton wrote:
    >> The param: mechanism in the title page spec file passes parameters
    >> to the named template. Does your named template chapappendix.title
    >> declare a parameter named "pagewide", and then do something with
    >> the value? Something like:
    >>
    >> <xsl:template name="chapappendix.title">
    >> <xsl:param name="pagewide" select="0"/>
    > I had this param in my template.
    >
    >>
    >> and inside the template just after the fo:block opens, something
    >> like:
    >>
    >> <xsl:if test="$pagewide != 0">
    >> <xsl:attribute name="span">all</xsl:attribute>
    >
    > And this exactly as you said but...
    >
    >> The span="all" on a block will cause it to span both columns in the
    >> two column layout.
    >
    > I know that the test is true because I've :
    >
    > <fo:block xsl:use-attribute-sets="chap.title.properties">
    > <xsl:if test="$pagewide != 0">
    > <xsl:attribute name="span">all</xsl:attribute>
    > <xsl:text>FooBar</xsl:text>
    > </xsl:if>
    > <xsl:apply-templates select="$node" mode="title.markup"/>
    > </fo:block>
    >
    > And the FooBar appears juste before the word "Index" but still right
    > align on the first column.
    >
    > My titlepage spec define, for index, the pagewide param, set to 1.

    I found new element in errors output :

    I made a new book project from oXygen template. I add some indexterm
    and generate a PDF using my custom stylesheet with <xsl:attribute
    name="span">all</xsl:attribute>.

    The title "Index" still on the right of the first column but :

    [warning] 'span' attribute on block ignored because the
    element is not a direct child of a flow

    I've change fo:block to fo:wrapper (as I found in Bob's book) in my
    chappendix.title template. The error disappeared but all my chapter
    title are left aligned.

    Thanks for you help,

    Jacques