docbook-apps

  • 1.  Re: [docbook-apps] Index heading always centered

    Posted 02-13-2007 09:34
    The simple answer is "yes", the index title is above the left column only. It is right-aligned in that column with your customization, but that looks sort of centered.

    Column spans in DocBook XSL turn out to be harder than they should be, because the XSL-FO 1.0 standard says that fo:blocks that span must be direct children of the fo:flow element. But DocBook XSL uses a lot of nested fo:blocks, for good reasons, so unnesting them to make a title span is pretty hard.

    Bob Stayton
    Sagehill Enterprises
    DocBook Consulting
    bobs@sagehill.net





  • 2.  AW: [docbook-apps] Index heading always centered

    Posted 02-13-2007 15:43
    I assume this means I can't change that behaviour right now.

    Are there plans for the future?



    Thanks,

    Hinrich



    _____

    Von: Bob Stayton [mailto:bobs@sagehill.net]
    Gesendet: Dienstag, 13. Februar 2007 10:34
    An: Hinrich Aue; docbook-apps@lists.oasis-open.org
    Betreff: Re: [docbook-apps] Index heading always centered



    The simple answer is "yes", the index title is above the left column only.
    It is right-aligned in that column with your customization, but that looks
    sort of centered.



    Column spans in DocBook XSL turn out to be harder than they should be,
    because the XSL-FO 1.0 standard says that fo:blocks that span must be direct
    children of the fo:flow element. But DocBook XSL uses a lot of nested
    fo:blocks, for good reasons, so unnesting them to make a title span is
    pretty hard.



    Bob Stayton
    Sagehill Enterprises
    DocBook Consulting
    bobs@sagehill.net








  • 3.  Re: AW: [docbook-apps] Index heading always centered

    Posted 02-13-2007 19:15
    Hinrich Aue wrote:
    > I assume this means I can't change that behaviour right now.

    As always, you can override original template <xsl:template
    match="book/index|part/index">. For example:


    <xsl:template match="book/index|part/index">
    <xsl:variable name="id">
    <xsl:call-template name="object.id"/>
    </xsl:variable>

    <xsl:if test="$generate.index != 0">
    <xsl:variable name="master-reference">
    <xsl:call-template name="select.pagemaster">
    <xsl:with-param name="pageclass">
    <xsl:if test="$make.index.markup != 0">body</xsl:if>
    </xsl:with-param>
    </xsl:call-template>
    </xsl:variable>

    <fo:page-sequence hyphenate="{$hyphenate}"
    master-reference="{$master-reference}">
    <xsl:attribute name="language">
    <xsl:call-template name="l10n.language"/>
    </xsl:attribute>
    <xsl:attribute name="format">
    <xsl:call-template name="page.number.format">
    <xsl:with-param name="master-reference" select="$master-reference"/>
    </xsl:call-template>
    </xsl:attribute>

    <xsl:attribute name="initial-page-number">
    <xsl:call-template name="initial.page.number">
    <xsl:with-param name="master-reference" select="$master-reference"/>
    </xsl:call-template>
    </xsl:attribute>

    <xsl:attribute name="force-page-count">
    <xsl:call-template name="force.page.count">
    <xsl:with-param name="master-reference" select="$master-reference"/>
    </xsl:call-template>
    </xsl:attribute>

    <xsl:attribute name="hyphenation-character">
    <xsl:call-template name="gentext">
    <xsl:with-param name="key" select="'hyphenation-character'"/>
    </xsl:call-template>
    </xsl:attribute>
    <xsl:attribute name="hyphenation-push-character-count">
    <xsl:call-template name="gentext">
    <xsl:with-param name="key"
    select="'hyphenation-push-character-count'"/>
    </xsl:call-template>
    </xsl:attribute>
    <xsl:attribute name="hyphenation-remain-character-count">
    <xsl:call-template name="gentext">
    <xsl:with-param name="key"
    select="'hyphenation-remain-character-count'"/>
    </xsl:call-template>
    </xsl:attribute>

    <xsl:apply-templates select="." mode="running.head.mode">
    <xsl:with-param name="master-reference" select="$master-reference"/>
    </xsl:apply-templates>
    <xsl:apply-templates select="." mode="running.foot.mode">
    <xsl:with-param name="master-reference" select="$master-reference"/>
    </xsl:apply-templates>

    <fo:flow flow-name="xsl-region-body">
    <xsl:call-template name="set.flow.properties">
    <xsl:with-param name="element" select="local-name(.)"/>
    <xsl:with-param name="master-reference" select="$master-reference"/>
    </xsl:call-template>

    <fo:block id="{$id}" span="all">
    <xsl:call-template name="index.titlepage"/>
    </fo:block>
    <xsl:apply-templates/>
    <xsl:if test="count(indexentry) = 0 and count(indexdiv) = 0">

    <xsl:choose>
    <xsl:when test="$make.index.markup != 0">
    <fo:block wrap-option='no-wrap'
    white-space-collapse='false'
    xsl:use-attribute-sets="monospace.verbatim.properties"
    linefeed-treatment="preserve">
    <xsl:call-template name="generate-index-markup">
    <xsl:with-param name="scope"
    select="(ancestor::book|/)[last()]"/>
    </xsl:call-template>
    </fo:block>
    </xsl:when>
    <xsl:when test="indexentry|indexdiv/indexentry">
    <xsl:apply-templates/>
    </xsl:when>
    <xsl:otherwise>
    <xsl:call-template name="generate-index">
    <xsl:with-param name="scope"
    select="(ancestor::book|/)[last()]"/>
    </xsl:call-template>
    </xsl:otherwise>
    </xsl:choose>
    </xsl:if>
    </fo:flow>
    </fo:page-sequence>
    </xsl:if>
    </xsl:template>



    --
    ------------------------------------------------------------------
    Jirka Kosek e-mail: jirka@kosek.cz http://xmlguru.cz
    ------------------------------------------------------------------
    Professional XML consulting and training services
    DocBook customization, custom XSLT/XSL-FO document processing
    ------------------------------------------------------------------
    OASIS DocBook TC member, W3C Invited Expert, ISO/JTC1/SC34 member
    ------------------------------------------------------------------
    Want to speak at XML Prague 2007 => http://xmlprague.cz/cfp.html