2 <!--#############################################################################
3 | $Id: formal.mod.xsl,v 1.1 2003/04/30 21:39:49 ab Exp $
4 |- #############################################################################
8 + ############################################################################## -->
10 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
11 xmlns:doc="http://nwalsh.com/xsl/documentation/1.0"
12 exclude-result-prefixes="doc" version='1.0'>
16 <!--############################################################################# -->
17 <!-- DOCUMENTATION -->
18 <doc:reference id="formal" xmlns="">
20 <releaseinfo role="meta">
21 $Id: formal.mod.xsl,v 1.1 2003/04/30 21:39:49 ab Exp $
24 <author> <firstname>Ramon</firstname> <surname>Casellas</surname> </author>
25 <author> <firstname>James</firstname> <surname>Devenish</surname> </author>
28 <year>2000</year> <year>2001</year> <year>2002</year> <year>2003</year>
29 <holder>Ramon Casellas</holder>
33 <title>Formal Objects <filename>formal.mod.xsl</filename></title>
35 <section><title>Introduction</title>
44 <xsl:template name="formal.object">
45 <xsl:call-template name="formal.object.heading">
46 <xsl:with-param name="title"><xsl:apply-templates select="." mode="title.ref"/></xsl:with-param>
48 <xsl:apply-templates/>
51 <xsl:template name="formal.object.heading">
52 <xsl:param name="title"></xsl:param>
53 <xsl:call-template name="label.id"/>
54 <xsl:copy-of select="$title"/>
57 <xsl:template name="informal.object">
58 <xsl:call-template name="label.id"/>
59 <xsl:apply-templates/>
62 <xsl:template name="semiformal.object">
64 <xsl:when test="title"> <xsl:call-template name="formal.object"/> </xsl:when>
65 <xsl:otherwise> <xsl:call-template name="informal.object"/></xsl:otherwise>
70 <xsl:template name="generate.formal.title.placement">
71 <xsl:param name="object" select="figure" />
72 <xsl:variable name="param.placement" select="substring-after(normalize-space($formal.title.placement),concat($object, ' '))"/>
74 <xsl:when test="contains($param.placement, ' ')">
75 <xsl:value-of select="substring-before($param.placement, ' ')"/>
77 <xsl:when test="$param.placement = ''">before</xsl:when>
79 <xsl:value-of select="$param.placement"/>
87 <!-- ======================================== -->
88 <!-- XSL Template for DocBook Equation Element -->
89 <!-- 2003/07/04 Applied patches from J.Pavlovic -->
90 <!-- ======================================== -->
91 <xsl:template match="equation">
92 <!-- Equation title placement -->
93 <xsl:variable name="placement">
94 <xsl:call-template name="generate.formal.title.placement">
95 <xsl:with-param name="object" select="local-name(.)" />
98 <!-- Equation caption -->
99 <xsl:variable name="caption">
100 <xsl:text>\caption{</xsl:text>
101 <xsl:apply-templates select="title" mode="caption.mode"/>
102 <xsl:text>} </xsl:text>
104 <xsl:call-template name="map.begin"/>
105 <xsl:if test="$placement='before'">
106 <xsl:text>\captionswapskip{}</xsl:text>
107 <xsl:value-of select="$caption" />
108 <xsl:text>\captionswapskip{}</xsl:text>
111 <xsl:when test="informalequation">
112 <xsl:apply-templates select="informalequation"/>
115 <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']"/>
117 <xsl:when test="$tex">
118 <xsl:apply-templates select="$tex"/>
120 <xsl:when test="alt and $latex.alt.is.preferred='1'">
121 <xsl:apply-templates select="alt"/>
123 <xsl:when test="mediaobject">
124 <xsl:apply-templates select="mediaobject"/>
126 <xsl:when test="alt">
127 <xsl:apply-templates select="alt"/>
130 <xsl:apply-templates select="graphic"/>
135 <xsl:if test="$placement!='before'"><xsl:value-of select="$caption" /></xsl:if>
136 <xsl:call-template name="map.end"/>
140 <xsl:template match="equation/title"/>
146 <xsl:template match="informalequation">
147 <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']"/>
148 <xsl:text> </xsl:text>
150 <xsl:when test="$tex">
151 <xsl:apply-templates select="$tex"/>
153 <xsl:when test="alt and $latex.alt.is.preferred='1'">
154 <xsl:apply-templates select="alt"/>
156 <xsl:when test="mediaobject">
157 <xsl:apply-templates select="mediaobject"/>
159 <xsl:when test="alt">
160 <xsl:apply-templates select="alt"/>
163 <xsl:apply-templates select="graphic"/>
166 <xsl:text> </xsl:text>