trying to get HEAD building again. If you want the code
[nivanova/samba-autobuild/.git] / docs / docbook / xslt / db2latex / texmath.mod.xsl
1 <?xml version='1.0'?>
2 <!--############################################################################# 
3 |- #############################################################################
4 |                                                                                                               
5 |   PURPOSE:
6 + ############################################################################## -->
7
8
9 <xsl:stylesheet 
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'>
13
14
15
16     <!--############################################################################# -->
17     <!-- DOCUMENTATION                                                                -->
18     <doc:reference id="texmath" xmlns="">
19         <referenceinfo>
20             <releaseinfo role="meta">
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>LaTeX Only Commands <filename>texmath.mod.xsl</filename></title>
33         <partintro>
34             <section><title>Introduction</title>
35                 <para></para>
36             </section>
37         </partintro>
38     </doc:reference>
39
40     <xsl:template match="alt">
41         <xsl:choose>
42                 <xsl:when test="ancestor::inlineequation and (@role='tex' or @role='latex' or $latex.alt.is.latex='1')">
43                         <xsl:text>\ensuremath{</xsl:text>
44                         <xsl:value-of select="."/>
45                         <xsl:text>}</xsl:text>
46                 </xsl:when>
47                 <xsl:when test="ancestor::equation|ancestor::informalequation and (@role='tex' or @role='latex' or $latex.alt.is.latex='1')">
48                         <xsl:text>\begin{displaymath}</xsl:text>
49                         <xsl:call-template name="label.id"/>
50                         <xsl:value-of select="."/>
51                         <xsl:text>\end{displaymath}&#10;</xsl:text>
52                 </xsl:when>
53                 <xsl:when test="$latex.alt.is.latex='1'">
54                         <xsl:value-of select="."/>
55                 </xsl:when>
56                 <xsl:otherwise>
57                         <xsl:apply-templates/>
58                 </xsl:otherwise>
59         </xsl:choose>
60     </xsl:template>
61
62     <xsl:template match="latex|tex">
63         <xsl:value-of select="."/>
64     </xsl:template>
65
66     <xsl:template match="latex[@fileref]">
67         <xsl:text>\input{</xsl:text><xsl:value-of select="@fileref"/><xsl:text>}&#10;</xsl:text>
68     </xsl:template>
69
70     <xsl:template match="tex[@fileref]">
71         <xsl:text>\input{</xsl:text><xsl:value-of select="@fileref"/><xsl:text>}&#10;</xsl:text>
72     </xsl:template>
73
74
75     <xsl:template match="tm[@fileref]">
76         <xsl:text>\input{</xsl:text><xsl:value-of select="@fileref"/><xsl:text>}&#10;</xsl:text>
77     </xsl:template>
78
79     <xsl:template match="tm[@tex]">
80         <xsl:value-of select="@tex"/>
81     </xsl:template>
82
83     <xsl:template match="inlinetm[@fileref]">
84         <xsl:text>\input{</xsl:text><xsl:value-of select="@fileref"/><xsl:text>}&#10;</xsl:text>
85     </xsl:template>
86
87     <xsl:template match="inlinetm[@tex]">
88         <xsl:value-of select="@tex"/>
89     </xsl:template>
90
91
92         <xsl:template match="inlineequation">
93         <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']" />
94         <xsl:choose>
95                 <xsl:when test="$tex">
96                         <xsl:apply-templates select="$tex"/>
97                 </xsl:when>
98                 <xsl:when test="alt and $latex.alt.is.preferred='1'">
99                         <xsl:apply-templates select="alt"/>
100                 </xsl:when>
101                 <xsl:when test="inlinemediaobject">
102                         <xsl:apply-templates select="inlinemediaobject"/>
103                 </xsl:when>
104                 <xsl:when test="alt">
105                         <xsl:apply-templates select="alt"/>
106                 </xsl:when>
107                 <xsl:otherwise>
108                         <xsl:apply-templates select="graphic"/>
109                 </xsl:otherwise>
110         </xsl:choose>
111         </xsl:template>
112
113
114
115
116
117 </xsl:stylesheet>