2 <!--#############################################################################
3 | $Id: figure.mod.xsl,v 1.1 2003/04/30 21:39:49 ab Exp $
4 |- #############################################################################
7 | PURPOSE: Template for figure tag.
8 + ############################################################################## -->
11 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
12 xmlns:doc="http://nwalsh.com/xsl/documentation/1.0"
13 exclude-result-prefixes="doc" version='1.0'>
15 <!--############################################################################# -->
16 <!-- DOCUMENTATION -->
17 <doc:reference id="figure" xmlns="">
19 <releaseinfo role="meta">
20 $Id: figure.mod.xsl,v 1.1 2003/04/30 21:39:49 ab Exp $
23 <author> <firstname>Ramon</firstname> <surname>Casellas</surname> </author>
24 <author> <firstname>James</firstname> <surname>Devenish</surname> </author>
27 <year>2000</year> <year>2001</year> <year>2002</year> <year>2003</year>
28 <holder>Ramon Casellas</holder>
32 <title>Figures and InformalFigures <filename>figure.mod.xsl</filename></title>
34 <section><title>Introduction</title>
39 <!--############################################################################# -->
44 <!--############################################################################# -->
45 <doc:template match="figure|informalfigure" xmlns="">
46 <refpurpose> XSL template for figure|informalfigure </refpurpose>
48 <para>Outputs <literal>\begin{figure}</literal>,
49 applies templates and outputs <literal>\end{figure}</literal>. </para>
50 <formalpara><title>Remarks and Bugs</title>
52 <listitem><para>The <literal>figure.title</literal> can be typset in italics by specifying <literal>$latex.figure.title.style</literal> (<literal>\itshape</literal> would be common).</para></listitem>
53 <listitem><para>If a <literal>figure.mediaobject.caption</literal> exists, it will be typeset after the <literal>figure.title</literal> (but only if there is a single <literal>figure.mediaobject.caption</literal>).</para></listitem>
58 <!--############################################################################# -->
61 <!-- Auxiliary template to output a figure caption.-->
62 <xsl:template name="aux.figure.caption">
63 <xsl:text>\caption{{</xsl:text>
64 <xsl:value-of select="$latex.figure.title.style"/>
65 <xsl:text>{</xsl:text>
66 <xsl:apply-templates select="title"/>
67 <xsl:text>}}</xsl:text>
68 <xsl:if test="count(child::mediaobject/caption)=1">
69 <xsl:text>. </xsl:text>
70 <xsl:apply-templates select="mediaobject/caption" />
72 <xsl:text>} </xsl:text>
75 <xsl:template match="figure|informalfigure">
76 <xsl:variable name="placement">
77 <xsl:call-template name="generate.formal.title.placement">
78 <xsl:with-param name="object" select="local-name(.)" />
81 <xsl:call-template name="map.begin"/>
82 <xsl:if test="$placement='before'">
83 <xsl:text>\captionswapskip{}</xsl:text>
84 <xsl:call-template name="aux.figure.caption" />
85 <xsl:text>\captionswapskip{}</xsl:text>
87 <xsl:apply-templates select="*[name(.) != 'title']"/>
88 <xsl:if test="$placement!='before'">
89 <xsl:call-template name="aux.figure.caption" />
91 <xsl:call-template name="map.end"/>
96 <!--############################################################################# -->
98 <doc:template match="figure[programlisting]" xmlns="">
99 <refpurpose> XSL template for programlisting within a figure </refpurpose>
101 <para>Outputs <literal>\begin{figure}</literal>,
102 applies templates and outputs <literal>\end{abstract}</literal>. </para>
103 <formalpara><title>Remarks and Bugs</title>
110 <!--############################################################################# -->
113 <xsl:template match="figure[programlisting]">
114 <xsl:call-template name="map.begin">
115 <xsl:with-param name="keyword" select="programlisting"/>
117 <xsl:apply-templates />
118 <xsl:call-template name="map.end">
119 <xsl:with-param name="keyword" select="programlisting"/>
124 <xsl:template match="figure/title">
125 <xsl:apply-templates/>
128 <xsl:template match="informalfigure/title">