docbook-apps

styling captions + spacing (FO + Docbook 5)

  • 1.  styling captions + spacing (FO + Docbook 5)

    Posted 09-08-2010 14:34
    I'm in Docbook 5, using xep/pdf, and i'm looking for a way to style
    captions and remove the space between the imageobject and the caption.

    Chapter 18 covers how to customize the caption for FO (allegedly).

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

    <xsl:template match="caption">
    <fo:block>
    <xsl:apply-templates/>
    </fo:block>
    </xsl:template>

    Ok, there are multiple cobwebs of my ignorance to untangle here. Let
    me throw out what I think I know:

    The book is saying that I need to add my customizations inside this
    fo:block statement.

    Therefore, I would assume that this addition to my customization layer
    would have some effect. In fact it has none:

    <xsl:template match="caption">
    <fo:block font-size="9pt" color="blue" font-family="Gentium">
    ..... (something I copied from the Internet)
    <xsl:apply-templates/>
    </fo:block>
    </xsl:template>

    To be honest, I don't think I even understand the XSL statement (as
    basic as it is). I'm supposed to apply-templates whenever i find an
    element that matches caption? Is there any need to put an xpath
    statement somewhere? Does "caption" in this example in fact refer to
    the element named caption, or is it a custom template called "caption"
    which handles styling of the caption element?

    As I mentioned, i want to reduce the space between the image and
    caption (and maybe add spacing).



    On the mailing list in 2007 Bob Stayton mentioned that text in caption
    could stand alone, but in Docbook 5.0, a caption requires a <para> tag
    inside for you to add text. That is adding extra space.

    As it stands now, the caption seems almost closer to the paragraph
    which follows than the image itself.

    Thanks.

    rj

    P.s. a parameter for this would really help!


    --
    Robert Nagle

    htpt://www.robertnagle.info