You want to enumerate your figures, tables, program listings, or examples consistently throughout your document.
Use a customization layer and insert the following template into your customization layer:
<xsl:template match="d:figure" mode="label.markup"> <xsl:choose> <xsl:when test="@label"> <xsl:value-of select="@label"/> </xsl:when> <xsl:otherwise> <xsl:number format="1" from="d:book|d:article" level="any"/> </xsl:otherwise> </xsl:choose> </xsl:template>
Matches | |
If the figure contains a | |
Calculates the number of the current |
The template shown in Example 2.4 matches only figure
s. It
can be extended to match also procedure
s,
tables
, examples
etc. If you do not need
the support for the label
attribute,
remove the xsl:choose
and its children, but leave the
xsl:number
element.
If you need a different numbering schema, modify the
format
attribute in the
xsl:number
start-tag. For example, if you write
[a]
you will get consecutive lowercase letters in
brackets like [a]
, [b]
,
[c]
etc.
Project@GitHub | Issue#7 |