f23689608adb48e24f4d8d530c3d422bd7d51f77
[abartlet/samba.git/.git] / docs / docbook / xslt / db2latex / figure.mod.xsl
1 <?xml version='1.0'?>
2 <!--############################################################################# 
3 |       $Id: figure.mod.xsl,v 1.1 2003/04/30 21:39:49 ab Exp $
4 |- #############################################################################
5 |       $Author: ab $                                                                                           
6 |                                                                                                               
7 |   PURPOSE: Template for figure tag.
8 + ############################################################################## -->
9
10 <xsl:stylesheet 
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'>
14
15     <!--############################################################################# -->
16     <!-- DOCUMENTATION                                                                -->
17     <doc:reference id="figure" xmlns="">
18         <referenceinfo>
19             <releaseinfo role="meta">
20                 $Id: figure.mod.xsl,v 1.1 2003/04/30 21:39:49 ab Exp $
21             </releaseinfo>
22         <authorgroup>
23             <author> <firstname>Ramon</firstname> <surname>Casellas</surname> </author>
24             <author> <firstname>James</firstname> <surname>Devenish</surname> </author>
25         </authorgroup>
26             <copyright>
27                 <year>2000</year> <year>2001</year> <year>2002</year> <year>2003</year>
28                 <holder>Ramon Casellas</holder>
29             </copyright>
30         </referenceinfo>
31
32         <title>Figures and InformalFigures <filename>figure.mod.xsl</filename></title>
33         <partintro>
34             <section><title>Introduction</title>
35                 <para></para>
36             </section>
37         </partintro>
38     </doc:reference>
39     <!--############################################################################# -->
40
41
42
43
44     <!--############################################################################# -->
45     <doc:template match="figure|informalfigure" xmlns="">
46         <refpurpose> XSL template for figure|informalfigure  </refpurpose>
47         <refdescription>
48             <para>Outputs <literal>\begin{figure}</literal>,
49                 applies templates and outputs <literal>\end{figure}</literal>. </para>
50             <formalpara><title>Remarks and Bugs</title>
51                 <itemizedlist>
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>
54                 </itemizedlist>
55             </formalpara>
56         </refdescription>
57     </doc:template>
58     <!--############################################################################# -->
59
60
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" />
71 </xsl:if>
72 <xsl:text>}&#10;</xsl:text>
73 </xsl:template>
74
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(.)" />
79                 </xsl:call-template>
80         </xsl:variable>
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>
86         </xsl:if>
87         <xsl:apply-templates select="*[name(.) != 'title']"/>
88         <xsl:if test="$placement!='before'">
89                 <xsl:call-template name="aux.figure.caption" />
90         </xsl:if>
91         <xsl:call-template name="map.end"/>
92 </xsl:template>
93
94
95
96     <!--############################################################################# -->
97         <!--
98     <doc:template match="figure[programlisting]" xmlns="">
99         <refpurpose> XSL template for programlisting within a figure </refpurpose>
100         <refdescription>
101             <para>Outputs <literal>\begin{figure}</literal>,
102                 applies templates and outputs <literal>\end{abstract}</literal>. </para>
103             <formalpara><title>Remarks and Bugs</title>
104                 <itemizedlist>
105                 </itemizedlist>
106             </formalpara>
107         </refdescription>
108     </doc:template>
109         -->
110     <!--############################################################################# -->
111
112         <!--
113     <xsl:template match="figure[programlisting]">
114         <xsl:call-template name="map.begin">
115             <xsl:with-param name="keyword" select="programlisting"/>
116         </xsl:call-template>
117         <xsl:apply-templates />
118         <xsl:call-template name="map.end">
119             <xsl:with-param name="keyword" select="programlisting"/>
120         </xsl:call-template>
121     </xsl:template>
122         -->
123
124     <xsl:template match="figure/title">
125         <xsl:apply-templates/>
126         </xsl:template>
127
128     <xsl:template match="informalfigure/title">
129         </xsl:template>
130 </xsl:stylesheet>