Next in thread →
Next in month →
Re: [docbook-apps] Figure Reference in Text
I think want you want is this:
<figure id="circle">
<title>A circle which is used purely as example</title>
<mediaobject>
<imageobject>
<imagedata
fileref="/Samples/circle.jpg"/>
</imageobject>
<textobject><phrase>[some text for the HTML alt attribute</phrase></textobject>
</mediaobject>
</figure>
The stylesheets will automatically number your figure, so you don't
need to include a number. Then just use <xref linkend='circle'> to
reference it.
To have the xref show up in a different color, you need to create
and use a customization layer. To make that, create a new file --
call it fo.xsl -- and put this into it:
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version='1.0'>
<xsl:import href="http://docbook.sourceforge.net/release/xsl/current/fo/docbook.xsl"/>
<xsl:attribute-set name="xref.properties">
<xsl:attribute name="color">blue</xsl:attribute>
</xsl:attribute-set>
</xsl:stylesheet>
Replace "blue" with whatever color you want. Then call that
fo.xsl stylesheet instead of calling the docbook.xsl driver -
java org.apache.fop.apps.Fop -xml Test.xml -xsl fo.xsl -pdf Test.pdf
If you don't have catalogs set up, then instead put your local
system path to fo/docbook.xsl in your fo.xsl file; for example:
<xsl:import href="(J~/software/docbook-xsl-1.66.1/html/docbook.xsl"/>(B
For more details, see Bob Stayton's book -
http://www.sagehill.net/docbookxsl/CustomXrefs.html#CustomXrefStyle
Tristan Fiedler <> writes:
> Hi All,
>
> What is the 'proper' way to mark up the figure reference ('Figure 1'
> below) and the caption text which occurs in the text?
>
> I simply inserted a <para> child into <caption> to house the text. The
> <link> functions correctly in both HTML and PDF output.
>
> One other question is how can I color the link in the PDF output?
> Currently it is rendered in the same black color.
>
> For example,
>
> --------------------- Begin sample ------------------------------
>
>
> This is the first sentence. This is the second sentence, so now
> please look at <link linkend='fig 1'>Figure 1</link>. This graphic is
> a pretty picture of a circle. Many more sentences follow
>
> <mediaobject id='fig 1'>
> <imageobject>
> <imagedata
> fileref="/Samples/circle.jpg"/>
> </imageobject>
> <caption>
> <para>
> Figure 1. A circle which is used
> purely as example
> </para>
> </caption>
> </mediaobject>
>
>
> This is the next sentence. And so on and so on.
>
> --------------------- End sample ------------------------------
>
> Cheers,
>
> Tristan
Next in thread →
Next in month →