[c873d807] | 1 | <?xml version='1.0'?>
|
---|
| 2 | <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
---|
| 3 | xmlns:fo="http://www.w3.org/1999/XSL/Format"
|
---|
| 4 | xmlns:mml="http://www.w3.org/1998/Math/MathML"
|
---|
| 5 | exclude-result-prefixes="mml"
|
---|
| 6 | version='1.0'>
|
---|
| 7 |
|
---|
| 8 | <!-- ********************************************************************
|
---|
[15c7d39] | 9 | $Id: math.xsl 9647 2012-10-26 17:42:03Z bobstayton $
|
---|
[c873d807] | 10 | ********************************************************************
|
---|
| 11 |
|
---|
| 12 | This file is part of the XSL DocBook Stylesheet distribution.
|
---|
| 13 | See ../README or http://docbook.sf.net/release/xsl/current/ for
|
---|
| 14 | copyright and other information.
|
---|
| 15 |
|
---|
| 16 | ******************************************************************** -->
|
---|
| 17 |
|
---|
| 18 | <xsl:template match="inlineequation">
|
---|
[15c7d39] | 19 | <xsl:apply-templates/>
|
---|
[c873d807] | 20 | </xsl:template>
|
---|
| 21 |
|
---|
| 22 | <xsl:template match="alt">
|
---|
| 23 | </xsl:template>
|
---|
| 24 |
|
---|
| 25 | <xsl:template match="mathphrase">
|
---|
| 26 | <fo:inline>
|
---|
| 27 | <xsl:apply-templates/>
|
---|
| 28 | </fo:inline>
|
---|
| 29 | </xsl:template>
|
---|
| 30 |
|
---|
| 31 | <!-- "Support" for MathML -->
|
---|
| 32 |
|
---|
| 33 | <xsl:template match="mml:math" xmlns:mml="http://www.w3.org/1998/Math/MathML">
|
---|
| 34 | <fo:instream-foreign-object>
|
---|
| 35 | <xsl:copy>
|
---|
| 36 | <xsl:copy-of select="@*"/>
|
---|
| 37 | <xsl:apply-templates/>
|
---|
| 38 | </xsl:copy>
|
---|
| 39 | </fo:instream-foreign-object>
|
---|
| 40 | </xsl:template>
|
---|
| 41 |
|
---|
| 42 | <xsl:template match="mml:*" xmlns:mml="http://www.w3.org/1998/Math/MathML">
|
---|
| 43 | <xsl:copy>
|
---|
| 44 | <xsl:copy-of select="@*"/>
|
---|
| 45 | <xsl:apply-templates/>
|
---|
| 46 | </xsl:copy>
|
---|
| 47 | </xsl:template>
|
---|
| 48 |
|
---|
| 49 | <xsl:template match="equation/graphic | informalequation/graphic">
|
---|
[15c7d39] | 50 | <xsl:if test="$tex.math.in.alt = ''">
|
---|
[c873d807] | 51 | <fo:block>
|
---|
| 52 | <xsl:call-template name="process.image"/>
|
---|
| 53 | </fo:block>
|
---|
| 54 | </xsl:if>
|
---|
| 55 | </xsl:template>
|
---|
| 56 |
|
---|
| 57 | <xsl:template match="inlineequation/alt[@role='tex'] |
|
---|
| 58 | inlineequation/inlinemediaobject/textobject[@role='tex']" priority="1">
|
---|
| 59 | <xsl:param name="output.delims" select="1"/>
|
---|
| 60 | </xsl:template>
|
---|
| 61 |
|
---|
| 62 | <xsl:template match="equation/alt[@role='tex'] | informalequation/alt[@role='tex'] |
|
---|
| 63 | equation/mediaobject/textobject[@role='tex'] |
|
---|
| 64 | informalequation/mediaobject/textobject[@role='tex']" priority="1">
|
---|
| 65 | <xsl:variable name="output.delims">
|
---|
| 66 | <xsl:call-template name="tex.math.output.delims"/>
|
---|
| 67 | </xsl:variable>
|
---|
| 68 | </xsl:template>
|
---|
| 69 |
|
---|
| 70 | <xsl:template name="tex.math.output.delims">
|
---|
| 71 | <xsl:variable name="pi.delims">
|
---|
| 72 | <xsl:call-template name="pi-attribute">
|
---|
| 73 | <xsl:with-param name="pis" select=".//processing-instruction('dbtex')"/>
|
---|
| 74 | <xsl:with-param name="attribute" select="'delims'"/>
|
---|
| 75 | </xsl:call-template>
|
---|
| 76 | </xsl:variable>
|
---|
| 77 | <xsl:variable name="result">
|
---|
| 78 | <xsl:choose>
|
---|
| 79 | <xsl:when test="$pi.delims = 'no'">0</xsl:when>
|
---|
| 80 | <xsl:when test="$pi.delims = '' and $tex.math.delims = 0">0</xsl:when>
|
---|
| 81 | <xsl:otherwise>1</xsl:otherwise>
|
---|
| 82 | </xsl:choose>
|
---|
| 83 | </xsl:variable>
|
---|
| 84 | <xsl:value-of select="$result"/>
|
---|
| 85 | </xsl:template>
|
---|
| 86 |
|
---|
| 87 | </xsl:stylesheet>
|
---|