1 <?xml version="1.0" encoding="US-ASCII"?>
2 <!--This file was created automatically by html2xhtml-->
3 <!--from the HTML stylesheets. Do not edit this file.-->
4 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml" version="1.0">
6 <!-- ********************************************************************
8 ********************************************************************
10 This file is part of the XSL DocBook Stylesheet distribution.
11 See ../README or http://nwalsh.com/docbook/xsl/ for copyright
12 and other information.
14 ******************************************************************** -->
16 <xsl:template match="inlineequation">
17 <xsl:apply-templates/>
20 <xsl:template match="alt">
23 <xsl:template match="mathphrase">
24 <span class="{local-name(.)}">
25 <xsl:apply-templates/>
29 <!-- "Support" for MathML -->
31 <xsl:template xmlns:mml="http://www.w3.org/1998/Math/MathML" match="mml:*">
33 <xsl:copy-of select="@*"/>
34 <xsl:apply-templates/>
38 <!-- Support for TeX math in alt -->
40 <xsl:template match="*" mode="collect.tex.math">
41 <xsl:call-template name="write.text.chunk">
42 <xsl:with-param name="filename" select="$tex.math.file"/>
43 <xsl:with-param name="method" select="'text'"/>
44 <xsl:with-param name="content">
46 <xsl:when test="$tex.math.in.alt = 'plain'">
47 <xsl:call-template name="tex.math.plain.head"/>
48 <xsl:apply-templates select="." mode="collect.tex.math.plain"/>
49 <xsl:call-template name="tex.math.plain.tail"/>
51 <xsl:when test="$tex.math.in.alt = 'latex'">
52 <xsl:call-template name="tex.math.latex.head"/>
53 <xsl:apply-templates select="." mode="collect.tex.math.latex"/>
54 <xsl:call-template name="tex.math.latex.tail"/>
58 Unsupported TeX math notation:
59 <xsl:value-of select="$tex.math.in.alt"/>
64 <xsl:with-param name="encoding" select="$chunker.output.encoding"/>
70 <xsl:template name="tex.math.plain.head">
71 <xsl:text>\nopagenumbers
75 <xsl:template name="tex.math.plain.tail">
80 <xsl:template match="inlineequation" mode="collect.tex.math.plain">
81 <xsl:variable name="filename">
83 <xsl:when test="graphic">
84 <xsl:call-template name="mediaobject.filename">
85 <xsl:with-param name="object" select="graphic"/>
89 <xsl:call-template name="select.mediaobject.filename">
90 <xsl:with-param name="olist" select="inlinemediaobject/*"/>
95 <xsl:variable name="output.delims">
96 <xsl:call-template name="tex.math.output.delims"/>
98 <xsl:variable name="tex" select="alt[@role='tex'] | inlinemediaobject/textobject[@role='tex']"/>
100 <xsl:text>\special{dvi2bitmap outputfile </xsl:text>
101 <xsl:value-of select="$filename"/>
104 <xsl:if test="$output.delims != 0">
105 <xsl:text>$</xsl:text>
107 <xsl:value-of select="$tex"/>
108 <xsl:if test="$output.delims != 0">
112 <xsl:text>\vfill\eject
117 <xsl:template match="equation|informalequation" mode="collect.tex.math.plain">
118 <xsl:variable name="filename">
120 <xsl:when test="graphic">
121 <xsl:call-template name="mediaobject.filename">
122 <xsl:with-param name="object" select="graphic"/>
126 <xsl:call-template name="select.mediaobject.filename">
127 <xsl:with-param name="olist" select="mediaobject/*"/>
132 <xsl:variable name="output.delims">
133 <xsl:call-template name="tex.math.output.delims"/>
135 <xsl:variable name="tex" select="alt[@role='tex'] | mediaobject/textobject[@role='tex']"/>
137 <xsl:text>\special{dvi2bitmap outputfile </xsl:text>
138 <xsl:value-of select="$filename"/>
141 <xsl:if test="$output.delims != 0">
142 <xsl:text>$$</xsl:text>
144 <xsl:value-of select="$tex"/>
145 <xsl:if test="$output.delims != 0">
149 <xsl:text>\vfill\eject
154 <xsl:template match="text()" mode="collect.tex.math.plain"/>
158 <xsl:template name="tex.math.latex.head">
159 <xsl:text>\documentclass{article}
161 <xsl:text>\pagestyle{empty}
163 <xsl:text>\begin{document}
167 <xsl:template name="tex.math.latex.tail">
168 <xsl:text>\end{document}
172 <xsl:template match="inlineequation" mode="collect.tex.math.latex">
173 <xsl:variable name="filename">
175 <xsl:when test="graphic">
176 <xsl:call-template name="mediaobject.filename">
177 <xsl:with-param name="object" select="graphic"/>
181 <xsl:call-template name="select.mediaobject.filename">
182 <xsl:with-param name="olist" select="inlinemediaobject/*"/>
187 <xsl:variable name="output.delims">
188 <xsl:call-template name="tex.math.output.delims"/>
190 <xsl:variable name="tex" select="alt[@role='tex'] | inlinemediaobject/textobject[@role='tex']"/>
192 <xsl:text>\special{dvi2bitmap outputfile </xsl:text>
193 <xsl:value-of select="$filename"/>
196 <xsl:if test="$output.delims != 0">
197 <xsl:text>$</xsl:text>
199 <xsl:value-of select="$tex"/>
200 <xsl:if test="$output.delims != 0">
209 <xsl:template match="equation|informalequation" mode="collect.tex.math.latex">
210 <xsl:variable name="filename">
212 <xsl:when test="graphic">
213 <xsl:call-template name="mediaobject.filename">
214 <xsl:with-param name="object" select="graphic"/>
218 <xsl:call-template name="select.mediaobject.filename">
219 <xsl:with-param name="olist" select="mediaobject/*"/>
224 <xsl:variable name="output.delims">
225 <xsl:call-template name="tex.math.output.delims"/>
227 <xsl:variable name="tex" select="alt[@role='tex'] | mediaobject/textobject[@role='tex']"/>
229 <xsl:text>\special{dvi2bitmap outputfile </xsl:text>
230 <xsl:value-of select="$filename"/>
233 <xsl:if test="$output.delims != 0">
234 <xsl:text>$$</xsl:text>
236 <xsl:value-of select="$tex"/>
237 <xsl:if test="$output.delims != 0">
246 <xsl:template match="text()" mode="collect.tex.math.latex"/>
248 <!-- Extracting image filename from mediaobject and graphic elements -->
250 <xsl:template name="select.mediaobject.filename">
251 <xsl:param name="olist" select="imageobject|imageobjectco |videoobject|audioobject|textobject"/>
253 <xsl:variable name="mediaobject.index">
254 <xsl:call-template name="select.mediaobject.index">
255 <xsl:with-param name="olist" select="$olist"/>
256 <xsl:with-param name="count" select="1"/>
260 <xsl:if test="$mediaobject.index != ''">
261 <xsl:call-template name="mediaobject.filename">
262 <xsl:with-param name="object" select="$olist[position() = $mediaobject.index]"/>
267 <xsl:template name="tex.math.output.delims">
268 <xsl:variable name="pi.delims">
269 <xsl:call-template name="pi-attribute">
270 <xsl:with-param name="pis" select=".//processing-instruction('dbtex')"/>
271 <xsl:with-param name="attribute" select="'delims'"/>
274 <xsl:variable name="result">
276 <xsl:when test="$pi.delims = 'no'">0</xsl:when>
277 <xsl:when test="$pi.delims = '' and $tex.math.delims = 0">0</xsl:when>
278 <xsl:otherwise>1</xsl:otherwise>
281 <xsl:value-of select="$result"/>