docbook-apps

Re: [docbook-apps] make bold all the xref labels? (Customizing xref style)

  • 1.  Re: [docbook-apps] make bold all the xref labels? (Customizing xref style)

    Posted 11-27-2009 07:29
    Hi Robert,
    I wasn't sure how to respond to this message when you said:

    > Both methods, of course, are over my head.

    Are you familiar with the process of creating a customization layer for
    DocBook XSL? If not, that process is described here:

    http://www.sagehill.net/docbookxsl/CustomMethods.html#CustomizationLayer

    If so, are you familiar with the use of attribute-sets? If not, those are
    described here:

    http://www.sagehill.net/docbookxsl/AttributeSets.html

    You can customize the attribute-set named 'xref.properties' in your
    customization layer to set the bold property:

    <xsl:attribute-set name="xref.properties">
    <xsl:attribute name="font-weight">bold</xsl:attribute>
    </xsl:attribute-set>

    You can add whatever XSL-FO properties are appropriate for inline text. See
    a good reference on XSL-FO for documentation on such properties.

    Bob Stayton
    Sagehill Enterprises
    bobs@sagehill.net


    ----- Original Message -----
    From: "Robert Nagle" <idiotprogrammer@gmail.com>
    To: <docbook-apps@lists.oasis-open.org>
    Sent: Wednesday, November 18, 2009 12:34 PM
    Subject: [docbook-apps] make bold all the xref labels? (Customizing xref
    style)


    > I'm trying to figure out how to make bold all the xref labels in my
    > printed PDF.
    >
    > IN Chapter 15 of the XSL book p264 4th edition, there is a section on
    > Customizing Cross Reference Typography.
    > http://www.sagehill.net/docbookxsl/CustomXrefs.html#CustomXrefStyle
    >
    > But I'm not sure what it means or how to actually implement it.
    >
    >
    > Two methods are suggested. The first is using the insert.title.markup
    > mode (whatever that is). The second method (which is more global) lets
    > you use the xref.properties set. Both methods, of course, are over my
    > head.
    >
    > Let's try the second method, which seems easier.
    >
    > What is xref.properties? The example given lists name="color" and a
    > test for it. I don't recognize the name="color" attribute here. What
    > other attributes could you use here? Is there some kind of reference
    > for what can go inside xref.properties?
    >
    > The earlier example in the same section shows a stylesheet
    > customization that looks inside sect1 or section and whenever it sees
    > an xref, it inserts an FO statement when the $purpose="xref":
    >
    > <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>
    >
    >
    > But I don't understand purpose='xref' here. What is purpose and how
    > would a writer specify this? Did this template just create
    > name="purpose" out of thin air or is this something already described
    > in a stylesheet? In fact, the first part of this doesn't make sense at
    > all to me; can anyone explain what is going on with purpose and
    > mode="insert.title.markup" (I recognize xrefstyle and title but not
    > the rest).
    >
    > Thanks for your help.
    >
    > Robert
    >
    >
    > --
    > Robert Nagle
    > htpt://www.robertnagle.info
    >
    > ---------------------------------------------------------------------
    > To unsubscribe, e-mail: docbook-apps-unsubscribe@lists.oasis-open.org
    > For additional commands, e-mail: docbook-apps-help@lists.oasis-open.org
    >
    >
    >