docbook-apps

[docbook-apps] Re: xref titles in italics for sections etc.

  • 1.  [docbook-apps] Re: xref titles in italics for sections etc.

    Posted 08-07-2008 19:24
    
    
    Thank you Bob.  That of course was the problem.  This works fine.
    I must remember that I need to think a little when I copy one of your recipes!

    <!-- Make all sect cross reference titles appear in italic -->
    <!-- by default chapters are italicized but all sect cross references are not in italic -->
      <xsl:template match="d:sect1|d:sect2|d:sect3|d:sect4|d:sect5|d:section" mode="insert.title.markup">
       
    <xsl:param name="purpose"/>
       
    <xsl:param name="xrefstyle"/>
       
    <xsl:param name="title"/>
       
    <xsl:choose>
         
    <xsl:when test="$purpose='xref'">
           
    <fo:inline font-style="italic">
             
    <xsl:copy-of select="$title"/>
           
    </fo:inline>
         
    </xsl:when>
         
    <xsl:otherwise>
           
    <xsl:copy-of select="$title"/>
         
    </xsl:otherwise>
       
    </xsl:choose>
     
    </xsl:template>


    First question: are you using the docbook 5 namespaced stylesheets?  If so, the element names in the match need to have the namespace prefix.
     
    Bob Stayton
    Sagehill Enterprises
    bobs@sagehill.net
     
     
    ----- Original Message -----
    From: ron@catterall.net">Ron Catterall
    To: docbook-apps@lists.oasis-open.org
    Cc: bobs@sagehill.net
    Sent: Wednesday, August 06, 2008 12:44 PM
    Subject: xref titles in italics for sections etc.

    Apologies I sent this earlier without a title line

     can't get this to work, there is an unused parameter, $xrefstyle, is something missing in the template?

    <!-- Make all cross reference titles appear in italic -->
    <!-- by default chapters are italicised but all sect cross references are not in italic -->
    <!-- p.247 of 3rd. ed. and p.271 of 4th. ed. of "DocBook XSL The Complete Guide" -->
     
    <xsl:template match="sect1|sect2|sect3|sect4|sect5|section" mode="insert.title.markup">
       
    <xsl:param name="purpose"/>
       
    <xsl:param name="xrefstyle"/>
       
    <xsl:param name="title"/>
       
    <xsl:choose>
         
    <xsl:when test="$purpose='xref'">
           
    <fo:inline font-style="italic">
             
    <xsl:copy-of select="$title"/>
           
    </fo:inline>
         
    </xsl:when>
         
    <xsl:otherwise>
           
    <xsl:copy-of select="$title"/>
         
    </xsl:otherwise>
       
    </xsl:choose>
     
    </xsl:template>
    --
    Ron Catterall, Phd, DSc       email: ron@catterall.net
    Prolongacion de Hidalgo 140http://catterall.net/
    San Felipe del Aguatel: +52 951 520 1821
    Oaxaca      68020Mexicofax: +1 530 348 8309


    Ron Catterall, Phd, DSc       email: ron@catterall.net
    Prolongacion de Hidalgo 140http://catterall.net/
    San Felipe del Aguatel: +52 951 520 1821
    Oaxaca      68020Mexicofax: +1 530 348 8309