12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360 |
- <?xml version='1.0' encoding="UTF-8"?>
- <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:m="http://www.w3.org/1998/Math/MathML"
- version='1.0'>
- <!--
- Copyright (C) 2001, 2002 Vasil Yaroshevich
- Modified Fabian Seoane 2007 for sympy
- -->
- <xsl:output method="text" indent="no" encoding="UTF-8"/>
- <!-- ====================================================================== -->
- <!-- $id: mmltex.xsl, 2002/22/11 Exp $
- This file is part of the XSLT MathML Library distribution.
- See ./README or http://www.raleigh.ru/MathML/mmltex for
- copyright and other information -->
- <!-- ====================================================================== -->
- <!-- Note: variables colora (template color) and symbola (template startspace) only for Sablotron -->
- <xsl:template name="startspace">
- <xsl:param name="symbol"/>
- <xsl:if test="contains($symbol,' ')">
- <xsl:variable name="symbola" select="concat(substring-before($symbol,' '),substring-after($symbol,' '))"/>
- <xsl:call-template name="startspace">
- <xsl:with-param name="symbol" select="$symbola"/>
- </xsl:call-template>
- </xsl:if>
- <xsl:if test="not(contains($symbol,' '))">
- <xsl:value-of select="$symbol"/>
- </xsl:if>
- </xsl:template>
- <xsl:strip-space elements="m:*"/>
- <xsl:template match="m:math">
- <xsl:text>$</xsl:text>
- <xsl:apply-templates/>
- <xsl:text>$</xsl:text>
- </xsl:template>
- <!-- ====================================================================== -->
- <!-- $id: tokens.xsl, 2002/22/11 Exp $
- This file is part of the XSLT MathML Library distribution.
- See ./README or http://www.raleigh.ru/MathML/mmltex for
- copyright and other information -->
- <!-- ====================================================================== -->
- <!-- 4.4.1.1 cn -->
- <xsl:template match="m:cn"><xsl:apply-templates/></xsl:template>
- <xsl:template match="m:cn[@type='complex-cartesian']">
- <xsl:apply-templates select="text()[1]"/>
- <xsl:text>+</xsl:text>
- <xsl:apply-templates select="text()[2]"/>
- <xsl:text>i</xsl:text>
- </xsl:template>
- <xsl:template match="m:cn[@type='rational']">
- <xsl:apply-templates select="text()[1]"/>
- <xsl:text>/</xsl:text>
- <xsl:apply-templates select="text()[2]"/>
- </xsl:template>
- <xsl:template match="m:cn[@type='integer' and @base!=10]">
- <xsl:apply-templates/>
- <xsl:text>_{</xsl:text><xsl:value-of select="@base"/><xsl:text>}</xsl:text>
- </xsl:template>
- <xsl:template match="m:cn[@type='complex-polar']">
- <xsl:apply-templates select="text()[1]"/>
- <xsl:text>e^{i </xsl:text>
- <xsl:apply-templates select="text()[2]"/>
- <xsl:text>}</xsl:text>
- </xsl:template>
- <xsl:template match="m:cn[@type='e-notation']">
- <xsl:apply-templates select="text()[1]"/>
- <xsl:text>E</xsl:text>
- <xsl:apply-templates select="text()[2]"/>
- </xsl:template>
- <!-- 4.4.1.1 ci 4.4.1.2 csymbol -->
- <xsl:template match="m:ci | m:csymbol">
- <xsl:choose>
- <xsl:when test="string-length(normalize-space(text()))>1">
- <xsl:text>\mathrm{</xsl:text><xsl:apply-templates/><xsl:text>}</xsl:text>
- </xsl:when>
- <xsl:otherwise><xsl:apply-templates/></xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <!-- 4.4.2.1 apply 4.4.2.2 reln -->
- <xsl:template match="m:apply | m:reln">
- <xsl:apply-templates select="*[1]">
- <!-- <? -->
- <xsl:with-param name="p" select="10"/>
- </xsl:apply-templates>
- <!-- ?> -->
- <xsl:text>(</xsl:text>
- <xsl:for-each select="*[position()>1]">
- <xsl:apply-templates select="."/>
- <xsl:if test="not(position()=last())"><xsl:text>, </xsl:text></xsl:if>
- </xsl:for-each>
- <xsl:text>)</xsl:text>
- </xsl:template>
- <!-- 4.4.2.3 fn -->
- <xsl:template match="m:fn[m:apply[1]]"> <!-- for m:fn using default rule -->
- <xsl:text>(</xsl:text><xsl:apply-templates/><xsl:text>)</xsl:text>
- </xsl:template>
- <!-- 4.4.2.4 interval -->
- <xsl:template match="m:interval[*[2]]">
- <xsl:choose>
- <xsl:when test="@closure='open' or @closure='open-closed'">
- <xsl:text>\left(</xsl:text>
- </xsl:when>
- <xsl:otherwise><xsl:text>\left[</xsl:text></xsl:otherwise>
- </xsl:choose>
- <xsl:apply-templates select="*[1]"/>
- <xsl:text> , </xsl:text>
- <xsl:apply-templates select="*[2]"/>
- <xsl:choose>
- <xsl:when test="@closure='open' or @closure='closed-open'">
- <xsl:text>\right)</xsl:text>
- </xsl:when>
- <xsl:otherwise><xsl:text>\right]</xsl:text></xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template match="m:interval">
- <xsl:text>\left\{</xsl:text><xsl:apply-templates/><xsl:text>\right\}</xsl:text>
- </xsl:template>
- <!-- 4.4.2.5 inverse -->
- <xsl:template match="m:apply[*[1][self::m:inverse]]">
- <xsl:apply-templates select="*[2]"/><xsl:text>^{(-1)}</xsl:text>
- </xsl:template>
- <!-- 4.4.2.6 sep 4.4.2.7 condition -->
- <xsl:template match="m:sep | m:condition"><xsl:apply-templates/></xsl:template>
- <!-- 4.4.2.9 lambda -->
- <xsl:template match="m:lambda">
- <xsl:text>\mathrm{lambda}\: </xsl:text>
- <xsl:apply-templates select="m:bvar/*"/>
- <xsl:text>.\: </xsl:text>
- <xsl:apply-templates select="*[last()]"/>
- </xsl:template>
- <!-- 4.4.2.10 compose -->
- <xsl:template match="m:apply[*[1][self::m:compose]]">
- <xsl:param name="p" select="0"/>
- <xsl:call-template name="infix">
- <xsl:with-param name="this-p" select="1"/>
- <xsl:with-param name="p" select="$p"/>
- <xsl:with-param name="mo">\circ </xsl:with-param>
- </xsl:call-template>
- </xsl:template>
- <!-- 4.4.2.11 ident -->
- <xsl:template match="m:ident"><xsl:text>\mathrm{id}</xsl:text></xsl:template>
- <!-- 4.4.2.12 domain 4.4.2.13 codomain 4.4.2.14 image 4.4.3.21 arg 4.4.3.24 lcm
- 4.4.5.9 grad 4.4.5.10 curl 4.4.9.4 median 4.4.9.5 mode-->
- <xsl:template match="m:domain | m:codomain | m:image | m:arg | m:lcm | m:grad |
- m:curl | m:median | m:mode">
- <xsl:text>\mathop{\mathrm{</xsl:text>
- <xsl:value-of select="local-name()"/>
- <xsl:text>}}</xsl:text>
- </xsl:template>
- <!-- 4.4.2.15 domainofapplication -->
- <xsl:template match="m:domainofapplication"/>
- <!-- 4.4.2.16 piecewise -->
- <xsl:template match="m:piecewise">
- <xsl:text>\begin{cases}</xsl:text>
- <xsl:apply-templates select="m:piece"/>
- <xsl:apply-templates select="m:otherwise"/>
- <xsl:text>\end{cases}</xsl:text>
- </xsl:template>
- <xsl:template match="m:piece">
- <xsl:apply-templates select="*[1]"/>
- <xsl:text> & \text{if $</xsl:text>
- <xsl:apply-templates select="*[2]"/>
- <xsl:text>$}</xsl:text>
- <xsl:if test="not(position()=last()) or ../m:otherwise"><xsl:text>\\ </xsl:text></xsl:if>
- </xsl:template>
- <xsl:template match="m:otherwise">
- <xsl:apply-templates select="*[1]"/>
- <xsl:text> & \text{otherwise}</xsl:text>
- </xsl:template>
- <!-- 4.4.3.1 quotient -->
- <xsl:template match="m:apply[*[1][self::m:quotient]]">
- <xsl:text>\left\lfloor\frac{</xsl:text>
- <xsl:apply-templates select="*[2]"/>
- <xsl:text>}{</xsl:text>
- <xsl:apply-templates select="*[3]"/>
- <xsl:text>}\right\rfloor </xsl:text>
- </xsl:template>
- <!-- 4.4.3.2 factorial -->
- <xsl:template match="m:apply[*[1][self::m:factorial]]">
- <xsl:apply-templates select="*[2]">
- <xsl:with-param name="p" select="7"/>
- </xsl:apply-templates>
- <xsl:text>!</xsl:text>
- </xsl:template>
- <!-- 4.4.3.3 divide -->
- <xsl:template match="m:apply[*[1][self::m:divide]]">
- <xsl:param name="p" select="0"/>
- <xsl:param name="this-p" select="3"/>
- <xsl:if test="$this-p < $p"><xsl:text>\left(</xsl:text></xsl:if>
- <xsl:text>\frac{</xsl:text>
- <xsl:apply-templates select="*[2]"/>
- <!-- <xsl:with-param name="p" select="$this-p"/>
- </xsl:apply-templates>-->
- <xsl:text>}{</xsl:text>
- <xsl:apply-templates select="*[3]"/>
- <!-- <xsl:with-param name="p" select="$this-p"/>
- </xsl:apply-templates>-->
- <xsl:text>}</xsl:text>
- <xsl:if test="$this-p < $p"><xsl:text>\right)</xsl:text></xsl:if>
- </xsl:template>
- <!-- 4.4.3.4 max min -->
- <xsl:template match="m:apply[*[1][self::m:max or self::m:min]]">
- <xsl:text>\</xsl:text>
- <xsl:value-of select="local-name(*[1])"/>
- <xsl:text>\{</xsl:text>
- <xsl:choose>
- <xsl:when test="m:condition">
- <xsl:apply-templates select="*[last()]"/>
- <xsl:text>, </xsl:text>
- <xsl:apply-templates select="m:condition/node()"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:for-each select="*[position() > 1]">
- <xsl:apply-templates select="."/>
- <xsl:if test="position() !=last()"><xsl:text> , </xsl:text></xsl:if>
- </xsl:for-each>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:text>\}</xsl:text>
- </xsl:template>
- <!-- 4.4.3.5 minus-->
- <xsl:template match="m:apply[*[1][self::m:minus] and count(*)=2]">
- <xsl:text>-</xsl:text>
- <xsl:apply-templates select="*[2]">
- <xsl:with-param name="p" select="5"/>
- </xsl:apply-templates>
- </xsl:template>
- <xsl:template match="m:apply[*[1][self::m:minus] and count(*)>2]">
- <xsl:param name="p" select="0"/>
- <xsl:call-template name="binary">
- <xsl:with-param name="mo">-</xsl:with-param>
- <xsl:with-param name="p" select="$p"/>
- <xsl:with-param name="this-p" select="2"/>
- </xsl:call-template>
- </xsl:template>
- <!-- 4.4.3.6 plus-->
- <xsl:template match="m:apply[*[1][self::m:plus]]">
- <xsl:param name="p" select="0"/>
- <xsl:if test="$p > 2">
- <xsl:text>(</xsl:text>
- </xsl:if>
- <xsl:for-each select="*[position()>1]">
- <xsl:if test="position() > 1">
- <xsl:choose>
- <xsl:when test="self::m:apply[*[1][self::m:times] and
- *[2][self::m:apply/*[1][self::m:minus] or self::m:cn[not(m:sep) and
- (number(.) < 0)]]]">-</xsl:when>
- <xsl:otherwise>+</xsl:otherwise>
- </xsl:choose>
- </xsl:if>
- <xsl:choose>
- <xsl:when test="self::m:apply[*[1][self::m:times] and
- *[2][self::m:cn[not(m:sep) and (number(.) <0)]]]">
- <xsl:value-of select="-(*[2])"/>
- <xsl:apply-templates select=".">
- <xsl:with-param name="first" select="2"/>
- <xsl:with-param name="p" select="2"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:when test="self::m:apply[*[1][self::m:times] and
- *[2][self::m:apply/*[1][self::m:minus]]]">
- <xsl:apply-templates select="./*[2]/*[2]"/>
- <xsl:apply-templates select=".">
- <xsl:with-param name="first" select="2"/>
- <xsl:with-param name="p" select="2"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates select=".">
- <xsl:with-param name="p" select="2"/>
- </xsl:apply-templates>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:for-each>
- <xsl:if test="$p > 2">
- <xsl:text>)</xsl:text>
- </xsl:if>
- </xsl:template>
- <!-- 4.4.3.7 power -->
- <xsl:template match="m:apply[*[1][self::m:power]]">
- <xsl:apply-templates select="*[2]">
- <xsl:with-param name="p" select="5"/>
- </xsl:apply-templates>
- <xsl:text>^{</xsl:text>
- <xsl:apply-templates select="*[3]">
- <xsl:with-param name="p" select="5"/>
- </xsl:apply-templates>
- <xsl:text>}</xsl:text>
- </xsl:template>
- <!-- 4.4.3.8 remainder -->
- <xsl:template match="m:apply[*[1][self::m:rem]]">
- <xsl:param name="p" select="0"/>
- <xsl:call-template name="binary">
- <xsl:with-param name="mo">\mod </xsl:with-param>
- <xsl:with-param name="p" select="$p"/>
- <xsl:with-param name="this-p" select="3"/>
- </xsl:call-template>
- </xsl:template>
- <!-- 4.4.3.9 times-->
- <xsl:template match="m:apply[*[1][self::m:times]]" name="times">
- <xsl:param name="p" select="0"/>
- <xsl:param name="first" select="1"/>
- <xsl:if test="$p > 3"><xsl:text>(</xsl:text></xsl:if>
- <xsl:for-each select="*[position()>1]">
- <xsl:if test="position() > 1">
- <xsl:choose>
- <xsl:when test="self::m:cn">\times <!-- times --></xsl:when>
- <xsl:otherwise><!--invisible times--></xsl:otherwise>
- </xsl:choose>
- </xsl:if>
- <xsl:if test="position()>= $first">
- <xsl:apply-templates select=".">
- <xsl:with-param name="p" select="3"/>
- </xsl:apply-templates>
- </xsl:if>
- </xsl:for-each>
- <xsl:if test="$p > 3"><xsl:text>)</xsl:text></xsl:if>
- </xsl:template>
- <!-- 4.4.3.10 root -->
- <xsl:template match="m:apply[*[1][self::m:root]]">
- <xsl:text>\sqrt</xsl:text>
- <xsl:if test="m:degree!=2">
- <xsl:text>[</xsl:text>
- <xsl:apply-templates select="m:degree/*"/>
- <xsl:text>]</xsl:text>
- </xsl:if>
- <xsl:text>{</xsl:text>
- <xsl:apply-templates select="*[position()>1 and not(self::m:degree)]"/>
- <xsl:text>}</xsl:text>
- </xsl:template>
- <!-- 4.4.3.11 gcd -->
- <xsl:template match="m:gcd"><xsl:text>\gcd </xsl:text></xsl:template>
- <!-- 4.4.3.12 and -->
- <xsl:template match="m:apply[*[1][self::m:and]]">
- <xsl:param name="p" select="0"/>
- <xsl:call-template name="infix">
- <xsl:with-param name="this-p" select="2"/>
- <xsl:with-param name="p" select="$p"/>
- <xsl:with-param name="mo">\land <!-- and --></xsl:with-param>
- </xsl:call-template>
- </xsl:template>
- <!-- 4.4.3.13 or -->
- <xsl:template match="m:apply[*[1][self::m:or]]">
- <xsl:param name="p" select="0"/>
- <xsl:call-template name="infix">
- <xsl:with-param name="this-p" select="3"/>
- <xsl:with-param name="p" select="$p"/>
- <xsl:with-param name="mo">\lor </xsl:with-param>
- </xsl:call-template>
- </xsl:template>
- <!-- 4.4.3.14 xor -->
- <xsl:template match="m:apply[*[1][self::m:xor]]">
- <xsl:param name="p" select="0"/>
- <xsl:call-template name="infix">
- <xsl:with-param name="this-p" select="3"/>
- <xsl:with-param name="p" select="$p"/>
- <xsl:with-param name="mo">\mathop{\mathrm{xor}}</xsl:with-param>
- </xsl:call-template>
- </xsl:template>
- <!-- 4.4.3.15 not -->
- <xsl:template match="m:apply[*[1][self::m:not]]">
- <xsl:text>\neg </xsl:text>
- <xsl:apply-templates select="*[2]">
- <xsl:with-param name="p" select="7"/>
- </xsl:apply-templates>
- </xsl:template>
- <!-- 4.4.3.16 implies -->
- <xsl:template match="m:apply[*[1][self::m:implies]]">
- <xsl:param name="p" select="0"/>
- <xsl:call-template name="binary">
- <xsl:with-param name="mo">\implies </xsl:with-param>
- <xsl:with-param name="p" select="$p"/>
- <xsl:with-param name="this-p" select="3"/>
- </xsl:call-template>
- </xsl:template>
- <!-- 4.4.3.17 forall 4.4.3.18 exists -->
- <xsl:template match="m:apply[*[1][self::m:forall or self::m:exists]]">
- <xsl:text>\</xsl:text>
- <xsl:value-of select="local-name(*[1])"/>
- <xsl:text> </xsl:text>
- <xsl:apply-templates select="m:bvar"/>
- <xsl:if test="m:condition">
- <xsl:text>, </xsl:text><xsl:apply-templates select="m:condition"/>
- </xsl:if>
- <xsl:if test="*[last()][local-name()!='condition'][local-name()!='bvar']">
- <xsl:text>\colon </xsl:text>
- <xsl:apply-templates select="*[last()]"/>
- </xsl:if>
- </xsl:template>
- <!-- 4.4.3.19 abs -->
- <xsl:template match="m:apply[*[1][self::m:abs]]">
- <xsl:text>\left|</xsl:text>
- <xsl:apply-templates select="*[2]"/>
- <xsl:text>\right|</xsl:text>
- </xsl:template>
- <!-- 4.4.3.20 conjugate -->
- <xsl:template match="m:apply[*[1][self::m:conjugate]]">
- <xsl:text>\overline{</xsl:text><xsl:apply-templates select="*[2]"/><xsl:text>}</xsl:text>
- </xsl:template>
- <!-- 4.4.3.22 real -->
- <xsl:template match="m:real"><xsl:text>\Re </xsl:text></xsl:template>
- <!-- 4.4.3.23 imaginary -->
- <xsl:template match="m:imaginary"><xsl:text>\Im </xsl:text></xsl:template>
- <!-- 4.4.3.25 floor -->
- <xsl:template match="m:apply[*[1][self::m:floor]]">
- <xsl:text>\left\lfloor </xsl:text>
- <xsl:apply-templates select="*[2]"/>
- <xsl:text>\right\rfloor </xsl:text>
- </xsl:template>
- <!-- 4.4.3.25 ceiling -->
- <xsl:template match="m:apply[*[1][self::m:ceiling]]">
- <xsl:text>\left\lceil </xsl:text>
- <xsl:apply-templates select="*[2]"/>
- <xsl:text>\right\rceil </xsl:text>
- </xsl:template>
- <!-- 4.4.4.1 eq -->
- <xsl:template match="m:apply[*[1][self::m:eq]]">
- <xsl:param name="p" select="0"/>
- <xsl:call-template name="infix">
- <xsl:with-param name="this-p" select="1"/>
- <xsl:with-param name="p" select="$p"/>
- <xsl:with-param name="mo">=</xsl:with-param>
- </xsl:call-template>
- </xsl:template>
- <!-- 4.4.4.2 neq -->
- <xsl:template match="m:apply[*[1][self::m:neq]]">
- <xsl:param name="p" select="0"/>
- <xsl:call-template name="infix">
- <xsl:with-param name="this-p" select="1"/>
- <xsl:with-param name="p" select="$p"/>
- <xsl:with-param name="mo">\neq </xsl:with-param>
- </xsl:call-template>
- </xsl:template>
- <!-- 4.4.4.3 gt -->
- <xsl:template match="m:apply[*[1][self::m:gt]]">
- <xsl:param name="p" select="0"/>
- <xsl:call-template name="infix">
- <xsl:with-param name="this-p" select="1"/>
- <xsl:with-param name="p" select="$p"/>
- <xsl:with-param name="mo">> </xsl:with-param>
- </xsl:call-template>
- </xsl:template>
- <!-- 4.4.4.4 lt -->
- <xsl:template match="m:apply[*[1][self::m:lt]]">
- <xsl:param name="p" select="0"/>
- <xsl:call-template name="infix">
- <xsl:with-param name="this-p" select="1"/>
- <xsl:with-param name="p" select="$p"/>
- <xsl:with-param name="mo">< </xsl:with-param>
- </xsl:call-template>
- </xsl:template>
- <!-- 4.4.4.5 geq -->
- <xsl:template match="m:apply[*[1][self::m:geq]]">
- <xsl:param name="p" select="0"/>
- <xsl:call-template name="infix">
- <xsl:with-param name="this-p" select="1"/>
- <xsl:with-param name="p" select="$p"/>
- <xsl:with-param name="mo">\ge </xsl:with-param>
- </xsl:call-template>
- </xsl:template>
- <!-- 4.4.4.6 leq -->
- <xsl:template match="m:apply[*[1][self::m:leq]]">
- <xsl:param name="p" select="0"/>
- <xsl:call-template name="infix">
- <xsl:with-param name="this-p" select="1"/>
- <xsl:with-param name="p" select="$p"/>
- <xsl:with-param name="mo">\le </xsl:with-param>
- </xsl:call-template>
- </xsl:template>
- <!-- 4.4.4.7 equivalent -->
- <xsl:template match="m:apply[*[1][self::m:equivalent]]">
- <xsl:param name="p" select="0"/>
- <xsl:call-template name="infix">
- <xsl:with-param name="this-p" select="1"/>
- <xsl:with-param name="p" select="$p"/>
- <xsl:with-param name="mo">\equiv </xsl:with-param>
- </xsl:call-template>
- </xsl:template>
- <!-- 4.4.4.8 approx -->
- <xsl:template match="m:apply[*[1][self::m:approx]]">
- <xsl:param name="p" select="0"/>
- <xsl:call-template name="infix">
- <xsl:with-param name="this-p" select="1"/>
- <xsl:with-param name="p" select="$p"/>
- <xsl:with-param name="mo">\approx </xsl:with-param>
- </xsl:call-template>
- </xsl:template>
- <!-- 4.4.4.9 factorof -->
- <xsl:template match="m:apply[*[1][self::m:factorof]]">
- <xsl:param name="p" select="0"/>
- <xsl:call-template name="binary">
- <xsl:with-param name="mo"> | </xsl:with-param>
- <xsl:with-param name="p" select="$p"/>
- <xsl:with-param name="this-p" select="3"/>
- </xsl:call-template>
- </xsl:template>
- <!-- 4.4.5.1 int -->
- <xsl:template match="m:apply[*[1][self::m:int]]">
- <xsl:text>\int</xsl:text>
- <xsl:if test="m:lowlimit/*|m:interval/*[1]|m:condition/*">
- <xsl:text>_{</xsl:text>
- <xsl:apply-templates select="m:lowlimit/*|m:interval/*[1]|m:condition/*"/>
- <xsl:text>}</xsl:text>
- </xsl:if>
- <xsl:if test="m:uplimit/*|m:interval/*[2]">
- <xsl:text>^{</xsl:text>
- <xsl:apply-templates select="m:uplimit/*|m:interval/*[2]"/>
- <xsl:text>}</xsl:text>
- </xsl:if>
- <xsl:text> </xsl:text>
- <xsl:apply-templates select="*[last()]"/>
- <xsl:text>\,d </xsl:text>
- <xsl:apply-templates select="m:bvar"/>
- </xsl:template>
- <!-- 4.4.5.2 diff -->
- <xsl:template match="m:apply[*[1][self::m:diff] and m:ci and count(*)=2]" priority="2">
- <xsl:apply-templates select="*[2]"/>
- <xsl:text>^\prime </xsl:text>
- </xsl:template>
- <xsl:template match="m:apply[*[1][self::m:diff]]" priority="1">
- <xsl:text>\frac{</xsl:text>
- <xsl:choose>
- <xsl:when test="m:bvar/m:degree">
- <xsl:text>d^{</xsl:text>
- <xsl:apply-templates select="m:bvar/m:degree/node()"/>
- <xsl:text>}</xsl:text>
- <xsl:apply-templates select="*[last()]"/>
- <xsl:text>}{d</xsl:text>
- <xsl:apply-templates select="m:bvar/node()"/>
- <xsl:text>^{</xsl:text>
- <xsl:apply-templates select="m:bvar/m:degree/node()"/>
- <xsl:text>}</xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>d </xsl:text>
- <xsl:apply-templates select="*[last()]"/>
- <xsl:text>}{d </xsl:text>
- <xsl:apply-templates select="m:bvar"/>
- <xsl:text>}</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:text>}</xsl:text>
- </xsl:template>
- <!-- 4.4.5.3 partialdiff -->
- <xsl:template match="m:apply[*[1][self::m:partialdiff] and m:list and m:ci and count(*)=3]" priority="2">
- <xsl:text>D_{</xsl:text>
- <xsl:for-each select="m:list[1]/*">
- <xsl:apply-templates select="."/>
- <xsl:if test="position()<last()"><xsl:text>, </xsl:text></xsl:if>
- </xsl:for-each>
- <xsl:text>}</xsl:text>
- <xsl:apply-templates select="*[3]"/>
- </xsl:template>
- <xsl:template match="m:apply[*[1][self::m:partialdiff]]" priority="1">
- <xsl:text>\frac{\partial^{</xsl:text>
- <xsl:choose>
- <xsl:when test="m:degree">
- <xsl:apply-templates select="m:degree/node()"/>
- </xsl:when>
- <xsl:when test="m:bvar/m:degree[string(number(.))='NaN']">
- <xsl:for-each select="m:bvar/m:degree">
- <xsl:apply-templates select="node()"/>
- <xsl:if test="position()<last()"><xsl:text>+</xsl:text></xsl:if>
- </xsl:for-each>
- <xsl:if test="count(m:bvar[not(m:degree)])>0">
- <xsl:text>+</xsl:text>
- <xsl:value-of select="count(m:bvar[not(m:degree)])"/>
- </xsl:if>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="sum(m:bvar/m:degree)+count(m:bvar[not(m:degree)])"/>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:text>}</xsl:text>
- <xsl:apply-templates select="*[last()]"/>
- <xsl:text>}{</xsl:text>
- <xsl:for-each select="m:bvar">
- <xsl:text>\partial </xsl:text>
- <xsl:apply-templates select="node()"/>
- <xsl:if test="m:degree">
- <xsl:text>^{</xsl:text>
- <xsl:apply-templates select="m:degree/node()"/>
- <xsl:text>}</xsl:text>
- </xsl:if>
- </xsl:for-each>
- <xsl:text>}</xsl:text>
- </xsl:template>
- <!-- 4.4.2.8 declare 4.4.5.4 lowlimit 4.4.5.5 uplimit 4.4.5.7 degree 4.4.9.5 momentabout -->
- <xsl:template match="m:declare | m:lowlimit | m:uplimit | m:degree | m:momentabout"/>
- <!-- 4.4.5.6 bvar-->
- <xsl:template match="m:bvar">
- <xsl:apply-templates/>
- <xsl:if test="following-sibling::m:bvar"><xsl:text>, </xsl:text></xsl:if>
- </xsl:template>
- <!-- 4.4.5.8 divergence-->
- <xsl:template match="m:divergence"><xsl:text>\mathop{\mathrm{div}}</xsl:text></xsl:template>
- <!-- 4.4.5.11 laplacian-->
- <xsl:template match="m:laplacian"><xsl:text>\nabla^2 </xsl:text></xsl:template>
- <!-- 4.4.6.1 set -->
- <xsl:template match="m:set">
- <xsl:text>\{</xsl:text><xsl:call-template name="set"/><xsl:text>\}</xsl:text>
- </xsl:template>
- <!-- 4.4.6.2 list -->
- <xsl:template match="m:list">
- <xsl:text>\left[</xsl:text><xsl:call-template name="set"/><xsl:text>\right]</xsl:text>
- </xsl:template>
- <xsl:template name="set">
- <xsl:choose>
- <xsl:when test="m:condition">
- <xsl:apply-templates select="m:bvar/*[not(self::bvar or self::condition)]"/>
- <xsl:text>\colon </xsl:text>
- <xsl:apply-templates select="m:condition/node()"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:for-each select="*">
- <xsl:apply-templates select="."/>
- <xsl:if test="position()!=last()"><xsl:text>, </xsl:text></xsl:if>
- </xsl:for-each>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <!-- 4.4.6.3 union -->
- <xsl:template match="m:apply[*[1][self::m:union]]">
- <xsl:param name="p" select="0"/>
- <xsl:call-template name="infix">
- <xsl:with-param name="this-p" select="2"/>
- <xsl:with-param name="p" select="$p"/>
- <xsl:with-param name="mo">\cup </xsl:with-param>
- </xsl:call-template>
- </xsl:template>
- <!-- 4.4.6.4 intersect -->
- <xsl:template match="m:apply[*[1][self::m:intersect]]">
- <xsl:param name="p" select="0"/>
- <xsl:call-template name="infix">
- <xsl:with-param name="this-p" select="3"/>
- <xsl:with-param name="p" select="$p"/>
- <xsl:with-param name="mo">\cap </xsl:with-param>
- </xsl:call-template>
- </xsl:template>
- <!-- 4.4.6.5 in -->
- <xsl:template match="m:apply[*[1][self::m:in]]">
- <xsl:param name="p" select="0"/>
- <xsl:call-template name="binary">
- <xsl:with-param name="mo">\in </xsl:with-param>
- <xsl:with-param name="p" select="$p"/>
- <xsl:with-param name="this-p" select="3"/>
- </xsl:call-template>
- </xsl:template>
- <!-- 4.4.6.5 notin -->
- <xsl:template match="m:apply[*[1][self::m:notin]]">
- <xsl:param name="p" select="0"/>
- <xsl:call-template name="binary">
- <xsl:with-param name="mo">\notin </xsl:with-param>
- <xsl:with-param name="p" select="$p"/>
- <xsl:with-param name="this-p" select="3"/>
- </xsl:call-template>
- </xsl:template>
- <!-- 4.4.6.7 subset -->
- <xsl:template match="m:apply[*[1][self::m:subset]]">
- <xsl:param name="p" select="0"/>
- <xsl:call-template name="infix">
- <xsl:with-param name="this-p" select="2"/>
- <xsl:with-param name="p" select="$p"/>
- <xsl:with-param name="mo">\subseteq </xsl:with-param>
- </xsl:call-template>
- </xsl:template>
- <!-- 4.4.6.8 prsubset -->
- <xsl:template match="m:apply[*[1][self::m:prsubset]]">
- <xsl:param name="p" select="0"/>
- <xsl:call-template name="infix">
- <xsl:with-param name="this-p" select="2"/>
- <xsl:with-param name="p" select="$p"/>
- <xsl:with-param name="mo">\subset </xsl:with-param>
- </xsl:call-template>
- </xsl:template>
- <!-- 4.4.6.9 notsubset -->
- <xsl:template match="m:apply[*[1][self::m:notsubset]]">
- <xsl:param name="p" select="0"/>
- <xsl:call-template name="binary">
- <xsl:with-param name="this-p" select="2"/>
- <xsl:with-param name="p" select="$p"/>
- <xsl:with-param name="mo">\nsubseteq </xsl:with-param>
- </xsl:call-template>
- </xsl:template>
- <!-- 4.4.6.10 notprsubset -->
- <xsl:template match="m:apply[*[1][self::m:notprsubset]]">
- <xsl:param name="p" select="0"/>
- <xsl:call-template name="binary">
- <xsl:with-param name="this-p" select="2"/>
- <xsl:with-param name="p" select="$p"/>
- <xsl:with-param name="mo">\not\subset </xsl:with-param>
- </xsl:call-template>
- </xsl:template>
- <!-- 4.4.6.11 setdiff -->
- <xsl:template match="m:apply[*[1][self::m:setdiff]]">
- <xsl:param name="p" select="0"/>
- <xsl:call-template name="binary">
- <xsl:with-param name="this-p" select="2"/>
- <xsl:with-param name="p" select="$p"/>
- <xsl:with-param name="mo">\setminus </xsl:with-param>
- </xsl:call-template>
- </xsl:template>
- <!-- 4.4.6.12 card -->
- <xsl:template match="m:apply[*[1][self::m:card]]">
- <xsl:text>|</xsl:text>
- <xsl:apply-templates select="*[2]"/>
- <xsl:text>|</xsl:text>
- </xsl:template>
- <!-- 4.4.6.13 cartesianproduct 4.4.10.6 vectorproduct -->
- <xsl:template match="m:apply[*[1][self::m:cartesianproduct or self::m:vectorproduct]]">
- <xsl:param name="p" select="0"/>
- <xsl:call-template name="infix">
- <xsl:with-param name="this-p" select="2"/>
- <xsl:with-param name="p" select="$p"/>
- <xsl:with-param name="mo">\times </xsl:with-param>
- </xsl:call-template>
- </xsl:template>
- <xsl:template
- match="m:apply[*[1][self::m:cartesianproduct][count(following-sibling::m:reals)=count(following-sibling::*)]]"
- priority="2">
- <xsl:apply-templates select="*[2]">
- <xsl:with-param name="p" select="5"/>
- </xsl:apply-templates>
- <xsl:text>^{</xsl:text>
- <xsl:value-of select="count(*)-1"/>
- <xsl:text>}</xsl:text>
- </xsl:template>
- <!-- 4.4.7.1 sum -->
- <xsl:template match="m:apply[*[1][self::m:sum]]">
- <xsl:text>\sum</xsl:text><xsl:call-template name="series"/>
- </xsl:template>
- <!-- 4.4.7.2 product -->
- <xsl:template match="m:apply[*[1][self::m:product]]">
- <xsl:text>\prod</xsl:text><xsl:call-template name="series"/>
- </xsl:template>
- <xsl:template name="series">
- <xsl:if test="m:lowlimit/*|m:interval/*[1]|m:condition/*">
- <xsl:text>_{</xsl:text>
- <xsl:if test="not(m:condition)">
- <xsl:apply-templates select="m:bvar"/>
- <xsl:text>=</xsl:text>
- </xsl:if>
- <xsl:apply-templates select="m:lowlimit/*|m:interval/*[1]|m:condition/*"/>
- <xsl:text>}</xsl:text>
- </xsl:if>
- <xsl:if test="m:uplimit/*|m:interval/*[2]">
- <xsl:text>^{</xsl:text>
- <xsl:apply-templates select="m:uplimit/*|m:interval/*[2]"/>
- <xsl:text>}</xsl:text>
- </xsl:if>
- <xsl:text> </xsl:text>
- <xsl:apply-templates select="*[last()]"/>
- </xsl:template>
- <!-- 4.4.7.3 limit -->
- <xsl:template match="m:apply[*[1][self::m:limit]]">
- <xsl:text>\lim_{</xsl:text>
- <xsl:apply-templates select="m:lowlimit|m:condition/*"/>
- <xsl:text>}</xsl:text>
- <xsl:apply-templates select="*[last()]"/>
- </xsl:template>
- <xsl:template match="m:apply[m:limit]/m:lowlimit" priority="3">
- <xsl:apply-templates select="../m:bvar/node()"/>
- <xsl:text>\to </xsl:text>
- <xsl:apply-templates/>
- </xsl:template>
- <!-- 4.4.7.4 tendsto -->
- <xsl:template match="m:apply[*[1][self::m:tendsto]]">
- <xsl:param name="p"/>
- <xsl:call-template name="binary">
- <xsl:with-param name="this-p" select="2"/>
- <xsl:with-param name="p" select="$p"/>
- <xsl:with-param name="mo">
- <xsl:choose>
- <xsl:when test="@type='above'">\searrow </xsl:when>
- <xsl:when test="@type='below'">\nearrow </xsl:when>
- <xsl:when test="@type='two-sided'">\rightarrow </xsl:when>
- <xsl:otherwise>\to </xsl:otherwise>
- </xsl:choose>
- </xsl:with-param>
- </xsl:call-template>
- </xsl:template>
- <!-- 4.4.8.1 common tringonometric functions 4.4.8.3 natural logarithm -->
- <xsl:template match="m:apply[*[1][
- self::m:sin or self::m:cos or self::m:tan or self::m:sec or
- self::m:csc or self::m:cot or self::m:sinh or self::m:cosh or
- self::m:tanh or self::m:coth or self::m:arcsin or self::m:arccos or
- self::m:arctan or self::m:ln]]">
- <xsl:text>\</xsl:text>
- <xsl:value-of select="local-name(*[1])"/>
- <xsl:text> </xsl:text>
- <xsl:apply-templates select="*[2]">
- <xsl:with-param name="p" select="7"/>
- </xsl:apply-templates>
- </xsl:template>
- <xsl:template match="m:sin | m:cos | m:tan | m:sec | m:csc |
- m:cot | m:sinh | m:cosh | m:tanh | m:coth |
- m:arcsin | m:arccos | m:arctan | m:ln">
- <xsl:text>\</xsl:text>
- <xsl:value-of select="local-name(.)"/>
- <xsl:text> </xsl:text>
- </xsl:template>
- <xsl:template match="m:apply[*[1][
- self::m:sech or self::m:csch or self::m:arccosh or
- self::m:arccot or self::m:arccoth or self::m:arccsc or
- self::m:arccsch or self::m:arcsec or self::m:arcsech or
- self::m:arcsinh or self::m:arctanh]]">
- <xsl:text>\mathrm{</xsl:text>
- <xsl:value-of select="local-name(*[1])"/>
- <xsl:text>\,}</xsl:text>
- <xsl:apply-templates select="*[2]">
- <xsl:with-param name="p" select="7"/>
- </xsl:apply-templates>
- </xsl:template>
- <xsl:template match="m:sech | m:csch | m:arccosh | m:arccot |
- m:arccoth | m:arccsc |m:arccsch |m:arcsec |
- m:arcsech | m:arcsinh | m:arctanh">
- <xsl:text>\mathrm{</xsl:text>
- <xsl:value-of select="local-name(.)"/>
- <xsl:text>}</xsl:text>
- </xsl:template>
- <!-- 4.4.8.2 exp -->
- <xsl:template match="m:apply[*[1][self::m:exp]]">
- <xsl:text>e^{</xsl:text><xsl:apply-templates select="*[2]"/><xsl:text>}</xsl:text>
- </xsl:template>
- <!-- 4.4.8.4 log -->
- <xsl:template match="m:apply[*[1][self::m:log]]">
- <xsl:text>\lg </xsl:text>
- <xsl:apply-templates select="*[last()]">
- <xsl:with-param name="p" select="7"/>
- </xsl:apply-templates>
- </xsl:template>
- <xsl:template match="m:apply[*[1][self::m:log] and m:logbase != 10]">
- <xsl:text>\log_{</xsl:text>
- <xsl:apply-templates select="m:logbase/node()"/>
- <xsl:text>}</xsl:text>
- <xsl:apply-templates select="*[last()]">
- <xsl:with-param name="p" select="7"/>
- </xsl:apply-templates>
- </xsl:template>
- <!-- 4.4.9.1 mean -->
- <xsl:template match="m:apply[*[1][self::m:mean]]">
- <xsl:text>\left\langle </xsl:text>
- <xsl:for-each select="*[position()>1]">
- <xsl:apply-templates select="."/>
- <xsl:if test="position() !=last()"><xsl:text>, </xsl:text></xsl:if>
- </xsl:for-each>
- <xsl:text>\right\rangle </xsl:text>
- </xsl:template>
- <!-- 4.4.9.2 sdef -->
- <xsl:template match="m:sdev"><xsl:text>\sigma </xsl:text></xsl:template>
- <!-- 4.4.9.3 variance -->
- <xsl:template match="m:apply[*[1][self::m:variance]]">
- <xsl:text>\sigma(</xsl:text>
- <xsl:apply-templates select="*[2]"/>
- <xsl:text>)^2</xsl:text>
- </xsl:template>
- <!-- 4.4.9.5 moment -->
- <xsl:template match="m:apply[*[1][self::m:moment]]">
- <xsl:text>\left\langle </xsl:text>
- <xsl:apply-templates select="*[last()]"/>
- <xsl:text>^{</xsl:text>
- <xsl:apply-templates select="m:degree/node()"/>
- <xsl:text>}\right\rangle</xsl:text>
- <xsl:if test="m:momentabout">
- <xsl:text>_{</xsl:text>
- <xsl:apply-templates select="m:momentabout/node()"/>
- <xsl:text>}</xsl:text>
- </xsl:if>
- <xsl:text> </xsl:text>
- </xsl:template>
- <!-- 4.4.10.1 vector -->
- <xsl:template match="m:vector">
- <xsl:text>\left(\begin{array}{c}</xsl:text>
- <xsl:for-each select="*">
- <xsl:apply-templates select="."/>
- <xsl:if test="position()!=last()"><xsl:text>\\ </xsl:text></xsl:if>
- </xsl:for-each>
- <xsl:text>\end{array}\right)</xsl:text>
- </xsl:template>
- <!-- 4.4.10.2 matrix -->
- <xsl:template match="m:matrix">
- <xsl:text>\begin{pmatrix}</xsl:text>
- <xsl:apply-templates/>
- <xsl:text>\end{pmatrix}</xsl:text>
- </xsl:template>
- <!-- 4.4.10.3 matrixrow -->
- <xsl:template match="m:matrixrow">
- <xsl:for-each select="*">
- <xsl:apply-templates select="."/>
- <xsl:if test="position()!=last()"><xsl:text> & </xsl:text></xsl:if>
- </xsl:for-each>
- <xsl:if test="position()!=last()"><xsl:text>\\ </xsl:text></xsl:if>
- </xsl:template>
- <!-- 4.4.10.4 determinant -->
- <xsl:template match="m:apply[*[1][self::m:determinant]]">
- <xsl:text>\det </xsl:text>
- <xsl:apply-templates select="*[2]">
- <xsl:with-param name="p" select="7"/>
- </xsl:apply-templates>
- </xsl:template>
- <xsl:template match="m:apply[*[1][self::m:determinant]][*[2][self::m:matrix]]" priority="2">
- <xsl:text>\begin{vmatrix}</xsl:text>
- <xsl:apply-templates select="m:matrix/*"/>
- <xsl:text>\end{vmatrix}</xsl:text>
- </xsl:template>
- <!-- 4.4.10.5 transpose -->
- <xsl:template match="m:apply[*[1][self::m:transpose]]">
- <xsl:apply-templates select="*[2]">
- <xsl:with-param name="p" select="7"/>
- </xsl:apply-templates>
- <xsl:text>^T</xsl:text>
- </xsl:template>
- <!-- 4.4.10.5 selector -->
- <xsl:template match="m:apply[*[1][self::m:selector]]">
- <xsl:apply-templates select="*[2]">
- <xsl:with-param name="p" select="7"/>
- </xsl:apply-templates>
- <xsl:text>_{</xsl:text>
- <xsl:for-each select="*[position()>2]">
- <xsl:apply-templates select="."/>
- <xsl:if test="position() !=last()"><xsl:text>, </xsl:text></xsl:if>
- </xsl:for-each>
- <xsl:text>}</xsl:text>
- </xsl:template>
- <!-- 4.4.10.7 scalarproduct 4.4.10.8 outerproduct -->
- <xsl:template match="m:apply[*[1][self::m:scalarproduct or self::m:outerproduct]]">
- <xsl:param name="p" select="0"/>
- <xsl:call-template name="infix">
- <xsl:with-param name="this-p" select="2"/>
- <xsl:with-param name="p" select="$p"/>
- <xsl:with-param name="mo">\dot </xsl:with-param>
- </xsl:call-template>
- </xsl:template>
- <!-- 4.4.11.2 semantics -->
- <xsl:template match="m:semantics"><xsl:apply-templates select="*[1]"/></xsl:template>
- <xsl:template match="m:semantics[m:annotation/@encoding='TeX']">
- <xsl:apply-templates select="m:annotation[@encoding='TeX']/node()"/>
- </xsl:template>
- <!-- 4.4.12.1 integers -->
- <xsl:template match="m:integers"><xsl:text>\mathbb{Z}</xsl:text></xsl:template>
- <!-- 4.4.12.2 reals -->
- <xsl:template match="m:reals"><xsl:text>\mathbb{R}</xsl:text></xsl:template>
- <!-- 4.4.12.3 rationals -->
- <xsl:template match="m:rationals"><xsl:text>\mathbb{Q}</xsl:text></xsl:template>
- <!-- 4.4.12.4 naturalnumbers -->
- <xsl:template match="m:naturalnumbers"><xsl:text>\mathbb{N}</xsl:text></xsl:template>
- <!-- 4.4.12.5 complexes -->
- <xsl:template match="m:complexes"><xsl:text>\mathbb{C}</xsl:text></xsl:template>
- <!-- 4.4.12.6 primes -->
- <xsl:template match="m:primes"><xsl:text>\mathbb{P}</xsl:text></xsl:template>
- <!-- 4.4.12.7 exponentiale -->
- <xsl:template match="m:exponentiale"><xsl:text>e</xsl:text></xsl:template>
- <!-- 4.4.12.8 imaginaryi -->
- <xsl:template match="m:imaginaryi"><xsl:text>i</xsl:text></xsl:template>
- <!-- 4.4.12.9 notanumber -->
- <xsl:template match="m:notanumber"><xsl:text>NaN</xsl:text></xsl:template>
- <!-- 4.4.12.10 true -->
- <xsl:template match="m:true"><xsl:text>\mbox{true}</xsl:text></xsl:template>
- <!-- 4.4.12.11 false -->
- <xsl:template match="m:false"><xsl:text>\mbox{false}</xsl:text></xsl:template>
- <!-- 4.4.12.12 emptyset -->
- <xsl:template match="m:emptyset"><xsl:text>\emptyset </xsl:text></xsl:template>
- <!-- 4.4.12.13 pi -->
- <xsl:template match="m:pi"><xsl:text>\pi </xsl:text></xsl:template>
- <!-- 4.4.12.14 eulergamma -->
- <xsl:template match="m:eulergamma"><xsl:text>\gamma </xsl:text></xsl:template>
- <!-- 4.4.12.15 infinity -->
- <xsl:template match="m:infinity"><xsl:text>\infty </xsl:text></xsl:template>
- <!-- ****************************** -->
- <xsl:template name="infix" >
- <xsl:param name="mo"/>
- <xsl:param name="p" select="0"/>
- <xsl:param name="this-p" select="0"/>
- <xsl:if test="$this-p < $p"><xsl:text>(</xsl:text></xsl:if>
- <xsl:for-each select="*[position()>1]">
- <xsl:if test="position() > 1">
- <xsl:copy-of select="$mo"/>
- </xsl:if>
- <xsl:apply-templates select=".">
- <xsl:with-param name="p" select="$this-p"/>
- </xsl:apply-templates>
- </xsl:for-each>
- <xsl:if test="$this-p < $p"><xsl:text>)</xsl:text></xsl:if>
- </xsl:template>
- <xsl:template name="binary" >
- <xsl:param name="mo"/>
- <xsl:param name="p" select="0"/>
- <xsl:param name="this-p" select="0"/>
- <xsl:if test="$this-p < $p"><xsl:text>(</xsl:text></xsl:if>
- <xsl:apply-templates select="*[2]">
- <xsl:with-param name="p" select="$this-p"/>
- </xsl:apply-templates>
- <xsl:value-of select="$mo"/>
- <xsl:apply-templates select="*[3]">
- <xsl:with-param name="p" select="$this-p"/>
- </xsl:apply-templates>
- <xsl:if test="$this-p < $p"><xsl:text>)</xsl:text></xsl:if>
- </xsl:template>
- <!-- ====================================================================== -->
- <!-- $id: entities.xsl, 2002/22/11 Exp $
- This file is part of the XSLT MathML Library distribution.
- See ./README or http://www.raleigh.ru/MathML/mmltex for
- copyright and other information -->
- <!-- ====================================================================== -->
- <xsl:template name="replaceEntities">
- <xsl:param name="content"/>
- <xsl:if test="string-length($content)>0">
- <xsl:choose>
- <xsl:when test="starts-with($content,'ɛ')"><xsl:value-of select="'\varepsilon '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, 'ɛ')"/></xsl:call-template></xsl:when> <!--/varepsilon -->
- <!-- ====================================================================== -->
- <!-- Unicode 3.2
- Greek
- Range: 0370-03FF
- http://www.unicode.org/charts/PDF/U0370.pdf -->
- <!-- ====================================================================== -->
- <xsl:when test="starts-with($content,'Γ')"><xsl:value-of select="'\Gamma '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, 'Γ')"/></xsl:call-template></xsl:when> <!--/Gamma capital Gamma, Greek -->
- <xsl:when test="starts-with($content,'Δ')"><xsl:value-of select="'\Delta '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, 'Δ')"/></xsl:call-template></xsl:when> <!--/Delta capital Delta, Greek -->
- <xsl:when test="starts-with($content,'Θ')"><xsl:value-of select="'\Theta '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, 'Θ')"/></xsl:call-template></xsl:when> <!--/Theta capital Theta, Greek -->
- <xsl:when test="starts-with($content,'Λ')"><xsl:value-of select="'\Lambda '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, 'Λ')"/></xsl:call-template></xsl:when> <!--/Lambda capital Lambda, Greek -->
- <xsl:when test="starts-with($content,'Ξ')"><xsl:value-of select="'\Xi '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, 'Ξ')"/></xsl:call-template></xsl:when> <!--/Xi capital Xi, Greek -->
- <xsl:when test="starts-with($content,'Π')"><xsl:value-of select="'\Pi '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, 'Π')"/></xsl:call-template></xsl:when> <!--/Pi capital Pi, Greek -->
- <xsl:when test="starts-with($content,'Σ')"><xsl:value-of select="'\Sigma '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, 'Σ')"/></xsl:call-template></xsl:when> <!--/Sigma capital Sigma, Greek -->
- <xsl:when test="starts-with($content,'Φ')"><xsl:value-of select="'\Phi '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, 'Φ')"/></xsl:call-template></xsl:when> <!--/Phi capital Phi, Greek -->
- <xsl:when test="starts-with($content,'Ψ')"><xsl:value-of select="'\Psi '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, 'Ψ')"/></xsl:call-template></xsl:when> <!--/Psi capital Psi, Greek -->
- <xsl:when test="starts-with($content,'Ω')"><xsl:value-of select="'\Omega '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, 'Ω')"/></xsl:call-template></xsl:when> <!--/Omega capital Omega, Greek -->
- <xsl:when test="starts-with($content,'α')"><xsl:value-of select="'\alpha '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, 'α')"/></xsl:call-template></xsl:when> <!--/alpha small alpha, Greek -->
- <xsl:when test="starts-with($content,'β')"><xsl:value-of select="'\beta '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, 'β')"/></xsl:call-template></xsl:when> <!--/beta small beta, Greek -->
- <xsl:when test="starts-with($content,'γ')"><xsl:value-of select="'\gamma '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, 'γ')"/></xsl:call-template></xsl:when> <!--/gamma small gamma, Greek -->
- <xsl:when test="starts-with($content,'δ')"><xsl:value-of select="'\delta '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, 'δ')"/></xsl:call-template></xsl:when> <!--/delta small delta, Greek -->
- <xsl:when test="starts-with($content,'ε')"><xsl:value-of select="'\epsilon '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, 'ε')"/></xsl:call-template></xsl:when> <!--/straightepsilon, small epsilon, Greek -->
- <xsl:when test="starts-with($content,'ζ')"><xsl:value-of select="'\zeta '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, 'ζ')"/></xsl:call-template></xsl:when> <!--/zeta small zeta, Greek -->
- <xsl:when test="starts-with($content,'η')"><xsl:value-of select="'\eta '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, 'η')"/></xsl:call-template></xsl:when> <!--/eta small eta, Greek -->
- <xsl:when test="starts-with($content,'θ')"><xsl:value-of select="'\theta '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, 'θ')"/></xsl:call-template></xsl:when> <!--/theta straight theta, small theta, Greek -->
- <xsl:when test="starts-with($content,'ι')"><xsl:value-of select="'\iota '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, 'ι')"/></xsl:call-template></xsl:when> <!--/iota small iota, Greek -->
- <xsl:when test="starts-with($content,'κ')"><xsl:value-of select="'\kappa '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, 'κ')"/></xsl:call-template></xsl:when> <!--/kappa small kappa, Greek -->
- <xsl:when test="starts-with($content,'λ')"><xsl:value-of select="'\lambda '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, 'λ')"/></xsl:call-template></xsl:when> <!--/lambda small lambda, Greek -->
- <xsl:when test="starts-with($content,'μ')"><xsl:value-of select="'\mu '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, 'μ')"/></xsl:call-template></xsl:when> <!--/mu small mu, Greek -->
- <xsl:when test="starts-with($content,'ν')"><xsl:value-of select="'\nu '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, 'ν')"/></xsl:call-template></xsl:when> <!--/nu small nu, Greek -->
- <xsl:when test="starts-with($content,'ξ')"><xsl:value-of select="'\xi '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, 'ξ')"/></xsl:call-template></xsl:when> <!--/xi small xi, Greek -->
- <xsl:when test="starts-with($content,'π')"><xsl:value-of select="'\pi '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, 'π')"/></xsl:call-template></xsl:when> <!--/pi small pi, Greek -->
- <xsl:when test="starts-with($content,'ρ')"><xsl:value-of select="'\rho '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, 'ρ')"/></xsl:call-template></xsl:when> <!--/rho small rho, Greek -->
- <xsl:when test="starts-with($content,'ς')"><xsl:value-of select="'\varsigma '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, 'ς')"/></xsl:call-template></xsl:when> <!--/varsigma -->
- <xsl:when test="starts-with($content,'σ')"><xsl:value-of select="'\sigma '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, 'σ')"/></xsl:call-template></xsl:when> <!--/sigma small sigma, Greek -->
- <xsl:when test="starts-with($content,'τ')"><xsl:value-of select="'\tau '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, 'τ')"/></xsl:call-template></xsl:when> <!--/tau small tau, Greek -->
- <xsl:when test="starts-with($content,'υ')"><xsl:value-of select="'\upsilon '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, 'υ')"/></xsl:call-template></xsl:when> <!--/upsilon small upsilon, Greek -->
- <xsl:when test="starts-with($content,'φ')"><xsl:value-of select="'\phi '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, 'φ')"/></xsl:call-template></xsl:when> <!--/straightphi - small phi, Greek -->
- <xsl:when test="starts-with($content,'χ')"><xsl:value-of select="'\chi '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, 'χ')"/></xsl:call-template></xsl:when> <!--/chi small chi, Greek -->
- <xsl:when test="starts-with($content,'ψ')"><xsl:value-of select="'\psi '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, 'ψ')"/></xsl:call-template></xsl:when> <!--/psi small psi, Greek -->
- <xsl:when test="starts-with($content,'ω')"><xsl:value-of select="'\omega '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, 'ω')"/></xsl:call-template></xsl:when> <!--/omega small omega, Greek -->
- <xsl:when test="starts-with($content,'ϑ')"><xsl:value-of select="'\vartheta '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, 'ϑ')"/></xsl:call-template></xsl:when> <!--/vartheta - curly or open theta -->
- <xsl:when test="starts-with($content,'ϒ')"><xsl:value-of select="'\Upsilon '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, 'ϒ')"/></xsl:call-template></xsl:when> <!--/Upsilon capital Upsilon, Greek -->
- <xsl:when test="starts-with($content,'ϕ')"><xsl:value-of select="'\varphi '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, 'ϕ')"/></xsl:call-template></xsl:when> <!--/varphi - curly or open phi -->
- <xsl:when test="starts-with($content,'ϖ')"><xsl:value-of select="'\varpi '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, 'ϖ')"/></xsl:call-template></xsl:when> <!--/varpi -->
- <xsl:when test="starts-with($content,'ϰ')"><xsl:value-of select="'\varkappa '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, 'ϰ')"/></xsl:call-template></xsl:when> <!--/varkappa -->
- <xsl:when test="starts-with($content,'ϱ')"><xsl:value-of select="'\varrho '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, 'ϱ')"/></xsl:call-template></xsl:when> <!--/varrho -->
- <!-- ====================================================================== -->
- <xsl:when test="starts-with($content,'​')"><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '​')"/></xsl:call-template></xsl:when> <!--short form of ⁣ -->
- <xsl:when test="starts-with($content,'…')"><xsl:value-of select="'\dots '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '…')"/></xsl:call-template></xsl:when>
- <xsl:when test="starts-with($content,'′')"><xsl:value-of select="'\prime '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '′')"/></xsl:call-template></xsl:when> <!--/prime prime or minute -->
- <xsl:when test="starts-with($content,'⁡')"><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '⁡')"/></xsl:call-template></xsl:when> <!-- ApplyFunction -->
- <xsl:when test="starts-with($content,'⁢')"><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '⁢')"/></xsl:call-template></xsl:when> <!-- InvisibleTimes -->
- <!-- ====================================================================== -->
- <!-- Unicode 3.2
- Letterlike Symbols
- Range: 2100-214F
- http://www.unicode.org/charts/PDF/U2100.pdf -->
- <!-- ====================================================================== -->
- <xsl:when test="starts-with($content,'ℏ︀')"><xsl:value-of select="'\hbar '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, 'ℏ︀')"/></xsl:call-template></xsl:when> <!--/hbar - Planck's over 2pi -->
- <xsl:when test="starts-with($content,'ℏ')"><xsl:value-of select="'\hslash '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, 'ℏ')"/></xsl:call-template></xsl:when> <!--/hslash - variant Planck's over 2pi --> <!-- Required amssymb -->
- <xsl:when test="starts-with($content,'ℑ')"><xsl:value-of select="'\Im '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, 'ℑ')"/></xsl:call-template></xsl:when> <!--/Im - imaginary -->
- <xsl:when test="starts-with($content,'ℓ')"><xsl:value-of select="'\ell '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, 'ℓ')"/></xsl:call-template></xsl:when> <!--/ell - cursive small l -->
- <xsl:when test="starts-with($content,'℘')"><xsl:value-of select="'\wp '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '℘')"/></xsl:call-template></xsl:when> <!--/wp - Weierstrass p -->
- <xsl:when test="starts-with($content,'ℜ')"><xsl:value-of select="'\Re '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, 'ℜ')"/></xsl:call-template></xsl:when> <!--/Re - real -->
- <xsl:when test="starts-with($content,'℧')"><xsl:value-of select="'\mho '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '℧')"/></xsl:call-template></xsl:when> <!--/mho - conductance -->
- <xsl:when test="starts-with($content,'ℵ')"><xsl:value-of select="'\aleph '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, 'ℵ')"/></xsl:call-template></xsl:when> <!--/aleph aleph, Hebrew -->
- <xsl:when test="starts-with($content,'ℶ')"><xsl:value-of select="'\beth '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, 'ℶ')"/></xsl:call-template></xsl:when> <!--/beth - beth, Hebrew --> <!-- Required amssymb -->
- <xsl:when test="starts-with($content,'ℷ')"><xsl:value-of select="'\gimel '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, 'ℷ')"/></xsl:call-template></xsl:when> <!--/gimel - gimel, Hebrew --> <!-- Required amssymb -->
- <xsl:when test="starts-with($content,'ℸ')"><xsl:value-of select="'\daleth '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, 'ℸ')"/></xsl:call-template></xsl:when> <!--/daleth - daleth, Hebrew --> <!-- Required amssymb -->
- <xsl:when test="starts-with($content,'ⅅ')"><xsl:value-of select="'D'" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, 'ⅅ')"/></xsl:call-template></xsl:when> <!--D for use in differentials, e.g., within integrals -->
- <xsl:when test="starts-with($content,'ⅆ')"><xsl:value-of select="'d'" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, 'ⅆ')"/></xsl:call-template></xsl:when> <!--d for use in differentials, e.g., within integrals -->
- <xsl:when test="starts-with($content,'ⅇ')"><xsl:value-of select="'e'" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, 'ⅇ')"/></xsl:call-template></xsl:when> <!--e use for the exponential base of the natural logarithms -->
- <xsl:when test="starts-with($content,'ⅈ')"><xsl:value-of select="'i'" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, 'ⅈ')"/></xsl:call-template></xsl:when> <!--i for use as a square root of -1 -->
- <!-- ====================================================================== -->
- <xsl:when test="starts-with($content,'→')"><xsl:value-of select="'\to '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '→')"/></xsl:call-template></xsl:when> <!--/rightarrow /to A: =rightward arrow -->
- <!-- ====================================================================== -->
- <!-- Unicode 3.2
- Mathematical Operators
- Range: 2200-22FF
- http://www.unicode.org/charts/PDF/U2200.pdf -->
- <!-- ====================================================================== -->
- <xsl:when test="starts-with($content,'∀')"><xsl:value-of select="'\forall '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '∀')"/></xsl:call-template></xsl:when> <!--/forall for all -->
- <xsl:when test="starts-with($content,'∁')"><xsl:value-of select="'\complement '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '∁')"/></xsl:call-template></xsl:when> <!--/complement - complement sign --> <!-- Required amssymb -->
- <xsl:when test="starts-with($content,'∂')"><xsl:value-of select="'\partial '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '∂')"/></xsl:call-template></xsl:when> <!--/partial partial differential -->
- <xsl:when test="starts-with($content,'∃')"><xsl:value-of select="'\exists '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '∃')"/></xsl:call-template></xsl:when> <!--/exists at least one exists -->
- <xsl:when test="starts-with($content,'∄')"><xsl:value-of select="'\nexists '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '∄')"/></xsl:call-template></xsl:when> <!--/nexists - negated exists --> <!-- Required amssymb -->
- <xsl:when test="starts-with($content,'∅︀')"><xsl:value-of select="'\emptyset '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '∅︀')"/></xsl:call-template></xsl:when> <!--/emptyset - zero, slash -->
- <xsl:when test="starts-with($content,'∅')"><xsl:value-of select="'\varnothing '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '∅')"/></xsl:call-template></xsl:when> <!--/varnothing - circle, slash --> <!-- Required amssymb -->
- <!-- <xsl:when test="starts-with($content,'∆')"><xsl:value-of select="' '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '∆')"/></xsl:call-template></xsl:when>-->
- <xsl:when test="starts-with($content,'∇')"><xsl:value-of select="'\nabla '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '∇')"/></xsl:call-template></xsl:when> <!--/nabla del, Hamilton operator -->
- <xsl:when test="starts-with($content,'∈')"><xsl:value-of select="'\in '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '∈')"/></xsl:call-template></xsl:when> <!--/in R: set membership -->
- <xsl:when test="starts-with($content,'∉')"><xsl:value-of select="'\notin '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '∉')"/></xsl:call-template></xsl:when> <!--/notin N: negated set membership -->
- <xsl:when test="starts-with($content,'∋')"><xsl:value-of select="'\ni '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '∋')"/></xsl:call-template></xsl:when> <!--/ni /owns R: contains -->
- <xsl:when test="starts-with($content,'∌')"><xsl:value-of select="'\not\ni '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '∌')"/></xsl:call-template></xsl:when> <!--negated contains -->
- <xsl:when test="starts-with($content,'∏')"><xsl:value-of select="'\prod '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '∏')"/></xsl:call-template></xsl:when> <!--/prod L: product operator -->
- <xsl:when test="starts-with($content,'∐')"><xsl:value-of select="'\coprod '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '∐')"/></xsl:call-template></xsl:when> <!--/coprod L: coproduct operator -->
- <xsl:when test="starts-with($content,'∑')"><xsl:value-of select="'\sum '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '∑')"/></xsl:call-template></xsl:when> <!--/sum L: summation operator -->
- <xsl:when test="starts-with($content,'−')"><xsl:value-of select="'-'" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '−')"/></xsl:call-template></xsl:when> <!--B: minus sign -->
- <xsl:when test="starts-with($content,'∓')"><xsl:value-of select="'\mp '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '∓')"/></xsl:call-template></xsl:when> <!--/mp B: minus-or-plus sign -->
- <xsl:when test="starts-with($content,'∔')"><xsl:value-of select="'\dotplus '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '∔')"/></xsl:call-template></xsl:when> <!--/dotplus B: plus sign, dot above --> <!-- Required amssymb -->
- <!-- <xsl:when test="starts-with($content,'∕')"><xsl:value-of select="' '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '∕')"/></xsl:call-template></xsl:when>-->
- <xsl:when test="starts-with($content,'∖')"><xsl:value-of select="'\setminus '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '∖')"/></xsl:call-template></xsl:when> <!--/setminus B: reverse solidus -->
- <xsl:when test="starts-with($content,'∗')"><xsl:value-of select="'\ast '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '∗')"/></xsl:call-template></xsl:when> <!--low asterisk -->
- <xsl:when test="starts-with($content,'∘')"><xsl:value-of select="'\circ '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '∘')"/></xsl:call-template></xsl:when> <!--/circ B: composite function (small circle) -->
- <xsl:when test="starts-with($content,'∙')"><xsl:value-of select="'\bullet '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '∙')"/></xsl:call-template></xsl:when>
- <xsl:when test="starts-with($content,'√')"><xsl:value-of select="'\surd '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '√')"/></xsl:call-template></xsl:when> <!--/surd radical -->
- <xsl:when test="starts-with($content,'∝')"><xsl:value-of select="'\propto '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '∝')"/></xsl:call-template></xsl:when> <!--/propto R: is proportional to -->
- <xsl:when test="starts-with($content,'∞')"><xsl:value-of select="'\infty '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '∞')"/></xsl:call-template></xsl:when> <!--/infty infinity -->
- <!-- <xsl:when test="starts-with($content,'∟')"><xsl:value-of select="' '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '∟')"/></xsl:call-template></xsl:when> right (90 degree) angle -->
- <xsl:when test="starts-with($content,'∠')"><xsl:value-of select="'\angle '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '∠')"/></xsl:call-template></xsl:when> <!--/angle - angle -->
- <xsl:when test="starts-with($content,'∡')"><xsl:value-of select="'\measuredangle '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '∡')"/></xsl:call-template></xsl:when> <!--/measuredangle - angle-measured --> <!-- Required amssymb -->
- <xsl:when test="starts-with($content,'∢')"><xsl:value-of select="'\sphericalangle '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '∢')"/></xsl:call-template></xsl:when><!--/sphericalangle angle-spherical --> <!-- Required amssymb -->
- <xsl:when test="starts-with($content,'∣')"><xsl:value-of select="'\mid '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '∣')"/></xsl:call-template></xsl:when> <!--/mid R: -->
- <xsl:when test="starts-with($content,'∤︀')"><xsl:value-of select="'\nshortmid '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '∤︀')"/></xsl:call-template></xsl:when> <!--/nshortmid --> <!-- Required amssymb -->
- <xsl:when test="starts-with($content,'∤')"><xsl:value-of select="'\nmid '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '∤')"/></xsl:call-template></xsl:when> <!--/nmid --> <!-- Required amssymb -->
- <xsl:when test="starts-with($content,'∥')"><xsl:value-of select="'\parallel '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '∥')"/></xsl:call-template></xsl:when> <!--/parallel R: parallel -->
- <xsl:when test="starts-with($content,'∦︀')"><xsl:value-of select="'\nshortparallel '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '∦︀')"/></xsl:call-template></xsl:when> <!--/nshortparallel N: not short par --> <!-- Required amssymb -->
- <xsl:when test="starts-with($content,'∦')"><xsl:value-of select="'\nparallel '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '∦')"/></xsl:call-template></xsl:when> <!--/nparallel N: not parallel --> <!-- Required amssymb -->
- <xsl:when test="starts-with($content,'∧')"><xsl:value-of select="'\wedge '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '∧')"/></xsl:call-template></xsl:when> <!--/wedge /land B: logical and -->
- <xsl:when test="starts-with($content,'∨')"><xsl:value-of select="'\vee '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '∨')"/></xsl:call-template></xsl:when> <!--/vee /lor B: logical or -->
- <xsl:when test="starts-with($content,'∩')"><xsl:value-of select="'\cap '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '∩')"/></xsl:call-template></xsl:when> <!--/cap B: intersection -->
- <xsl:when test="starts-with($content,'∪')"><xsl:value-of select="'\cup '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '∪')"/></xsl:call-template></xsl:when> <!--/cup B: union or logical sum -->
- <xsl:when test="starts-with($content,'∫')"><xsl:value-of select="'\int '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '∫')"/></xsl:call-template></xsl:when> <!--/int L: integral operator -->
- <xsl:when test="starts-with($content,'∬')"><xsl:value-of select="'\iint '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '∬')"/></xsl:call-template></xsl:when> <!--double integral operator --> <!-- Required amsmath -->
- <xsl:when test="starts-with($content,'∭')"><xsl:value-of select="'\iiint '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '∭')"/></xsl:call-template></xsl:when> <!--/iiint triple integral operator --> <!-- Required amsmath -->
- <xsl:when test="starts-with($content,'∮')"><xsl:value-of select="'\oint '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '∮')"/></xsl:call-template></xsl:when> <!--/oint L: contour integral operator -->
- <!-- <xsl:when test="starts-with($content,'∯')"><xsl:value-of select="' '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '∯')"/></xsl:call-template></xsl:when>-->
- <!-- <xsl:when test="starts-with($content,'∰')"><xsl:value-of select="' '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '∰')"/></xsl:call-template></xsl:when>-->
- <!-- <xsl:when test="starts-with($content,'∱')"><xsl:value-of select="' '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '∱')"/></xsl:call-template></xsl:when>-->
- <!-- <xsl:when test="starts-with($content,'∲')"><xsl:value-of select="' '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '∲')"/></xsl:call-template></xsl:when>-->
- <!-- <xsl:when test="starts-with($content,'∳')"><xsl:value-of select="' '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '∳')"/></xsl:call-template></xsl:when>-->
- <xsl:when test="starts-with($content,'∴')"><xsl:value-of select="'\therefore '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '∴')"/></xsl:call-template></xsl:when> <!--/therefore R: therefore --> <!-- Required amssymb -->
- <xsl:when test="starts-with($content,'∵')"><xsl:value-of select="'\because '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '∵')"/></xsl:call-template></xsl:when> <!--/because R: because --> <!-- Required amssymb -->
- <!-- ? --> <xsl:when test="starts-with($content,'∶')"><xsl:value-of select="':'" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '∶')"/></xsl:call-template></xsl:when> <!--/ratio -->
- <!-- ? --> <xsl:when test="starts-with($content,'∷')"><xsl:value-of select="'\colon\colon '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '∷')"/></xsl:call-template></xsl:when> <!--/Colon, two colons -->
- <!-- ? --> <xsl:when test="starts-with($content,'∸')"><xsl:value-of select="'\dot{-}'" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '∸')"/></xsl:call-template></xsl:when> <!--/dotminus B: minus sign, dot above -->
- <!-- <xsl:when test="starts-with($content,'∹')"><xsl:value-of select="' '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '∹')"/></xsl:call-template></xsl:when> -->
- <!-- <xsl:when test="starts-with($content,'∺')"><xsl:value-of select="' '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '∺')"/></xsl:call-template></xsl:when> minus with four dots, geometric properties -->
- <!-- <xsl:when test="starts-with($content,'∻')"><xsl:value-of select="' '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '∻')"/></xsl:call-template></xsl:when> homothetic -->
- <xsl:when test="starts-with($content,'∼')"><xsl:value-of select="'\sim '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '∼')"/></xsl:call-template></xsl:when> <!--/sim R: similar -->
- <xsl:when test="starts-with($content,'∽')"><xsl:value-of select="'\backsim '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '∽')"/></xsl:call-template></xsl:when> <!--/backsim R: reverse similar --> <!-- Required amssymb -->
- <!-- <xsl:when test="starts-with($content,'∾')"><xsl:value-of select="' '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '∾')"/></xsl:call-template></xsl:when> most positive -->
- <!-- <xsl:when test="starts-with($content,'∿')"><xsl:value-of select="' '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '∿')"/></xsl:call-template></xsl:when> ac current -->
- <xsl:when test="starts-with($content,'≀')"><xsl:value-of select="'\wr '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '≀')"/></xsl:call-template></xsl:when> <!--/wr B: wreath product -->
- <xsl:when test="starts-with($content,'≁')"><xsl:value-of select="'\nsim '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '≁')"/></xsl:call-template></xsl:when> <!--/nsim N: not similar --> <!-- Required amssymb -->
- <xsl:when test="starts-with($content,'≂')"><xsl:value-of select="'\eqsim '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '≂')"/></xsl:call-template></xsl:when> <!--/esim R: equals, similar --> <!-- Required amssymb -->
- <xsl:when test="starts-with($content,'≃')"><xsl:value-of select="'\simeq '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '≃')"/></xsl:call-template></xsl:when> <!--/simeq R: similar, equals -->
- <xsl:when test="starts-with($content,'≄')"><xsl:value-of select="'\not\simeq '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '≄')"/></xsl:call-template></xsl:when> <!--/nsimeq N: not similar, equals -->
- <xsl:when test="starts-with($content,'≅')"><xsl:value-of select="'\cong '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '≅')"/></xsl:call-template></xsl:when> <!--/cong R: congruent with -->
- <!-- <xsl:when test="starts-with($content,'≆')"><xsl:value-of select="' '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '≆')"/></xsl:call-template></xsl:when> similar, not equals -->
- <xsl:when test="starts-with($content,'≇')"><xsl:value-of select="'\ncong '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '≇')"/></xsl:call-template></xsl:when> <!--/ncong N: not congruent with --> <!-- Required amssymb -->
- <xsl:when test="starts-with($content,'≈')"><xsl:value-of select="'\approx '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '≈')"/></xsl:call-template></xsl:when> <!--/approx R: approximate -->
- <!-- <xsl:when test="starts-with($content,'≉̸')"><xsl:value-of select="' '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '≉̸')"/></xsl:call-template></xsl:when> not, vert, approximate -->
- <xsl:when test="starts-with($content,'≉')"><xsl:value-of select="'\not\approx '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '≉')"/></xsl:call-template></xsl:when> <!--/napprox N: not approximate -->
- <xsl:when test="starts-with($content,'≊')"><xsl:value-of select="'\approxeq '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '≊')"/></xsl:call-template></xsl:when> <!--/approxeq R: approximate, equals --> <!-- Required amssymb -->
- <!-- <xsl:when test="starts-with($content,'≋')"><xsl:value-of select="' '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '≋')"/></xsl:call-template></xsl:when> approximately identical to -->
- <!-- <xsl:when test="starts-with($content,'≌')"><xsl:value-of select="' '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '≌')"/></xsl:call-template></xsl:when> /backcong R: reverse congruent -->
- <xsl:when test="starts-with($content,'≍')"><xsl:value-of select="'\asymp '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '≍')"/></xsl:call-template></xsl:when> <!--/asymp R: asymptotically equal to -->
- <xsl:when test="starts-with($content,'≎')"><xsl:value-of select="'\Bumpeq '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '≎')"/></xsl:call-template></xsl:when> <!--/Bumpeq R: bumpy equals --> <!-- Required amssymb -->
- <xsl:when test="starts-with($content,'≏')"><xsl:value-of select="'\bumpeq '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '≏')"/></xsl:call-template></xsl:when> <!--/bumpeq R: bumpy equals, equals --> <!-- Required amssymb -->
- <xsl:when test="starts-with($content,'≐')"><xsl:value-of select="'\doteq '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '≐')"/></xsl:call-template></xsl:when> <!--/doteq R: equals, single dot above -->
- <xsl:when test="starts-with($content,'≑')"><xsl:value-of select="'\doteqdot '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '≑')"/></xsl:call-template></xsl:when> <!--/doteqdot /Doteq R: eq, even dots --> <!-- Required amssymb -->
- <xsl:when test="starts-with($content,'≒')"><xsl:value-of select="'\fallingdotseq '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '≒')"/></xsl:call-template></xsl:when> <!--/fallingdotseq R: eq, falling dots --> <!-- Required amssymb -->
- <xsl:when test="starts-with($content,'≓')"><xsl:value-of select="'\risingdotseq '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '≓')"/></xsl:call-template></xsl:when> <!--/risingdotseq R: eq, rising dots --> <!-- Required amssymb -->
- <!-- <xsl:when test="starts-with($content,'≔')"><xsl:value-of select="' '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '≔')"/></xsl:call-template></xsl:when> /coloneq R: colon, equals -->
- <!-- <xsl:when test="starts-with($content,'≕')"><xsl:value-of select="' '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '≕')"/></xsl:call-template></xsl:when> /eqcolon R: equals, colon -->
- <xsl:when test="starts-with($content,'≖')"><xsl:value-of select="'\eqcirc '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '≖')"/></xsl:call-template></xsl:when> <!--/eqcirc R: circle on equals sign --> <!-- Required amssymb -->
- <xsl:when test="starts-with($content,'≗')"><xsl:value-of select="'\circeq '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '≗')"/></xsl:call-template></xsl:when> <!--/circeq R: circle, equals --> <!-- Required amssymb -->
- <!-- ? --> <xsl:when test="starts-with($content,'≘')"><xsl:value-of select="'\stackrel{\frown}{=}'" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '≘')"/></xsl:call-template></xsl:when>
- <!-- ? --> <xsl:when test="starts-with($content,'≙')"><xsl:value-of select="'\stackrel{\wedge}{=}'" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '≙')"/></xsl:call-template></xsl:when> <!--/wedgeq R: corresponds to (wedge, equals) -->
- <!-- ? --> <xsl:when test="starts-with($content,'≚')"><xsl:value-of select="'\stackrel{\vee}{=}'" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '≚')"/></xsl:call-template></xsl:when> <!--logical or, equals -->
- <!-- ? --> <xsl:when test="starts-with($content,'≛')"><xsl:value-of select="'\stackrel{\star}{=}'" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '≛')"/></xsl:call-template></xsl:when> <!--equal, asterisk above -->
- <xsl:when test="starts-with($content,'≜')"><xsl:value-of select="'\triangleq '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '≜')"/></xsl:call-template></xsl:when> <!--/triangleq R: triangle, equals --> <!-- Required amssymb -->
- <!-- ? --> <xsl:when test="starts-with($content,'≝')"><xsl:value-of select="'\stackrel{\scriptscriptstyle\mathrm{def}}{=}'" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '≝')"/></xsl:call-template></xsl:when>
- <!-- ? --> <xsl:when test="starts-with($content,'≞')"><xsl:value-of select="'\stackrel{\scriptscriptstyle\mathrm{m}}{=}'" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '≞')"/></xsl:call-template></xsl:when>
- <!-- ? --> <xsl:when test="starts-with($content,'≟')"><xsl:value-of select="'\stackrel{?}{=}'" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '≟')"/></xsl:call-template></xsl:when> <!--/questeq R: equal with questionmark -->
- <!-- <xsl:when test="starts-with($content,'≠︀')"><xsl:value-of select="' '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '≠︀')"/></xsl:call-template></xsl:when> not equal, dot -->
- <xsl:when test="starts-with($content,'≠')"><xsl:value-of select="'\ne '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '≠')"/></xsl:call-template></xsl:when> <!--/ne /neq R: not equal -->
- <!-- <xsl:when test="starts-with($content,'≡⃥')"><xsl:value-of select="' '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '≡⃥')"/></xsl:call-template></xsl:when> reverse not equivalent -->
- <xsl:when test="starts-with($content,'≡')"><xsl:value-of select="'\equiv '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '≡')"/></xsl:call-template></xsl:when> <!--/equiv R: identical with -->
- <xsl:when test="starts-with($content,'≢')"><xsl:value-of select="'\not\equiv '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '≢')"/></xsl:call-template></xsl:when> <!--/nequiv N: not identical with -->
- <!-- <xsl:when test="starts-with($content,'≣')"><xsl:value-of select="' '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '≣')"/></xsl:call-template></xsl:when> -->
- <xsl:when test="starts-with($content,'≤')"><xsl:value-of select="'\le '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '≤')"/></xsl:call-template></xsl:when> <!--/leq /le R: less-than-or-equal -->
- <xsl:when test="starts-with($content,'≥')"><xsl:value-of select="'\ge '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '≥')"/></xsl:call-template></xsl:when> <!--/geq /ge R: greater-than-or-equal -->
- <xsl:when test="starts-with($content,'≦')"><xsl:value-of select="'\leqq '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '≦')"/></xsl:call-template></xsl:when> <!--/leqq R: less, double equals --> <!-- Required amssymb -->
- <xsl:when test="starts-with($content,'≧')"><xsl:value-of select="'\geqq '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '≧')"/></xsl:call-template></xsl:when> <!--/geqq R: greater, double equals --> <!-- Required amssymb -->
- <xsl:when test="starts-with($content,'≨')"><xsl:value-of select="'\lneqq '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '≨')"/></xsl:call-template></xsl:when> <!--/lneqq N: less, not double equals --> <!-- Required amssymb -->
- <xsl:when test="starts-with($content,'≩')"><xsl:value-of select="'\gneqq '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '≩')"/></xsl:call-template></xsl:when> <!--/gneqq N: greater, not dbl equals --> <!-- Required amssymb -->
- <!-- <xsl:when test="starts-with($content,'≪̸︀')"><xsl:value-of select="' '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '≪̸︀')"/></xsl:call-template></xsl:when> not much less than, variant -->
- <!-- <xsl:when test="starts-with($content,'≪̸')"><xsl:value-of select="' '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '≪̸')"/></xsl:call-template></xsl:when> not, vert, much less than -->
- <xsl:when test="starts-with($content,'≪')"><xsl:value-of select="'\ll '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '≪')"/></xsl:call-template></xsl:when> <!--/ll R: double less-than sign -->
- <!-- <xsl:when test="starts-with($content,'≫̸︀')"><xsl:value-of select="' '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '≫̸︀')"/></xsl:call-template></xsl:when> not much greater than, variant -->
- <!-- <xsl:when test="starts-with($content,'≫̸')"><xsl:value-of select="' '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '≫̸')"/></xsl:call-template></xsl:when> not, vert, much greater than -->
- <xsl:when test="starts-with($content,'≫')"><xsl:value-of select="'\gg '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '≫')"/></xsl:call-template></xsl:when> <!--/gg R: dbl greater-than sign -->
- <xsl:when test="starts-with($content,'≬')"><xsl:value-of select="'\between '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '≬')"/></xsl:call-template></xsl:when> <!--/between R: between --> <!-- Required amssymb -->
- <xsl:when test="starts-with($content,'≭')"><xsl:value-of select="'\not\asymp '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '≭')"/></xsl:call-template></xsl:when>
- <xsl:when test="starts-with($content,'≮')"><xsl:value-of select="'\nless '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '≮')"/></xsl:call-template></xsl:when> <!--/nless N: not less-than --> <!-- Required amssymb -->
- <xsl:when test="starts-with($content,'≯')"><xsl:value-of select="'\ngtr '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '≯')"/></xsl:call-template></xsl:when> <!--/ngtr N: not greater-than --> <!-- Required amssymb -->
- <xsl:when test="starts-with($content,'≰⃥')"><xsl:value-of select="'\nleq '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '≰⃥')"/></xsl:call-template></xsl:when> <!--/nleq N: not less-than-or-equal --> <!-- Required amssymb -->
- <xsl:when test="starts-with($content,'≰')"><xsl:value-of select="'\nleqq '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '≰')"/></xsl:call-template></xsl:when> <!--/nleqq N: not less, dbl equals --> <!-- Required amssymb -->
- <xsl:when test="starts-with($content,'≱⃥')"><xsl:value-of select="'\ngeq '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '≱⃥')"/></xsl:call-template></xsl:when> <!--/ngeq N: not greater-than-or-equal --> <!-- Required amssymb -->
- <xsl:when test="starts-with($content,'≱')"><xsl:value-of select="'\ngeqq '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '≱')"/></xsl:call-template></xsl:when> <!--/ngeqq N: not greater, dbl equals --> <!-- Required amssymb -->
- <xsl:when test="starts-with($content,'≲')"><xsl:value-of select="'\lesssim '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '≲')"/></xsl:call-template></xsl:when> <!--/lesssim R: less, similar --> <!-- Required amssymb -->
- <xsl:when test="starts-with($content,'≳')"><xsl:value-of select="'\gtrsim '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '≳')"/></xsl:call-template></xsl:when> <!--/gtrsim R: greater, similar --> <!-- Required amssymb -->
- <xsl:when test="starts-with($content,'≴')"><xsl:value-of select="'\not\lesssim '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '≴')"/></xsl:call-template></xsl:when> <!--not less, similar --> <!-- Required amssymb -->
- <xsl:when test="starts-with($content,'≵')"><xsl:value-of select="'\not\gtrsim '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '≵')"/></xsl:call-template></xsl:when> <!--not greater, similar --> <!-- Required amssymb -->
- <xsl:when test="starts-with($content,'≶')"><xsl:value-of select="'\lessgtr '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '≶')"/></xsl:call-template></xsl:when> <!--/lessgtr R: less, greater --> <!-- Required amssymb -->
- <xsl:when test="starts-with($content,'≷')"><xsl:value-of select="'\gtrless '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '≷')"/></xsl:call-template></xsl:when> <!--/gtrless R: greater, less --> <!-- Required amssymb -->
- <xsl:when test="starts-with($content,'≸')"><xsl:value-of select="'\not\lessgtr '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '≸')"/></xsl:call-template></xsl:when> <!--not less, greater --> <!-- Required amssymb -->
- <xsl:when test="starts-with($content,'≹')"><xsl:value-of select="'\not\gtrless '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '≹')"/></xsl:call-template></xsl:when> <!--not greater, less --> <!-- Required amssymb -->
- <xsl:when test="starts-with($content,'≺')"><xsl:value-of select="'\prec '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '≺')"/></xsl:call-template></xsl:when> <!--/prec R: precedes -->
- <xsl:when test="starts-with($content,'≻')"><xsl:value-of select="'\succ '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '≻')"/></xsl:call-template></xsl:when> <!--/succ R: succeeds -->
- <xsl:when test="starts-with($content,'≼')"><xsl:value-of select="'\preccurlyeq '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '≼')"/></xsl:call-template></xsl:when> <!--/preccurlyeq R: precedes, curly eq --> <!-- Required amssymb -->
- <xsl:when test="starts-with($content,'≽')"><xsl:value-of select="'\succcurlyeq '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '≽')"/></xsl:call-template></xsl:when> <!--/succcurlyeq R: succeeds, curly eq --> <!-- Required amssymb -->
- <xsl:when test="starts-with($content,'≾')"><xsl:value-of select="'\precsim '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '≾')"/></xsl:call-template></xsl:when> <!--/precsim R: precedes, similar --> <!-- Required amssymb -->
- <xsl:when test="starts-with($content,'≿')"><xsl:value-of select="'\succsim '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '≿')"/></xsl:call-template></xsl:when> <!--/succsim R: succeeds, similar --> <!-- Required amssymb -->
- <xsl:when test="starts-with($content,'⊀')"><xsl:value-of select="'\nprec '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '⊀')"/></xsl:call-template></xsl:when> <!--/nprec N: not precedes --> <!-- Required amssymb -->
- <xsl:when test="starts-with($content,'⊁')"><xsl:value-of select="'\nsucc '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '⊁')"/></xsl:call-template></xsl:when> <!--/nsucc N: not succeeds --> <!-- Required amssymb -->
- <xsl:when test="starts-with($content,'⊂')"><xsl:value-of select="'\subset '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '⊂')"/></xsl:call-template></xsl:when> <!--/subset R: subset or is implied by -->
- <xsl:when test="starts-with($content,'⊃')"><xsl:value-of select="'\supset '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '⊃')"/></xsl:call-template></xsl:when> <!--/supset R: superset or implies -->
- <xsl:when test="starts-with($content,'⊄')"><xsl:value-of select="'\not\subset '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '⊄')"/></xsl:call-template></xsl:when> <!--not subset -->
- <xsl:when test="starts-with($content,'⊅')"><xsl:value-of select="'\not\supset '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '⊅')"/></xsl:call-template></xsl:when> <!--not superset -->
- <xsl:when test="starts-with($content,'⊆')"><xsl:value-of select="'\subseteq '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '⊆')"/></xsl:call-template></xsl:when> <!--/subseteq R: subset, equals -->
- <xsl:when test="starts-with($content,'⊇')"><xsl:value-of select="'\supseteq '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '⊇')"/></xsl:call-template></xsl:when> <!--/supseteq R: superset, equals -->
- <xsl:when test="starts-with($content,'⊎')"><xsl:value-of select="'\uplus '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '⊎')"/></xsl:call-template></xsl:when> <!--/uplus B: plus sign in union -->
- <xsl:when test="starts-with($content,'⊓')"><xsl:value-of select="'\sqcap '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '⊓')"/></xsl:call-template></xsl:when> <!--/sqcap B: square intersection -->
- <xsl:when test="starts-with($content,'⊔')"><xsl:value-of select="'\bigsqcup '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '⊔')"/></xsl:call-template></xsl:when> <!--/sqcup B: square union -->
- <xsl:when test="starts-with($content,'⊕')"><xsl:value-of select="'\oplus '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '⊕')"/></xsl:call-template></xsl:when> <!--/oplus B: plus sign in circle -->
- <xsl:when test="starts-with($content,'⊖')"><xsl:value-of select="'\ominus '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '⊖')"/></xsl:call-template></xsl:when> <!--/ominus B: minus sign in circle -->
- <xsl:when test="starts-with($content,'⊗')"><xsl:value-of select="'\otimes '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '⊗')"/></xsl:call-template></xsl:when> <!--/otimes B: multiply sign in circle -->
- <xsl:when test="starts-with($content,'⊘')"><xsl:value-of select="'\oslash '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '⊘')"/></xsl:call-template></xsl:when> <!--/oslash B: solidus in circle -->
- <!-- ? --> <xsl:when test="starts-with($content,'⊙')"><xsl:value-of select="'\odot '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '⊙')"/></xsl:call-template></xsl:when> <!--/odot B: middle dot in circle --> <!--/bigodot L: circle dot operator -->
- <xsl:when test="starts-with($content,'⊟')"><xsl:value-of select="'\boxminus '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '⊟')"/></xsl:call-template></xsl:when> <!--/boxminus B: minus sign in box --> <!-- Required amssymb -->
- <xsl:when test="starts-with($content,'⊤')"><xsl:value-of select="'\top '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '⊤')"/></xsl:call-template></xsl:when> <!--/top top -->
- <xsl:when test="starts-with($content,'⊥')"><xsl:value-of select="'\perp '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '⊥')"/></xsl:call-template></xsl:when> <!--/perp R: perpendicular --><!--/bot bottom -->
- <xsl:when test="starts-with($content,'⊦')"><xsl:value-of select="'\vdash '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '⊦')"/></xsl:call-template></xsl:when> <!--/vdash R: vertical, dash -->
- <xsl:when test="starts-with($content,'⊧')"><xsl:value-of select="'\vDash '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '⊧')"/></xsl:call-template></xsl:when> <!--/vDash R: vertical, dbl dash --> <!-- Required amssymb -->
- <xsl:when test="starts-with($content,'⊨')"><xsl:value-of select="'\models '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '⊨')"/></xsl:call-template></xsl:when> <!--/models R: -->
- <xsl:when test="starts-with($content,'⊪')"><xsl:value-of select="'\Vvdash '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '⊪')"/></xsl:call-template></xsl:when> <!--/Vvdash R: triple vertical, dash --> <!-- Required amssymb -->
- <xsl:when test="starts-with($content,'⋀')"><xsl:value-of select="'\bigwedge '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '⋀')"/></xsl:call-template></xsl:when> <!--/bigwedge L: logical or operator -->
- <xsl:when test="starts-with($content,'⋁')"><xsl:value-of select="'\bigvee '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '⋁')"/></xsl:call-template></xsl:when> <!--/bigcap L: intersection operator -->
- <xsl:when test="starts-with($content,'⋂')"><xsl:value-of select="'\bigcap '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '⋂')"/></xsl:call-template></xsl:when> <!--/bigvee L: logical and operator -->
- <xsl:when test="starts-with($content,'⋃')"><xsl:value-of select="'\bigcup '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '⋃')"/></xsl:call-template></xsl:when> <!--/bigcup L: union operator -->
- <xsl:when test="starts-with($content,'⋄')"><xsl:value-of select="'\diamond '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '⋄')"/></xsl:call-template></xsl:when> <!--/diamond B: open diamond -->
- <xsl:when test="starts-with($content,'⋅')"><xsl:value-of select="'\cdot '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '⋅')"/></xsl:call-template></xsl:when> <!--/cdot B: small middle dot -->
- <xsl:when test="starts-with($content,'⋆')"><xsl:value-of select="'\star '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '⋆')"/></xsl:call-template></xsl:when> <!--/star B: small star, filled -->
- <xsl:when test="starts-with($content,'⋇')"><xsl:value-of select="'\divideontimes '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '⋇')"/></xsl:call-template></xsl:when> <!--/divideontimes B: division on times --> <!-- Required amssymb -->
- <xsl:when test="starts-with($content,'⋈')"><xsl:value-of select="'\bowtie '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '⋈')"/></xsl:call-template></xsl:when> <!--/bowtie R: -->
- <xsl:when test="starts-with($content,'⋍')"><xsl:value-of select="'\backsimeq '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '⋍')"/></xsl:call-template></xsl:when> <!--/backsimeq R: reverse similar, eq --> <!-- Required amssymb -->
- <xsl:when test="starts-with($content,'⋯')"><xsl:value-of select="'\cdots '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '⋯')"/></xsl:call-template></xsl:when> <!--/cdots, three dots, centered -->
- <!-- <xsl:when test="starts-with($content,'⋰')"><xsl:value-of select="' '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '⋰')"/></xsl:call-template></xsl:when> three dots, ascending -->
- <xsl:when test="starts-with($content,'⋱')"><xsl:value-of select="'\ddots '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '⋱')"/></xsl:call-template></xsl:when> <!--/ddots, three dots, descending -->
- <!-- ====================================================================== -->
- <xsl:when test="starts-with($content,'□')"><xsl:value-of select="'\square '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '□')"/></xsl:call-template></xsl:when> <!--/square, square --> <!-- Required amssymb -->
- <xsl:when test="starts-with($content,'▪')"><xsl:value-of select="'\blacksquare '" /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '▪')"/></xsl:call-template></xsl:when> <!--/blacksquare, square, filled --> <!-- Required amssymb -->
- <xsl:when test='starts-with($content,"'")'><xsl:value-of select='"\text{'}"' /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select='substring-after($content, "'")'/></xsl:call-template></xsl:when><!-- \text required amslatex -->
- <xsl:when test='starts-with($content,"(")'><xsl:value-of select='"\left("' /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '(')"/></xsl:call-template></xsl:when>
- <xsl:when test='starts-with($content,")")'><xsl:value-of select='"\right)"' /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, ')')"/></xsl:call-template></xsl:when>
- <xsl:when test='starts-with($content,"[")'><xsl:value-of select='"\left["' /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '[')"/></xsl:call-template></xsl:when>
- <xsl:when test='starts-with($content,"]")'><xsl:value-of select='"\right]"' /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, ']')"/></xsl:call-template></xsl:when>
- <xsl:when test='starts-with($content,"{")'><xsl:value-of select='"\left\{"' /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '{')"/></xsl:call-template></xsl:when>
- <xsl:when test='starts-with($content,"}")'><xsl:value-of select='"\right\}"' /><xsl:call-template name="replaceEntities"><xsl:with-param name="content" select="substring-after($content, '}')"/></xsl:call-template></xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="substring($content,1,1)"/>
- <xsl:call-template name="replaceEntities">
- <xsl:with-param name="content" select="substring($content, 2)"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose></xsl:if>
- </xsl:template>
- <xsl:template name="replaceMtextEntities">
- <xsl:param name="content"/>
- <xsl:choose>
- <xsl:when test="contains($content,'   ')"> <!-- ThickSpace - space of width 5/18 em -->
- <xsl:call-template name="replaceMtextEntities">
- <xsl:with-param name="content" select="concat(substring-before($content,'   '),'\hspace{0.28em}',substring-after($content,'   '))"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:when test="contains($content,' ')"> <!-- ThinSpace - space of width 3/18 em -->
- <xsl:call-template name="replaceMtextEntities">
- <xsl:with-param name="content" select="concat(substring-before($content,' '),'\hspace{0.17em}',substring-after($content,' '))"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="normalize-space($content)"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <!-- ====================================================================== -->
- <!-- $id: tables.xsl, 2002/17/05 Exp $
- This file is part of the XSLT MathML Library distribution.
- See ./README or http://www.raleigh.ru/MathML/mmltex for
- copyright and other information -->
- <!-- ====================================================================== -->
- <xsl:template match="m:mtd[@columnspan]">
- <xsl:text>\multicolumn{</xsl:text>
- <xsl:value-of select="@columnspan"/>
- <xsl:text>}{c}{</xsl:text>
- <xsl:apply-templates/>
- <xsl:text>}</xsl:text>
- <xsl:if test="count(following-sibling::*)>0">
- <xsl:text>& </xsl:text>
- </xsl:if>
- </xsl:template>
- <xsl:template match="m:mtd">
- <xsl:if test="@columnalign='right' or @columnalign='center'">
- <xsl:text>\hfill </xsl:text>
- </xsl:if>
- <xsl:apply-templates/>
- <xsl:if test="@columnalign='left' or @columnalign='center'">
- <xsl:text>\hfill </xsl:text>
- </xsl:if>
- <xsl:if test="count(following-sibling::*)>0">
- <!-- this test valid for Sablotron, another form - test="not(position()=last())".
- Also for m:mtd[@columnspan] and m:mtr -->
- <xsl:text>& </xsl:text>
- </xsl:if>
- </xsl:template>
- <xsl:template match="m:mtr">
- <xsl:apply-templates/>
- <xsl:if test="count(following-sibling::*)>0">
- <xsl:text>\\ </xsl:text>
- </xsl:if>
- </xsl:template>
- <xsl:template match="m:mtable">
- <xsl:text>\begin{array}{</xsl:text>
- <xsl:if test="@frame='solid'">
- <xsl:text>|</xsl:text>
- </xsl:if>
- <xsl:variable name="numbercols" select="count(./m:mtr[1]/m:mtd[not(@columnspan)])+sum(./m:mtr[1]/m:mtd/@columnspan)"/>
- <xsl:choose>
- <xsl:when test="@columnalign">
- <xsl:variable name="colalign">
- <xsl:call-template name="colalign">
- <xsl:with-param name="colalign" select="@columnalign"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="string-length($colalign) > $numbercols">
- <xsl:value-of select="substring($colalign,1,$numbercols)"/>
- </xsl:when>
- <xsl:when test="string-length($colalign) < $numbercols">
- <xsl:value-of select="$colalign"/>
- <xsl:call-template name="generate-string">
- <xsl:with-param name="text" select="substring($colalign,string-length($colalign))"/>
- <xsl:with-param name="count" select="$numbercols - string-length($colalign)"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$colalign"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:call-template name="generate-string">
- <xsl:with-param name="text" select="'c'"/>
- <xsl:with-param name="count" select="$numbercols"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:if test="@frame='solid'">
- <xsl:text>|</xsl:text>
- </xsl:if>
- <xsl:text>}</xsl:text>
- <xsl:if test="@frame='solid'">
- <xsl:text>\hline </xsl:text>
- </xsl:if>
- <xsl:apply-templates/>
- <xsl:if test="@frame='solid'">
- <xsl:text>\\ \hline</xsl:text>
- </xsl:if>
- <xsl:text>\end{array}</xsl:text>
- </xsl:template>
- <xsl:template name="colalign">
- <xsl:param name="colalign"/>
- <xsl:choose>
- <xsl:when test="contains($colalign,' ')">
- <xsl:value-of select="substring($colalign,1,1)"/>
- <xsl:call-template name="colalign">
- <xsl:with-param name="colalign" select="substring-after($colalign,' ')"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="substring($colalign,1,1)"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="generate-string">
- <!-- template from XSLT Standard Library v1.1 -->
- <xsl:param name="text"/>
- <xsl:param name="count"/>
- <xsl:choose>
- <xsl:when test="string-length($text) = 0 or $count <= 0"/>
- <xsl:otherwise>
- <xsl:value-of select="$text"/>
- <xsl:call-template name="generate-string">
- <xsl:with-param name="text" select="$text"/>
- <xsl:with-param name="count" select="$count - 1"/>
- </xsl:call-template>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <!-- ====================================================================== -->
- <!-- $Id: scripts.xsl,v 1.1.1.1 2002/10/26 14:20:06 shade33 Exp $
- This file is part of the XSLT MathML Library distribution.
- See ./README or http://www.raleigh.ru/MathML/mmltex for
- copyright and other information -->
- <!-- ====================================================================== -->
- <xsl:template match="m:munderover">
- <xsl:variable name="base">
- <xsl:call-template name="startspace">
- <xsl:with-param name="symbol" select="./*[1]"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="under">
- <xsl:call-template name="startspace">
- <xsl:with-param name="symbol" select="./*[2]"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="over">
- <xsl:call-template name="startspace">
- <xsl:with-param name="symbol" select="./*[3]"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:choose>
- <xsl:when test="$over='¯'"> <!-- OverBar - over bar -->
- <xsl:text>\overline{</xsl:text>
- <xsl:call-template name="munder">
- <xsl:with-param name="base" select="$base"/>
- <xsl:with-param name="under" select="$under"/>
- </xsl:call-template>
- <xsl:text>}</xsl:text>
- </xsl:when>
- <xsl:when test="$over='︷'"> <!-- OverBrace - over brace -->
- <xsl:text>\overbrace{</xsl:text>
- <xsl:call-template name="munder">
- <xsl:with-param name="base" select="$base"/>
- <xsl:with-param name="under" select="$under"/>
- </xsl:call-template>
- <xsl:text>}</xsl:text>
- </xsl:when>
- <xsl:when test="$under='̲'"> <!-- UnderBar - combining low line -->
- <xsl:text>\underline{</xsl:text>
- <xsl:call-template name="mover">
- <xsl:with-param name="base" select="$base"/>
- <xsl:with-param name="over" select="$over"/>
- <xsl:with-param name="pos_over" select="3"/>
- </xsl:call-template>
- <xsl:text>}</xsl:text>
- </xsl:when>
- <xsl:when test="$under='︸'"> <!-- UnderBrace - under brace -->
- <xsl:text>\underbrace{</xsl:text>
- <xsl:call-template name="mover">
- <xsl:with-param name="base" select="$base"/>
- <xsl:with-param name="over" select="$over"/>
- <xsl:with-param name="pos_over" select="3"/>
- </xsl:call-template>
- <xsl:text>}</xsl:text>
- </xsl:when>
- <xsl:when test="translate($base,'∏∐⋂⋃⊔',
- '∑∑∑∑∑')='∑'">
- <!-- if $base is operator, such as
- ∑ /sum L: summation operator
- ∏ /prod L: product operator
- ∐ /coprod L: coproduct operator
- ⋂ /bigcap
- ⋃ /bigcup
- ⊔ /bigsqcup
- -->
- <xsl:apply-templates select="./*[1]"/>
- <xsl:text>_{</xsl:text>
- <xsl:apply-templates select="./*[2]"/>
- <xsl:text>}^{</xsl:text>
- <xsl:apply-templates select="./*[3]"/>
- <xsl:text>}</xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>\underset{</xsl:text>
- <xsl:apply-templates select="./*[2]"/>
- <xsl:text>}{\overset{</xsl:text>
- <xsl:apply-templates select="./*[3]"/>
- <xsl:text>}{</xsl:text>
- <xsl:apply-templates select="./*[1]"/>
- <xsl:text>}}</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template match="m:mover">
- <xsl:call-template name="mover">
- <xsl:with-param name="base">
- <xsl:call-template name="startspace">
- <xsl:with-param name="symbol" select="./*[1]"/>
- </xsl:call-template>
- </xsl:with-param>
- <xsl:with-param name="over">
- <xsl:call-template name="startspace">
- <xsl:with-param name="symbol" select="./*[2]"/>
- </xsl:call-template>
- </xsl:with-param>
- </xsl:call-template>
- </xsl:template>
- <xsl:template match="m:munder">
- <xsl:call-template name="munder">
- <xsl:with-param name="base">
- <xsl:call-template name="startspace">
- <xsl:with-param name="symbol" select="./*[1]"/>
- </xsl:call-template>
- </xsl:with-param>
- <xsl:with-param name="under">
- <xsl:call-template name="startspace">
- <xsl:with-param name="symbol" select="./*[2]"/>
- </xsl:call-template>
- </xsl:with-param>
- </xsl:call-template>
- </xsl:template>
- <xsl:template name="mover">
- <xsl:param name="base"/>
- <xsl:param name="over"/>
- <xsl:param name="pos_over" select="2"/>
- <xsl:choose>
- <xsl:when test="$over='¯'"> <!-- OverBar - over bar -->
- <xsl:text>\overline{</xsl:text>
- <xsl:apply-templates select="./*[1]"/>
- <xsl:text>}</xsl:text>
- </xsl:when>
- <xsl:when test="$over='︷'"> <!-- OverBrace - over brace -->
- <xsl:text>\overbrace{</xsl:text>
- <xsl:apply-templates select="./*[1]"/>
- <xsl:text>}</xsl:text>
- </xsl:when>
- <xsl:when test="translate($base,'∏∐⋂⋃⊔',
- '∑∑∑∑∑')='∑'">
- <!-- if $base is operator, such as
- ∑ /sum L: summation operator
- ∏ /prod L: product operator
- ∐ /coprod L: coproduct operator
- ⋂ /bigcap
- ⋃ /bigcup
- ⊔ /bigsqcup
- -->
- <xsl:apply-templates select="./*[1]"/>
- <xsl:text>^{</xsl:text>
- <xsl:apply-templates select="./*[$pos_over]"/>
- <xsl:text>}</xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>\stackrel{</xsl:text>
- <xsl:apply-templates select="./*[$pos_over]"/>
- <xsl:text>}{</xsl:text>
- <xsl:apply-templates select="./*[1]"/>
- <xsl:text>}</xsl:text>
- <!--
- <xsl:text>\overset{</xsl:text>
- <xsl:apply-templates select="./*[$pos_over]"/>
- <xsl:text>}{</xsl:text>
- <xsl:apply-templates select="./*[1]"/>
- <xsl:text>}</xsl:text>-->
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="munder">
- <xsl:param name="base"/>
- <xsl:param name="under"/>
- <xsl:choose>
- <xsl:when test="$under='̲'"> <!-- UnderBar - combining low line -->
- <xsl:text>\underline{</xsl:text>
- <xsl:apply-templates select="./*[1]"/>
- <xsl:text>}</xsl:text>
- </xsl:when>
- <xsl:when test="$under='︸'"> <!-- UnderBrace - under brace -->
- <xsl:text>\underbrace{</xsl:text>
- <xsl:apply-templates select="./*[1]"/>
- <xsl:text>}</xsl:text>
- </xsl:when>
- <xsl:when test="translate($base,'∏∐⋂⋃⊔',
- '∑∑∑∑∑')='∑'">
- <!-- if $base is operator, such as
- ∑ /sum L: summation operator
- ∏ /prod L: product operator
- ∐ /coprod L: coproduct operator
- ⋂ /bigcap
- ⋃ /bigcup
- ⊔ /bigsqcup
- -->
- <xsl:apply-templates select="./*[1]"/>
- <xsl:text>_{</xsl:text>
- <xsl:apply-templates select="./*[2]"/>
- <xsl:text>}</xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>\underset{</xsl:text> <!-- Required AmsMath package -->
- <xsl:apply-templates select="./*[2]"/>
- <xsl:text>}{</xsl:text>
- <xsl:apply-templates select="./*[1]"/>
- <xsl:text>}</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template match="m:msubsup">
- <xsl:text>{</xsl:text>
- <xsl:apply-templates select="./*[1]"/>
- <xsl:text>}_{</xsl:text>
- <xsl:apply-templates select="./*[2]"/>
- <xsl:text>}^{</xsl:text>
- <xsl:apply-templates select="./*[3]"/>
- <xsl:text>}</xsl:text>
- </xsl:template>
- <xsl:template match="m:msup">
- <xsl:text>{</xsl:text>
- <xsl:apply-templates select="./*[1]"/>
- <xsl:text>}^{</xsl:text>
- <xsl:apply-templates select="./*[2]"/>
- <xsl:text>}</xsl:text>
- </xsl:template>
- <xsl:template match="m:msub">
- <xsl:text>{</xsl:text>
- <xsl:apply-templates select="./*[1]"/>
- <xsl:text>}_{</xsl:text>
- <xsl:apply-templates select="./*[2]"/>
- <xsl:text>}</xsl:text>
- </xsl:template>
- <xsl:template match="m:mmultiscripts" mode="mprescripts">
- <xsl:for-each select="m:mprescripts/following-sibling::*">
- <xsl:if test="position() mod 2 and local-name(.)!='none'">
- <xsl:text>{}_{</xsl:text>
- <xsl:apply-templates select="."/>
- <xsl:text>}</xsl:text>
- </xsl:if>
- <xsl:if test="not(position() mod 2) and local-name(.)!='none'">
- <xsl:text>{}^{</xsl:text>
- <xsl:apply-templates select="."/>
- <xsl:text>}</xsl:text>
- </xsl:if>
- </xsl:for-each>
- <xsl:apply-templates select="./*[1]"/>
- <xsl:for-each select="m:mprescripts/preceding-sibling::*[position()!=last()]">
- <xsl:if test="position()>2 and local-name(.)!='none'">
- <xsl:text>{}</xsl:text>
- </xsl:if>
- <xsl:if test="position() mod 2 and local-name(.)!='none'">
- <xsl:text>_{</xsl:text>
- <xsl:apply-templates select="."/>
- <xsl:text>}</xsl:text>
- </xsl:if>
- <xsl:if test="not(position() mod 2) and local-name(.)!='none'">
- <xsl:text>^{</xsl:text>
- <xsl:apply-templates select="."/>
- <xsl:text>}</xsl:text>
- </xsl:if>
- </xsl:for-each>
- </xsl:template>
- <xsl:template match="m:mmultiscripts">
- <xsl:choose>
- <xsl:when test="m:mprescripts">
- <xsl:apply-templates select="." mode="mprescripts"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates select="./*[1]"/>
- <xsl:for-each select="*[position()>1]">
- <xsl:if test="position()>2 and local-name(.)!='none'">
- <xsl:text>{}</xsl:text>
- </xsl:if>
- <xsl:if test="position() mod 2 and local-name(.)!='none'">
- <xsl:text>_{</xsl:text>
- <xsl:apply-templates select="."/>
- <xsl:text>}</xsl:text>
- </xsl:if>
- <xsl:if test="not(position() mod 2) and local-name(.)!='none'">
- <xsl:text>^{</xsl:text>
- <xsl:apply-templates select="."/>
- <xsl:text>}</xsl:text>
- </xsl:if>
- </xsl:for-each>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <!-- ====================================================================== -->
- <!-- $id: glayout.xsl, 2002/17/05 Exp $
- This file is part of the XSLT MathML Library distribution.
- See ./README or http://www.raleigh.ru/MathML/mmltex for
- copyright and other information -->
- <!-- ====================================================================== -->
- <xsl:template match="m:mfrac">
- <xsl:choose>
- <xsl:when test="@bevelled='true'">
- <!-- <xsl:text>\raisebox{1ex}{</xsl:text>
- <xsl:apply-templates select="./*[1]"/>
- <xsl:text>}\!\left/ \!\raisebox{-1ex}{</xsl:text>
- <xsl:apply-templates select="./*[2]"/>
- <xsl:text>}\right.</xsl:text>-->
- </xsl:when>
- <xsl:when test="@linethickness">
- <xsl:text>\genfrac{}{}{</xsl:text>
- <xsl:choose>
- <xsl:when test="number(@linethickness)">
- <xsl:value-of select="@linethickness div 10"/>
- <xsl:text>ex</xsl:text>
- </xsl:when>
- <xsl:when test="@linethickness='thin'">
- <xsl:text>.05ex</xsl:text>
- </xsl:when>
- <xsl:when test="@linethickness='medium'"/>
- <xsl:when test="@linethickness='thick'">
- <xsl:text>.2ex</xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="@linethickness"/>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:text>}{}{</xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>\frac{</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:if test="@numalign='right'">
- <xsl:text>\hfill </xsl:text>
- </xsl:if>
- <xsl:apply-templates select="./*[1]"/>
- <xsl:if test="@numalign='left'">
- <xsl:text>\hfill </xsl:text>
- </xsl:if>
- <xsl:text>}{</xsl:text>
- <xsl:if test="@denomalign='right'">
- <xsl:text>\hfill </xsl:text>
- </xsl:if>
- <xsl:apply-templates select="./*[2]"/>
- <xsl:if test="@denomalign='left'">
- <xsl:text>\hfill </xsl:text>
- </xsl:if>
- <xsl:text>}</xsl:text>
- </xsl:template>
- <xsl:template match="m:mroot">
- <xsl:choose>
- <xsl:when test="count(./*)=2">
- <xsl:text>\sqrt[</xsl:text>
- <xsl:apply-templates select="./*[2]"/>
- <xsl:text>]{</xsl:text>
- <xsl:apply-templates select="./*[1]"/>
- <xsl:text>}</xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <!-- number of arguments is not 2 - code 25 -->
- <xsl:message>exception 25:</xsl:message>
- <xsl:text>\text{exception 25:}</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template match="m:msqrt">
- <xsl:text>\sqrt{</xsl:text>
- <xsl:apply-templates/>
- <xsl:text>}</xsl:text>
- </xsl:template>
- <xsl:template match="m:mfenced">
- <xsl:choose>
- <xsl:when test="@open">
- <xsl:if test="translate(@open,'{}[]()|','{{{{{{{')='{'">
- <xsl:text>\left</xsl:text>
- </xsl:if>
- <xsl:if test="@open='{' or @open='}'">
- <xsl:text>\</xsl:text>
- </xsl:if>
- <xsl:value-of select="@open"/>
- </xsl:when>
- <xsl:otherwise><xsl:text>\left(</xsl:text></xsl:otherwise>
- </xsl:choose>
- <xsl:choose>
- <xsl:when test="count(./*)>1">
- <xsl:variable name="symbol">
- <xsl:choose>
- <xsl:when test="@separators">
- <xsl:call-template name="startspace">
- <xsl:with-param name="symbol" select="@separators"/>
- </xsl:call-template>
- </xsl:when>
- <xsl:otherwise>,</xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
- <xsl:for-each select="./*">
- <xsl:apply-templates select="."/>
- <xsl:if test="not(position()=last())">
- <xsl:choose>
- <xsl:when test="position()>string-length($symbol)">
- <xsl:value-of select="substring($symbol,string-length($symbol))"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="substring($symbol,position(),1)"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:if>
- </xsl:for-each>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates/>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:choose>
- <xsl:when test="@close">
- <xsl:if test="translate(@open,'{}[]()|','{{{{{{{')='{'">
- <xsl:text>\right</xsl:text>
- </xsl:if>
- <xsl:if test="@open='{' or @open='}'">
- <xsl:text>\</xsl:text>
- </xsl:if>
- <xsl:value-of select="@close"/>
- </xsl:when>
- <xsl:otherwise><xsl:text>\right)</xsl:text></xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template match="m:mphantom">
- <xsl:text>\phantom{</xsl:text>
- <xsl:apply-templates/>
- <xsl:text>}</xsl:text>
- </xsl:template>
- <xsl:template match="m:menclose">
- <xsl:choose>
- <xsl:when test="@notation = 'actuarial'">
- <xsl:text>\overline{</xsl:text>
- <xsl:apply-templates/>
- <xsl:text>\hspace{.2em}|}</xsl:text>
- </xsl:when>
- <xsl:when test="@notation = 'radical'">
- <xsl:text>\sqrt{</xsl:text>
- <xsl:apply-templates/>
- <xsl:text>}</xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>\overline{)</xsl:text>
- <xsl:apply-templates/>
- <xsl:text>}</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template match="m:mrow">
- <xsl:apply-templates/>
- </xsl:template>
- <xsl:template match="m:mstyle">
- <xsl:if test="@background">
- <xsl:text>\colorbox[rgb]{</xsl:text>
- <xsl:call-template name="color">
- <xsl:with-param name="color" select="@background"/>
- </xsl:call-template>
- <xsl:text>}{$</xsl:text>
- </xsl:if>
- <xsl:if test="@color">
- <xsl:text>\textcolor[rgb]{</xsl:text>
- <xsl:call-template name="color">
- <xsl:with-param name="color" select="@color"/>
- </xsl:call-template>
- <xsl:text>}{</xsl:text>
- </xsl:if>
- <xsl:apply-templates/>
- <xsl:if test="@color">
- <xsl:text>}</xsl:text>
- </xsl:if>
- <xsl:if test="@background">
- <xsl:text>$}</xsl:text>
- </xsl:if>
- </xsl:template>
- <!--
- <xsl:template match="m:mstyle">
- <xsl:if test="@displaystyle='true'">
- <xsl:text>{\displaystyle</xsl:text>
- </xsl:if>
- <xsl:if test="@scriptlevel=2">
- <xsl:text>{\scriptscriptstyle</xsl:text>
- </xsl:if>
- <xsl:apply-templates/>
- <xsl:if test="@scriptlevel=2">
- <xsl:text>}</xsl:text>
- </xsl:if>
- <xsl:if test="@displaystyle='true'">
- <xsl:text>}</xsl:text>
- </xsl:if>
- </xsl:template>
- -->
- <xsl:template match="m:merror">
- <xsl:apply-templates/>
- </xsl:template>
- <!-- ====================================================================== -->
- <!-- $id: tokens.xsl, 2002/22/11 Exp $
- This file is part of the XSLT MathML Library distribution.
- See ./README or http://www.raleigh.ru/MathML/mmltex for
- copyright and other information -->
- <!-- ====================================================================== -->
- <xsl:template match="m:mi|m:mn|m:mo|m:mtext|m:ms">
- <xsl:call-template name="CommonTokenAtr"/>
- </xsl:template>
- <xsl:template name="mi">
- <xsl:choose>
- <xsl:when test="string-length(normalize-space(.))>1 and not(@mathvariant)">
- <xsl:text>\mathrm{</xsl:text>
- <xsl:apply-templates/>
- <xsl:text>}</xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="mn">
- <xsl:apply-templates/>
- </xsl:template>
- <xsl:template name="mo">
- <xsl:apply-templates/>
- </xsl:template>
- <xsl:template name="mtext">
- <xsl:variable name="content">
- <xsl:call-template name="replaceMtextEntities">
- <xsl:with-param name="content" select="."/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:text>\text{</xsl:text>
- <xsl:value-of select="$content"/>
- <xsl:text>}</xsl:text>
- </xsl:template>
- <xsl:template match="m:mspace">
- <xsl:text>\phantom{\rule</xsl:text>
- <xsl:if test="@depth">
- <xsl:text>[-</xsl:text>
- <xsl:value-of select="@depth"/>
- <xsl:text>]</xsl:text>
- </xsl:if>
- <xsl:text>{</xsl:text>
- <xsl:if test="not(@width)">
- <xsl:text>0ex</xsl:text>
- </xsl:if>
- <xsl:value-of select="@width"/>
- <xsl:text>}{</xsl:text>
- <xsl:if test="not(@height)">
- <xsl:text>0ex</xsl:text>
- </xsl:if>
- <xsl:value-of select="@height"/>
- <xsl:text>}}</xsl:text>
- </xsl:template>
- <xsl:template name="ms">
- <xsl:choose>
- <xsl:when test="@lquote"><xsl:value-of select="@lquote"/></xsl:when>
- <xsl:otherwise><xsl:text>"</xsl:text></xsl:otherwise>
- </xsl:choose><xsl:apply-templates/><xsl:choose>
- <xsl:when test="@rquote"><xsl:value-of select="@rquote"/></xsl:when>
- <xsl:otherwise><xsl:text>"</xsl:text></xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="CommonTokenAtr">
- <xsl:if test="@mathbackground">
- <xsl:text>\colorbox[rgb]{</xsl:text>
- <xsl:call-template name="color">
- <xsl:with-param name="color" select="@mathbackground"/>
- </xsl:call-template>
- <xsl:text>}{$</xsl:text>
- </xsl:if>
- <xsl:if test="@color or @mathcolor"> <!-- Note: @color is deprecated in MathML 2.0 -->
- <xsl:text>\textcolor[rgb]{</xsl:text>
- <xsl:call-template name="color">
- <xsl:with-param name="color" select="@color|@mathcolor"/>
- </xsl:call-template>
- <xsl:text>}{</xsl:text>
- </xsl:if>
- <xsl:if test="@mathvariant">
- <xsl:choose>
- <xsl:when test="@mathvariant='normal'">
- <xsl:text>\mathrm{</xsl:text>
- </xsl:when>
- <xsl:when test="@mathvariant='bold'">
- <xsl:text>\mathbf{</xsl:text>
- </xsl:when>
- <xsl:when test="@mathvariant='italic'">
- <xsl:text>\mathit{</xsl:text>
- </xsl:when>
- <xsl:when test="@mathvariant='bold-italic'"> <!-- Required definition -->
- <xsl:text>\mathbit{</xsl:text>
- </xsl:when>
- <xsl:when test="@mathvariant='double-struck'"> <!-- Required amsfonts -->
- <xsl:text>\mathbb{</xsl:text>
- </xsl:when>
- <xsl:when test="@mathvariant='bold-fraktur'"> <!-- Error -->
- <xsl:text>{</xsl:text>
- </xsl:when>
- <xsl:when test="@mathvariant='script'">
- <xsl:text>\mathcal{</xsl:text>
- </xsl:when>
- <xsl:when test="@mathvariant='bold-script'"> <!-- Error -->
- <xsl:text>\mathsc{</xsl:text>
- </xsl:when>
- <xsl:when test="@mathvariant='fraktur'"> <!-- Required amsfonts -->
- <xsl:text>\mathfrak{</xsl:text>
- </xsl:when>
- <xsl:when test="@mathvariant='sans-serif'">
- <xsl:text>\mathsf{</xsl:text>
- </xsl:when>
- <xsl:when test="@mathvariant='bold-sans-serif'"> <!-- Required definition -->
- <xsl:text>\mathbsf{</xsl:text>
- </xsl:when>
- <xsl:when test="@mathvariant='sans-serif-italic'"> <!-- Required definition -->
- <xsl:text>\mathsfit{</xsl:text>
- </xsl:when>
- <xsl:when test="@mathvariant='sans-serif-bold-italic'"> <!-- Error -->
- <xsl:text>\mathbsfit{</xsl:text>
- </xsl:when>
- <xsl:when test="@mathvariant='monospace'">
- <xsl:text>\mathtt{</xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>{</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:if>
- <xsl:call-template name="selectTemplate"/>
- <xsl:if test="@mathvariant">
- <xsl:text>}</xsl:text>
- </xsl:if>
- <xsl:if test="@color or @mathcolor">
- <xsl:text>}</xsl:text>
- </xsl:if>
- <xsl:if test="@mathbackground">
- <xsl:text>$}</xsl:text>
- </xsl:if>
- </xsl:template>
- <xsl:template name="selectTemplate">
- <!-- <xsl:variable name="name" select="local-name()"/>
- <xsl:call-template name="{$name}"/>-->
- <xsl:choose>
- <xsl:when test="local-name(.)='mi'">
- <xsl:call-template name="mi"/>
- </xsl:when>
- <xsl:when test="local-name(.)='mn'">
- <xsl:call-template name="mn"/>
- </xsl:when>
- <xsl:when test="local-name(.)='mo'">
- <xsl:call-template name="mo"/>
- </xsl:when>
- <xsl:when test="local-name(.)='mtext'">
- <xsl:call-template name="mtext"/>
- </xsl:when>
- <xsl:when test="local-name(.)='ms'">
- <xsl:call-template name="ms"/>
- </xsl:when>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="color">
- <!-- NB: Variables colora and valueColor{n} only for Sablotron -->
- <xsl:param name="color"/>
- <xsl:variable name="colora" select="translate($color,'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')"/>
- <xsl:choose>
- <xsl:when test="starts-with($colora,'#') and string-length($colora)=4">
- <xsl:variable name="valueColor">
- <xsl:call-template name="Hex2Decimal">
- <xsl:with-param name="arg" select="substring($colora,2,1)"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:value-of select="$valueColor div 15"/><xsl:text>,</xsl:text>
- <xsl:variable name="valueColor1">
- <xsl:call-template name="Hex2Decimal">
- <xsl:with-param name="arg" select="substring($colora,3,1)"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:value-of select="$valueColor1 div 15"/><xsl:text>,</xsl:text>
- <xsl:variable name="valueColor2">
- <xsl:call-template name="Hex2Decimal">
- <xsl:with-param name="arg" select="substring($colora,4,1)"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:value-of select="$valueColor2 div 15"/>
- </xsl:when>
- <xsl:when test="starts-with($colora,'#') and string-length($colora)=7">
- <xsl:variable name="valueColor1">
- <xsl:call-template name="Hex2Decimal">
- <xsl:with-param name="arg" select="substring($colora,2,1)"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="valueColor2">
- <xsl:call-template name="Hex2Decimal">
- <xsl:with-param name="arg" select="substring($colora,3,1)"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:value-of select="($valueColor1*16 + $valueColor2) div 255"/><xsl:text>,</xsl:text>
- <xsl:variable name="valueColor1a">
- <xsl:call-template name="Hex2Decimal">
- <xsl:with-param name="arg" select="substring($colora,4,1)"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="valueColor2a">
- <xsl:call-template name="Hex2Decimal">
- <xsl:with-param name="arg" select="substring($colora,5,1)"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:value-of select="($valueColor1a*16 + $valueColor2a) div 255"/><xsl:text>,</xsl:text>
- <xsl:variable name="valueColor1b">
- <xsl:call-template name="Hex2Decimal">
- <xsl:with-param name="arg" select="substring($colora,6,1)"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="valueColor2b">
- <xsl:call-template name="Hex2Decimal">
- <xsl:with-param name="arg" select="substring($colora,7,1)"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:value-of select="($valueColor1b*16 + $valueColor2b) div 255"/>
- </xsl:when>
- <!-- ======================= if color specified as an html-color-name ========================================== -->
- <xsl:when test="$colora='aqua'"><xsl:text>0,1,1</xsl:text></xsl:when>
- <xsl:when test="$colora='black'"><xsl:text>0,0,0</xsl:text></xsl:when>
- <xsl:when test="$colora='blue'"><xsl:text>0,0,1</xsl:text></xsl:when>
- <xsl:when test="$colora='fuchsia'"><xsl:text>1,0,1</xsl:text></xsl:when>
- <xsl:when test="$colora='gray'"><xsl:text>.5,.5,.5</xsl:text></xsl:when>
- <xsl:when test="$colora='green'"><xsl:text>0,.5,0</xsl:text></xsl:when>
- <xsl:when test="$colora='lime'"><xsl:text>0,1,0</xsl:text></xsl:when>
- <xsl:when test="$colora='maroon'"><xsl:text>.5,0,0</xsl:text></xsl:when>
- <xsl:when test="$colora='navy'"><xsl:text>0,0,.5</xsl:text></xsl:when>
- <xsl:when test="$colora='olive'"><xsl:text>.5,.5,0</xsl:text></xsl:when>
- <xsl:when test="$colora='purple'"><xsl:text>.5,0,.5</xsl:text></xsl:when>
- <xsl:when test="$colora='red'"><xsl:text>1,0,0</xsl:text></xsl:when>
- <xsl:when test="$colora='silver'"><xsl:text>.75,.75,.75</xsl:text></xsl:when>
- <xsl:when test="$colora='teal'"><xsl:text>0,.5,.5</xsl:text></xsl:when>
- <xsl:when test="$colora='white'"><xsl:text>1,1,1</xsl:text></xsl:when>
- <xsl:when test="$colora='yellow'"><xsl:text>1,1,0</xsl:text></xsl:when>
- <xsl:otherwise>
- <xsl:message>Exception at color template</xsl:message>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template name="Hex2Decimal">
- <xsl:param name="arg"/>
- <xsl:choose>
- <xsl:when test="$arg='f'">
- <xsl:value-of select="15"/>
- </xsl:when>
- <xsl:when test="$arg='e'">
- <xsl:value-of select="14"/>
- </xsl:when>
- <xsl:when test="$arg='d'">
- <xsl:value-of select="13"/>
- </xsl:when>
- <xsl:when test="$arg='c'">
- <xsl:value-of select="12"/>
- </xsl:when>
- <xsl:when test="$arg='b'">
- <xsl:value-of select="11"/>
- </xsl:when>
- <xsl:when test="$arg='a'">
- <xsl:value-of select="10"/>
- </xsl:when>
- <xsl:when test="translate($arg, '0123456789', '9999999999')='9'"> <!-- if $arg is number -->
- <xsl:value-of select="$arg"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:message>Exception at Hex2Decimal template</xsl:message>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template match="m:*/text()">
- <xsl:call-template name="replaceEntities">
- <xsl:with-param name="content" select="normalize-space()"/>
- </xsl:call-template>
- </xsl:template>
- </xsl:stylesheet>
|