2 <!--#############################################################################
3 | $Id: texmath.mod.xsl,v 1.1 2003/04/30 21:39:49 ab Exp $
4 |- #############################################################################
8 + ############################################################################## -->
12 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
13 xmlns:doc="http://nwalsh.com/xsl/documentation/1.0"
14 exclude-result-prefixes="doc" version='1.0'>
18 <!--############################################################################# -->
19 <!-- DOCUMENTATION -->
20 <doc:reference id="texmath" xmlns="">
22 <releaseinfo role="meta">
23 $Id: texmath.mod.xsl,v 1.1 2003/04/30 21:39:49 ab Exp $
26 <author> <firstname>Ramon</firstname> <surname>Casellas</surname> </author>
27 <author> <firstname>James</firstname> <surname>Devenish</surname> </author>
30 <year>2000</year> <year>2001</year> <year>2002</year> <year>2003</year>
31 <holder>Ramon Casellas</holder>
35 <title>LaTeX Only Commands <filename>texmath.mod.xsl</filename></title>
37 <section><title>Introduction</title>
43 <xsl:template match="alt">
45 <xsl:when test="ancestor::inlineequation and (@role='tex' or @role='latex' or $latex.alt.is.latex='1')">
46 <xsl:text>\ensuremath{</xsl:text>
47 <xsl:value-of select="."/>
48 <xsl:text>}</xsl:text>
50 <xsl:when test="ancestor::equation|ancestor::informalequation and (@role='tex' or @role='latex' or $latex.alt.is.latex='1')">
51 <xsl:text>\begin{displaymath}</xsl:text>
52 <xsl:call-template name="label.id"/>
53 <xsl:value-of select="."/>
54 <xsl:text>\end{displaymath} </xsl:text>
56 <xsl:when test="$latex.alt.is.latex='1'">
57 <xsl:value-of select="."/>
60 <xsl:apply-templates/>
65 <xsl:template match="latex|tex">
66 <xsl:value-of select="."/>
69 <xsl:template match="latex[@fileref]">
70 <xsl:text>\input{</xsl:text><xsl:value-of select="@fileref"/><xsl:text>} </xsl:text>
73 <xsl:template match="tex[@fileref]">
74 <xsl:text>\input{</xsl:text><xsl:value-of select="@fileref"/><xsl:text>} </xsl:text>
78 <xsl:template match="tm[@fileref]">
79 <xsl:text>\input{</xsl:text><xsl:value-of select="@fileref"/><xsl:text>} </xsl:text>
82 <xsl:template match="tm[@tex]">
83 <xsl:value-of select="@tex"/>
86 <xsl:template match="inlinetm[@fileref]">
87 <xsl:text>\input{</xsl:text><xsl:value-of select="@fileref"/><xsl:text>} </xsl:text>
90 <xsl:template match="inlinetm[@tex]">
91 <xsl:value-of select="@tex"/>
95 <xsl:template match="inlineequation">
96 <xsl:variable name="tex" select="alt[@role='tex' or @role='latex']|inlinemediaobject/textobject[@role='tex' or @role='latex']|inlinemediaobject/textobject/phrase[@role='tex' or @role='latex']" />
98 <xsl:when test="$tex">
99 <xsl:apply-templates select="$tex"/>
101 <xsl:when test="alt and $latex.alt.is.preferred='1'">
102 <xsl:apply-templates select="alt"/>
104 <xsl:when test="inlinemediaobject">
105 <xsl:apply-templates select="inlinemediaobject"/>
107 <xsl:when test="alt">
108 <xsl:apply-templates select="alt"/>
111 <xsl:apply-templates select="graphic"/>