source: stylesheets/lfs-xsl/docbook-xsl-snapshot/fo/math.xsl@ 410e228b

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.1 6.3 6.3-rc1 6.3-rc2 6.3-rc3 7.10 7.4 7.5 7.6 7.6-blfs 7.6-systemd 7.7 7.8 7.9 8.0 8.1 8.2 8.3 8.4 9.0 9.1 basic bdubbs/svn elogind gnome kde5-13430 kde5-14269 kde5-14686 kea ken/TL2024 ken/inkscape-core-mods ken/tuningfonts krejzi/svn lazarus lxqt nosym perl-modules plabs/newcss plabs/python-mods python3.11 qt5new rahul/power-profiles-daemon renodr/vulkan-addition systemd-11177 systemd-13485 trunk upgradedb xry111/intltool xry111/llvm18 xry111/soup3 xry111/test-20220226 xry111/xf86-video-removal
Last change on this file since 410e228b was 410e228b, checked in by Randy McMurchy <randy@…>, 16 years ago

Removed extraneous whitespace from the ends of line text

git-svn-id: svn://svn.linuxfromscratch.org/BLFS/trunk/BOOK@7431 af4574ff-66df-0310-9fd7-8a98e5e911e0

  • Property mode set to 100644
File size: 4.2 KB
Line 
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<!-- ********************************************************************
9 $Id$
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">
19 <xsl:choose>
20 <xsl:when test="$passivetex.extensions != 0 and $tex.math.in.alt != ''">
21 <xsl:apply-templates select="alt[@role='tex'] | inlinemediaobject/textobject[@role='tex']">
22 <xsl:with-param name="output.delims">
23 <xsl:call-template name="tex.math.output.delims"/>
24 </xsl:with-param>
25 </xsl:apply-templates>
26 </xsl:when>
27 <xsl:otherwise>
28 <xsl:apply-templates/>
29 </xsl:otherwise>
30 </xsl:choose>
31</xsl:template>
32
33<xsl:template match="alt">
34</xsl:template>
35
36<xsl:template match="mathphrase">
37 <fo:inline>
38 <xsl:apply-templates/>
39 </fo:inline>
40</xsl:template>
41
42<!-- "Support" for MathML -->
43
44<xsl:template match="mml:math" xmlns:mml="http://www.w3.org/1998/Math/MathML">
45 <fo:instream-foreign-object>
46 <xsl:copy>
47 <xsl:copy-of select="@*"/>
48 <xsl:apply-templates/>
49 </xsl:copy>
50 </fo:instream-foreign-object>
51</xsl:template>
52
53<xsl:template match="mml:*" xmlns:mml="http://www.w3.org/1998/Math/MathML">
54 <xsl:copy>
55 <xsl:copy-of select="@*"/>
56 <xsl:apply-templates/>
57 </xsl:copy>
58</xsl:template>
59
60<xsl:template match="equation/graphic | informalequation/graphic">
61 <xsl:if test="$passivetex.extensions = 0 or $tex.math.in.alt = ''">
62 <fo:block>
63 <xsl:call-template name="process.image"/>
64 </fo:block>
65 </xsl:if>
66</xsl:template>
67
68<xsl:template match="inlineequation/alt[@role='tex'] |
69 inlineequation/inlinemediaobject/textobject[@role='tex']" priority="1">
70 <xsl:param name="output.delims" select="1"/>
71 <xsl:if test="$passivetex.extensions != 0 and $tex.math.in.alt != ''">
72 <xsl:processing-instruction name="xmltex">
73 <xsl:if test="$output.delims != 0">
74 <xsl:text>$</xsl:text>
75 </xsl:if>
76 <xsl:value-of select="."/>
77 <xsl:if test="$output.delims != 0">
78 <xsl:text>$</xsl:text>
79 </xsl:if>
80 </xsl:processing-instruction>
81 </xsl:if>
82</xsl:template>
83
84<xsl:template match="equation/alt[@role='tex'] | informalequation/alt[@role='tex'] |
85 equation/mediaobject/textobject[@role='tex'] |
86 informalequation/mediaobject/textobject[@role='tex']" priority="1">
87 <xsl:variable name="output.delims">
88 <xsl:call-template name="tex.math.output.delims"/>
89 </xsl:variable>
90 <xsl:if test="$passivetex.extensions != 0 and $tex.math.in.alt != ''">
91 <xsl:processing-instruction name="xmltex">
92 <xsl:if test="$output.delims != 0">
93 <xsl:text>$$</xsl:text>
94 </xsl:if>
95 <xsl:value-of select="."/>
96 <xsl:if test="$output.delims != 0">
97 <xsl:text>$$</xsl:text>
98 </xsl:if>
99 </xsl:processing-instruction>
100 </xsl:if>
101</xsl:template>
102
103<xsl:template match="alt[@role='tex']">
104 <xsl:if test="$passivetex.extensions != 0 and $tex.math.in.alt != ''">
105 <xsl:message>
106 Your equation is misplaced. It should be in inlineequation, equation or informalequation.
107 </xsl:message>
108 </xsl:if>
109</xsl:template>
110
111<xsl:template name="tex.math.output.delims">
112 <xsl:variable name="pi.delims">
113 <xsl:call-template name="pi-attribute">
114 <xsl:with-param name="pis" select=".//processing-instruction('dbtex')"/>
115 <xsl:with-param name="attribute" select="'delims'"/>
116 </xsl:call-template>
117 </xsl:variable>
118 <xsl:variable name="result">
119 <xsl:choose>
120 <xsl:when test="$pi.delims = 'no'">0</xsl:when>
121 <xsl:when test="$pi.delims = '' and $tex.math.delims = 0">0</xsl:when>
122 <xsl:otherwise>1</xsl:otherwise>
123 </xsl:choose>
124 </xsl:variable>
125 <xsl:value-of select="$result"/>
126</xsl:template>
127
128</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.