w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Docbook: Chapter number and word "Chapter" in header

Try the following (trying because I am not too familiar with DocBook):

Add

<xsl:apply-templates select="."
mode="object.title.markup"/>

to the header.content template. This should insert the "chapter title with chapter number label". See the Docbook documentation reference here.

<xsl:template name="header.content">
    <xsl:param name="pageclass" select="''"/>
    <xsl:param name="sequence" select="''"/>
    <xsl:param name="position" select="''"/>
    <xsl:param name="gentext-key" select="''"/>

  <fo:block>

    <!-- sequence can be odd, even, first, blank -->
    <!-- position can be left, center, right -->
    <xsl:choose>
      <xsl:when test="$sequence = 'blank'">
        <!-- nothing -->
      </xsl:when>

      <xsl:when test="$position='left'">
        <xsl:call-template name="draft.text"/>
        <xsl:text>Chapter </xsl:text>
        <xsl:apply-templates select="." mode="object.title.markup"/>
        </xsl:text> </xsl:text>
        </xsl:when>
    </xsl:choose>
    <xsl:when test="$position='right'">
       <fo:page-number/>
     </xsl:when>
  </fo:block>
</xsl:template>

But note that there might be a difference between title.markup and titleabbrev.markup.





© Copyright 2018 w3hello.com Publishing Limited. All rights reserved.