2 <!--#############################################################################
3 |- #############################################################################
6 + ############################################################################## -->
8 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
9 xmlns:doc="http://nwalsh.com/xsl/documentation/1.0"
10 exclude-result-prefixes="doc" version='1.0'>
14 <!--############################################################################# -->
15 <!-- DOCUMENTATION -->
16 <doc:reference id="formal" xmlns="">
18 <releaseinfo role="meta">
21 <author> <firstname>Ramon</firstname> <surname>Casellas</surname> </author>
22 <author> <firstname>James</firstname> <surname>Devenish</surname> </author>
25 <year>2000</year> <year>2001</year> <year>2002</year> <year>2003</year>
26 <holder>Ramon Casellas</holder>
30 <title>Formal Objects <filename>formal.mod.xsl</filename></title>
32 <section><title>Introduction</title>
41 <xsl:template name="formal.object">
42 <xsl:call-template name="formal.object.heading">
43 <xsl:with-param name="title"><xsl:apply-templates select="." mode="title.ref"/></xsl:with-param>
45 <xsl:apply-templates/>
48 <xsl:template name="formal.object.heading">
49 <xsl:param name="title"></xsl:param>
50 <xsl:call-template name="label.id"/>
51 <xsl:copy-of select="$title"/>
54 <xsl:template name="informal.object">
55 <xsl:call-template name="label.id"/>
56 <xsl:apply-templates/>
59 <xsl:template name="semiformal.object">
61 <xsl:when test="title"> <xsl:call-template name="formal.object"/> </xsl:when>
62 <xsl:otherwise> <xsl:call-template name="informal.object"/></xsl:otherwise>
67 <xsl:template name="generate.formal.title.placement">
68 <xsl:param name="object" select="figure" />
69 <xsl:variable name="param.placement" select="substring-after(normalize-space($formal.title.placement),concat($object, ' '))"/>
71 <xsl:when test="contains($param.placement, ' ')">
72 <xsl:value-of select="substring-before($param.placement, ' ')"/>
74 <xsl:when test="$param.placement = ''">before</xsl:when>
76 <xsl:value-of select="$param.placement"/>
84 <!-- ======================================== -->
85 <!-- XSL Template for DocBook Equation Element -->
86 <!-- 2003/07/04 Applied patches from J.Pavlovic -->
87 <!-- ======================================== -->
88 <xsl:template match="equation">
89 <!-- Equation title placement -->
90 <xsl:variable name="placement">
91 <xsl:call-template name="generate.formal.title.placement">
92 <xsl:with-param name="object" select="local-name(.)" />
95 <!-- Equation caption -->
96 <xsl:variable name="caption">
97 <xsl:text>\caption{</xsl:text>
98 <xsl:apply-templates select="title" mode="caption.mode"/>
99 <xsl:text>} </xsl:text>
101 <xsl:call-template name="map.begin"/>
102 <xsl:if test="$placement='before'">
103 <xsl:text>\captionswapskip{}</xsl:text>
104 <xsl:value-of select="$caption" />
105 <xsl:text>\captionswapskip{}</xsl:text>
108 <xsl:when test="informalequation">
109 <xsl:apply-templates select="informalequation"/>
112 <xsl:variable name="tex" select="alt[@role='tex' or @role='latex']|mediaobject/textobject[@role='tex' or @role='latex']|mediaobject/textobject/phrase[@role='tex' or @role='latex']"/>
114 <xsl:when test="$tex">
115 <xsl:apply-templates select="$tex"/>
117 <xsl:when test="alt and $latex.alt.is.preferred='1'">
118 <xsl:apply-templates select="alt"/>
120 <xsl:when test="mediaobject">
121 <xsl:apply-templates select="mediaobject"/>
123 <xsl:when test="alt">
124 <xsl:apply-templates select="alt"/>
127 <xsl:apply-templates select="graphic"/>
132 <xsl:if test="$placement!='before'"><xsl:value-of select="$caption" /></xsl:if>
133 <xsl:call-template name="map.end"/>
137 <xsl:template match="equation/title"/>
143 <xsl:template match="informalequation">
144 <xsl:variable name="tex" select="alt[@role='tex' or @role='latex']|mediaobject/textobject[@role='tex' or @role='latex']|mediaobject/textobject/phrase[@role='tex' or @role='latex']"/>
145 <xsl:text> </xsl:text>
147 <xsl:when test="$tex">
148 <xsl:apply-templates select="$tex"/>
150 <xsl:when test="alt and $latex.alt.is.preferred='1'">
151 <xsl:apply-templates select="alt"/>
153 <xsl:when test="mediaobject">
154 <xsl:apply-templates select="mediaobject"/>
156 <xsl:when test="alt">
157 <xsl:apply-templates select="alt"/>
160 <xsl:apply-templates select="graphic"/>
163 <xsl:text> </xsl:text>