1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166 |
- <?xml version="1.0"?>
- <!-- ******************************************************** -->
- <!-- XSL Transform of MathML content to MathML presentation -->
- <!-- Version 1.0 RC2 from 13-Jun-2003 -->
- <!-- -->
- <!-- Complies with the W3C MathML 2.0 Recommenation of -->
- <!-- 21 February 2001. -->
- <!-- -->
- <!-- Authors Igor Rodionov <igor@csd.uwo.ca>, -->
- <!-- Stephen Watt <watt@csd.uwo.ca>. -->
- <!-- -->
- <!-- (C) Copyright 2000-2003 Symbolic Computation Laboratory, -->
- <!-- University of Western Ontario, -->
- <!-- London, Canada N6A 5B7. -->
- <!-- -->
- <!-- Modified: Fabian Seoane <fabian@fseoane> 2007 for sympy -->
- <!-- -->
- <!-- ******************************************************** -->
- <xsl:stylesheet id="mmlctop2.xsl"
- version="1.0"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
- xmlns:mml="http://www.w3.org/1998/Math/MathML"
- xmlns="http://www.w3.org/1998/Math/MathML">
- <xsl:output method="xml" indent="yes"/>
- <xsl:strip-space elements="apply semantics annotation-xml
- csymbol fn cn ci interval matrix matrixrow vector
- lambda bvar condition logbase degree set list
- lowlimit uplimit math"/>
- <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
- <!-- Parameters, variables and constants -->
- <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
- <!-- ~~~~~~~~ Semantics related *constants*: ~~~~~~~~ -->
- <!-- Strip off semantics -->
- <xsl:variable name="SEM_STRIP" select="-1"/>
- <!-- Pass semantics "as is" -->
- <xsl:variable name="SEM_PASS" select="0"/>
- <!-- Add semantics at top level only -->
- <xsl:variable name="SEM_TOP" select="1"/>
- <!-- Add semantics at all levels -->
- <xsl:variable name="SEM_ALL" select="2"/>
- <!-- Semantics at top level only, with id refs -->
- <!-- NOTE: ids have to be already present in the
- input for this feature to work. -->
- <xsl:variable name="SEM_XREF" select="3"/>
- <!-- No semantics at top level, with id refs -->
- <!-- NOTE: ids have to be already present in the
- input for this feature to work. -->
- <xsl:variable name="SEM_XREF_EXT" select="4"/>
- <!-- ~~~~~~~~~~ Stylesheet *parameter*: SEM_SW ~~~~~~~~~~~~~~ -->
- <!-- Assumes one of the above values; SEM_PASS is the default -->
- <!-- The default can be overridden by specifying different -->
- <!-- value on the command line when the stylesheet is invoked -->
- <xsl:param name="SEM_SW" select="SEM_PASS"/>
- <!-- ~~~~~~ Operator precedence definitions ~~~~~~ -->
- <xsl:variable name="NO_PREC" select="0"/>
- <xsl:variable name="UNION_PREC" select="1"/>
- <xsl:variable name="SETDIFF_PREC" select="1"/>
- <xsl:variable name="INTERSECT_PREC" select="3"/>
- <xsl:variable name="CARTPROD_PREC" select="3"/>
- <xsl:variable name="OR_PREC" select="5"/>
- <xsl:variable name="XOR_PREC" select="7"/>
- <xsl:variable name="AND_PREC" select="9"/>
- <xsl:variable name="NOT_PREC" select="11"/>
- <xsl:variable name="PLUS_PREC" select="13"/>
- <xsl:variable name="MINUS_PREC" select="13"/>
- <xsl:variable name="NEG_PREC" select="15"/>
- <xsl:variable name="MUL_PREC" select="17"/>
- <xsl:variable name="DIV_PREC" select="17"/>
- <xsl:variable name="REM_PREC" select="17"/>
- <xsl:variable name="FUNCTN_PREC" select="97"/>
- <xsl:variable name="GEN_FUN_PREC" select="99"/>
- <!-- ~~~~~ Miscellaneous constant definitions ~~~~~ -->
- <xsl:variable name="YES" select="1"/>
- <xsl:variable name="NO" select="0"/>
- <xsl:variable name="NO_PARAM" select="-1"/>
- <xsl:variable name="PAR_SAME" select="-3"/>
- <xsl:variable name="PAR_YES" select="-5"/>
- <xsl:variable name="PAR_NO" select="-7"/>
- <!-- +++++++++++++++++ INDEX OF TEMPLATES +++++++++++++++++++ -->
- <!-- All templates are subdivided into the following categories
- (listed in the order of appearance in the stylesheet):
- THE TOPMOST ELEMENT: MATH
- math
- SEMANTICS HANDLING
- semantics
- BASIC CONTAINER ELEMENTS
- cn, ci; csymbol
- BASIC CONTENT ELEMENTS
- fn, interval, inverse, sep, condition, declare, lambda, compose,
- ident; domain, codomain, image, domainofapplication, piecewise
- ARITHMETIC, ALGEBRA & LOGIC
- quotient, exp, factorial, max, min, minus, plus, power, rem, divide,
- times, root, gcd, and, or, xor, not, forall, exists, abs, conjugate;
- arg, real, imaginary, lcm, floor, ceiling
- RELATIONS
- neq, approx, tendsto, implies, in, notin, notsubset, notprsubset,
- subset, prsubset, eq, gt, lt, geq, leq; equivalent, factorof
- CALCULUS
- ln, log, diff, partialdiff, lowlimit, uplimit, bvar, degree,
- logbase; divergence, grad, curl, laplacian
- SET THEORY
- set, list, union, intersect, setdiff; card, cartesianproduct
- SEQUENCES AND SERIES
- sum, product, limit
- TRIGONOMETRY
- sin, cos, tan, sec, csc, cot, sinh, cosh, tanh, sech, csch, coth,
- arcsin, arccos, arctan, arcsec, arccsc, arccot, arcsinh, arccosh,
- arctanh, arcsech, arccsch, arccoth
- STATISTICS
- mean, sdev, variance, median, mode, moment, momentabout
- LINEAR ALGEBRA
- vector, matrix, matrixrow, determinant, transpose, selector;
- vectorproduct, scalarproduct, outerproduct
- CONSTANT and SYMBOL ELEMENTS
- integers, reals, rationals, naturalnumbers, complexes, primes,
- exponentiale, imaginaryi, notanumber, true, false, emptyset,
- pi, eulergamma, infinity
- -->
- <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
- <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~ TEMPLATES ~~~~~~~~~~~~~~~~~~~~~~~~~ -->
- <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
- <!-- *********************** COPY THROUGH ************************ -->
- <xsl:template match = "*">
- <xsl:copy>
- <xsl:copy-of select="@*"/>
- <xsl:apply-templates/>
- </xsl:copy>
- </xsl:template>
- <!-- ***************** THE TOPMOST ELEMENT: MATH ***************** -->
- <xsl:template match = "math">
- <math>
- <xsl:copy-of select="@*"/>
- <xsl:choose>
- <xsl:when test="$SEM_SW=$SEM_TOP or $SEM_SW=$SEM_ALL and *[2] or
- $SEM_SW=$SEM_XREF">
- <semantics>
- <mrow>
- <xsl:apply-templates mode = "semantics"/>
- </mrow>
- <annotation-xml encoding="MathML">
- <xsl:copy-of select="*"/>
- </annotation-xml>
- </semantics>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates mode = "semantics"/>
- </xsl:otherwise>
- </xsl:choose>
- </math>
- </xsl:template>
- <!-- ***************** SEMANTICS HANDLING ***************** -->
- <!-- This template is called recursively. At each level -->
- <!-- in the source tree it decides whether to strip off, -->
- <!-- pass or add semantics at that level (depending on the -->
- <!-- value of SEM_SW parameter). Then the actual template -->
- <!-- is applied to the node. -->
- <xsl:template match = "*" mode = "semantics">
- <xsl:param name="IN_PREC" select="$NO_PREC"/>
- <xsl:param name="PARAM" select="$NO_PARAM"/>
- <xsl:param name="PAREN" select="$PAR_NO"/>
- <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
- <xsl:choose>
- <xsl:when test="$SEM_SW=$SEM_STRIP and self::semantics">
- <xsl:apply-templates select="annotation-xml[@encoding='MathML']">
- <xsl:with-param name="IN_PREC" select="$IN_PREC"/>
- <xsl:with-param name="PARAM" select="$PARAM"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:when test="($SEM_SW=$SEM_PASS or $SEM_SW=$SEM_TOP) and self::semantics">
- <semantics>
- <xsl:apply-templates select="*[1]">
- <xsl:with-param name="IN_PREC" select="$IN_PREC"/>
- <xsl:with-param name="PARAM" select="$PARAM"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- <xsl:copy-of select="annotation-xml"/>
- </semantics>
- </xsl:when>
- <xsl:when test="$SEM_SW=$SEM_ALL">
- <semantics>
- <xsl:choose>
- <xsl:when test="self::semantics">
- <xsl:apply-templates select="*[1]">
- <xsl:with-param name="IN_PREC" select="$IN_PREC"/>
- <xsl:with-param name="PARAM" select="$PARAM"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- <xsl:copy-of select="annotation-xml"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates select=".">
- <xsl:with-param name="IN_PREC" select="$IN_PREC"/>
- <xsl:with-param name="PARAM" select="$PARAM"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- <annotation-xml encoding="MathML">
- <xsl:copy-of select="."/>
- </annotation-xml>
- </xsl:otherwise>
- </xsl:choose>
- </semantics>
- </xsl:when>
- <xsl:when test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:choose>
- <xsl:when test="self::sematics">
- <xsl:copy>
- <xsl:copy-of select="@*"/>
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- <xsl:copy-of select="*[1]"/>
- <xsl:copy-of select="annotation-xml"/>
- </xsl:copy>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates select=".">
- <xsl:with-param name="IN_PREC" select="$IN_PREC"/>
- <xsl:with-param name="PARAM" select="$PARAM"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates select=".">
- <xsl:with-param name="IN_PREC" select="$IN_PREC"/>
- <xsl:with-param name="PARAM" select="$PARAM"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template match = "semantics">
- <xsl:apply-templates select="*[1]" mode = "semantics"/>
- </xsl:template>
- <!-- ***************** BASIC CONTAINER ELEMENTS ***************** -->
- <xsl:template match = "cn">
- <xsl:param name="IN_PREC" select="$NO_PREC"/>
- <xsl:param name="PAREN" select="$PAR_NO"/>
- <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
- <xsl:choose>
- <xsl:when test=". < 0 and $IN_PREC > $NO_PREC and $PAREN=$PAR_NO
- and $PAR_NO_IGNORE=$NO">
- <mfenced separators="">
- <xsl:apply-templates select="." mode="cn"/>
- </mfenced>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates select="." mode="cn"/>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template match = "cn" mode="cn">
- <xsl:choose>
- <xsl:when test="(not(@type) or @type='integer' or @type='real') and @base">
- <msub>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <mn> <xsl:apply-templates mode = "semantics"/> </mn>
- <mn> <xsl:value-of select="@base"/> </mn>
- </msub>
- </xsl:when>
- <xsl:when test="not(@type) or @type='integer' or @type='real'">
- <mn>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates mode = "semantics"/>
- </mn>
- </xsl:when>
- <xsl:when test="@type='constant'">
- <mn>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates mode = "semantics"/>
- </mn>
- </xsl:when>
- <xsl:when test="@type='e-notation' and not(@base) and child::sep[1]">
- <mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <mn> <xsl:apply-templates select="text()[1]" mode = "semantics"/> </mn>
- <mo> e </mo>
- <mn> <xsl:apply-templates select="text()[2]" mode = "semantics"/> </mn>
- </mrow>
- </xsl:when>
- <xsl:when test="@type='complex-cartesian' and not(@base) and child::sep[1]">
- <mfenced separators="">
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <mn> <xsl:apply-templates select="text()[1]" mode = "semantics"/> </mn>
- <xsl:if test="text()[2] < 0">
- <mo> - </mo>
- <mn> <xsl:value-of select="-text()[2]"/> </mn>
- </xsl:if>
- <xsl:if test="not(text()[2] < 0)">
- <mo> + </mo>
- <mn> <xsl:value-of select="text()[2]"/> </mn>
- </xsl:if>
- <mo> <xsl:text disable-output-escaping='yes'>&#x2062;</xsl:text> </mo>
- <mo> <xsl:text disable-output-escaping='yes'>&#x2148;</xsl:text> </mo>
- </mfenced>
- </xsl:when>
- <xsl:when test="@type='complex-cartesian' and @base and child::sep[1]">
- <msub>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <mfenced separators="">
- <mn> <xsl:apply-templates select="text()[1]"/> </mn>
- <xsl:if test="text()[2] < 0">
- <mo> - </mo>
- <mn> <xsl:value-of select="-text()[2]"/> </mn>
- </xsl:if>
- <xsl:if test="not(text()[2] < 0)">
- <mo> + </mo>
- <mn> <xsl:apply-templates select="text()[2]"/> </mn>
- </xsl:if>
- <mo> <xsl:text disable-output-escaping='yes'>&#x2062;</xsl:text> </mo>
- <mo> <xsl:text disable-output-escaping='yes'>&#x2148;</xsl:text> </mo>
- </mfenced>
- <mn> <xsl:value-of select="@base"/> </mn>
- </msub>
- </xsl:when>
- <xsl:when test="@type='rational' and not(@base) and child::sep[1]">
- <mfrac>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <mn> <xsl:apply-templates select="text()[1]"/> </mn>
- <mn> <xsl:apply-templates select="text()[2]"/> </mn>
- </mfrac>
- </xsl:when>
- <xsl:when test="@type='rational' and @base and child::sep[1]">
- <msub>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <mfenced>
- <mfrac>
- <mn> <xsl:apply-templates select="text()[1]"/> </mn>
- <mn> <xsl:apply-templates select="text()[2]"/> </mn>
- </mfrac>
- </mfenced>
- <mn> <xsl:value-of select="@base"/> </mn>
- </msub>
- </xsl:when>
- <xsl:when test="@type='complex-polar' and not(@base) and child::sep[1]">
- <mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <mo> Polar </mo>
- <mo> <xsl:text disable-output-escaping='yes'>&#x2062;</xsl:text> </mo>
- <mfenced separators=",">
- <mn> <xsl:apply-templates select="text()[1]"/> </mn>
- <mn> <xsl:apply-templates select="text()[2]"/> </mn>
- </mfenced>
- </mrow>
- </xsl:when>
- <xsl:when test="@type='complex-polar' and @base and child::sep[1]">
- <msub>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <mrow>
- <mo> Polar </mo>
- <mo> <xsl:text disable-output-escaping='yes'>&#x2062;</xsl:text> </mo>
- <mfenced separators=",">
- <mn> <xsl:apply-templates select="text()[1]"/> </mn>
- <mn> <xsl:apply-templates select="text()[2]"/> </mn>
- </mfenced>
- </mrow>
- <mn> <xsl:value-of select="@base"/> </mn>
- </msub>
- </xsl:when>
- <xsl:otherwise>
- <mn> <xsl:apply-templates mode = "semantics"/> </mn>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template match = "ci">
- <xsl:choose>
- <xsl:when test="@type='vector' or @type='matrix' or @type='set'">
- <mi mathvariant="bold">
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates mode = "semantics"/>
- </mi>
- </xsl:when>
- <xsl:when test="child::text() and not(child::*[1])">
- <mi>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates/>
- </mi>
- </xsl:when>
- <xsl:when test="child::text() and *[1] and not(*[1]=sep)">
- <mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates/>
- </mrow>
- </xsl:when>
- <xsl:otherwise>
- <xsl:if test="*[2]">
- <mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select="*"/>
- </mrow>
- </xsl:if>
- <xsl:if test="not(*[2])">
- <xsl:apply-templates select="*[1]"/>
- </xsl:if>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template match = "ci/*[not(self::sep)]">
- <xsl:copy-of select = "."/>
- </xsl:template>
- <xsl:template match = "csymbol">
- <mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:copy-of select = "* | text()"/>
- </mrow>
- </xsl:template>
- <!-- ***************** BASIC CONTENT ELEMENTS ***************** -->
- <!-- General <apply> <AnyFunction/> ... </apply> -->
- <!-- Dependants: csymbol apply[fn inverse compose] -->
- <xsl:template match = "apply">
- <xsl:param name="IN_PREC" select="$NO_PREC"/>
- <xsl:param name="PARAM" select="$NO_PARAM"/>
- <xsl:param name="PAREN" select="$PAR_NO"/>
- <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
- <mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select = "*[1]" mode = "semantics">
- <xsl:with-param name="IN_PREC" select="$FUNCTN_PREC"/>
- <xsl:with-param name="PARAM" select="$PAR_SAME"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
- </xsl:apply-templates>
- <mo> <xsl:text disable-output-escaping='yes'>&#x2061;</xsl:text> </mo>
- <mfenced separators=",">
- <xsl:apply-templates select = "*[position()>1]" mode = "semantics">
- <xsl:with-param name="IN_PREC" select="$FUNCTN_PREC"/>
- <xsl:with-param name="PARAM" select="$PAR_SAME"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
- </xsl:apply-templates>
- </mfenced>
- </mrow>
- </xsl:template>
- <!-- fn is ***DEPRECATED*** -->
- <xsl:template match = "fn">
- <xsl:param name="IN_PREC" select="$NO_PREC"/>
- <xsl:param name="PARAM" select="$NO_PARAM"/>
- <xsl:param name="PAREN" select="$PAR_NO"/>
- <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
- <xsl:apply-templates mode = "semantics">
- <xsl:with-param name="IN_PREC" select="$FUNCTN_PREC"/>
- <xsl:with-param name="PARAM" select="$PAR_SAME"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
- </xsl:apply-templates>
- </xsl:template>
- <xsl:template match = "interval">
- <mfenced>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:if test="not(@closure) or @closure='closed' or @closure='closed-open' or not(@closure='open') and not(@closure='open-closed')">
- <xsl:attribute name="open"> [ </xsl:attribute>
- </xsl:if>
- <xsl:if test="not(@closure) or @closure='closed' or @closure='open-closed' or not(@closure='open') and not(@closure='closed-open')">
- <xsl:attribute name="close"> ] </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select="*" mode = "semantics"/>
- </mfenced>
- </xsl:template>
- <xsl:template match = "apply[*[1][self::inverse]]">
- <xsl:param name="IN_PREC" select="$NO_PREC"/>
- <xsl:param name="PAREN" select="$PAR_NO"/>
- <xsl:param name="PARAM" select="$NO_PARAM"/>
- <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
- <xsl:choose>
- <xsl:when test="*[2]=exp | *[2]=ln | *[2]=sin | *[2]=cos |
- *[2]=tan | *[2]=sec | *[2]=csc | *[2]=cot |
- *[2]=sinh | *[2]=cosh | *[2]=tanh | *[2]=sech |
- *[2]=csch | *[2]=coth | *[2]=arcsin |
- *[2]=arccos | *[2]=arctan">
- <mo>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select="*[2]" mode="inverse"/>
- </mo>
- </xsl:when>
- <xsl:otherwise>
- <msup>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <mrow>
- <xsl:apply-templates select = "*[2]">
- <xsl:with-param name="IN_PREC" select="$FUNCTN_PREC"/>
- <xsl:with-param name="PARAM" select="$PAR_SAME"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
- </xsl:apply-templates>
- </mrow>
- <mfenced>
- <mn> -1 </mn>
- </mfenced>
- </msup>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template match = "*" mode="inverse">
- <xsl:choose>
- <xsl:when test="self::exp">
- <xsl:value-of select="'ln'"/>
- </xsl:when>
- <xsl:when test="self::ln">
- <xsl:value-of select="'exp'"/>
- </xsl:when>
- <xsl:when test="self::sin">
- <xsl:value-of select="'arcsin'"/>
- </xsl:when>
- <xsl:when test="self::cos">
- <xsl:value-of select="'arccos'"/>
- </xsl:when>
- <xsl:when test="self::tan">
- <xsl:value-of select="'arctan'"/>
- </xsl:when>
- <xsl:when test="self::sec">
- <xsl:value-of select="'arcsec'"/>
- </xsl:when>
- <xsl:when test="self::csc">
- <xsl:value-of select="'arccsc'"/>
- </xsl:when>
- <xsl:when test="self::cot">
- <xsl:value-of select="'arccot'"/>
- </xsl:when>
- <xsl:when test="self::sinh">
- <xsl:value-of select="'arcsinh'"/>
- </xsl:when>
- <xsl:when test="self::cosh">
- <xsl:value-of select="'arccosh'"/>
- </xsl:when>
- <xsl:when test="self::tanh">
- <xsl:value-of select="'arctanh'"/>
- </xsl:when>
- <xsl:when test="self::sech">
- <xsl:value-of select="'arcsech'"/>
- </xsl:when>
- <xsl:when test="self::csch">
- <xsl:value-of select="'arccsch'"/>
- </xsl:when>
- <xsl:when test="self::coth">
- <xsl:value-of select="'arccoth'"/>
- </xsl:when>
- <xsl:when test="self::arcsin">
- <xsl:value-of select="'sin'"/>
- </xsl:when>
- <xsl:when test="self::arccos">
- <xsl:value-of select="'cos'"/>
- </xsl:when>
- <xsl:when test="self::arctan">
- <xsl:value-of select="'tan'"/>
- </xsl:when>
- </xsl:choose>
- </xsl:template>
- <xsl:template match = "condition">
- <mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select="*" mode = "semantics"/>
- </mrow>
- </xsl:template>
- <xsl:template match = "declare"/>
- <xsl:template match = "lambda">
- <mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <mo> <xsl:text disable-output-escaping='yes'>&#x03BB;</xsl:text> </mo>
- <mo> <xsl:text disable-output-escaping='yes'>&#x2061;</xsl:text> </mo>
- <mfenced>
- <xsl:for-each select = "*">
- <xsl:choose>
- <xsl:when test="self::ci or self::cn">
- <xsl:apply-templates select = "." mode="semantics"/>
- </xsl:when>
- <xsl:otherwise>
- <mrow>
- <xsl:apply-templates select = "." mode="semantics"/>
- </mrow>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:for-each>
- </mfenced>
- </mrow>
- </xsl:template>
- <xsl:template match = "apply[*[1][self::compose]]">
- <xsl:param name="IN_PREC" select="$NO_PREC"/>
- <xsl:param name="PAREN" select="$PAR_NO"/>
- <xsl:param name="PARAM" select="$NO_PARAM"/>
- <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
- <xsl:choose>
- <xsl:when test="$IN_PREC < $GEN_FUN_PREC and
- ($IN_PREC > $FUNCTN_PREC or $IN_PREC=$FUNCTN_PREC and $PARAM=$PAR_SAME)">
- <mfenced separators="">
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select = "*[2]" mode="semantics"/>
- <xsl:for-each select = "*[position()>2]">
- <mo> <xsl:text disable-output-escaping='yes'>&#x2218;</xsl:text> </mo>
- <xsl:apply-templates select = "." mode="semantics">
- <xsl:with-param name="IN_PREC" select="$FUNCTN_PREC"/>
- <xsl:with-param name="PARAM" select="$PAR_SAME"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
- </xsl:apply-templates>
- </xsl:for-each>
- </mfenced>
- </xsl:when>
- <xsl:otherwise>
- <mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select = "*[2]" mode="semantics"/>
- <xsl:for-each select = "*[position()>2]">
- <mo> <xsl:text disable-output-escaping='yes'>&#x2218;</xsl:text> </mo>
- <xsl:apply-templates select = "." mode="semantics">
- <xsl:with-param name="IN_PREC" select="$FUNCTN_PREC"/>
- <xsl:with-param name="PARAM" select="$PAR_SAME"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
- </xsl:apply-templates>
- </xsl:for-each>
- </mrow>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template match = "ident">
- <xsl:choose>
- <xsl:when test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <mtext xref="{@id}">id</mtext>
- </xsl:when>
- <xsl:otherwise>
- <mtext>id</mtext>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template match="apply[*[1]=domain or *[1]=codomain or *[1]=image]">
- <mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:if test="*[1]=domain">
- <mtext>domain</mtext>
- </xsl:if>
- <xsl:if test="*[1]=codomain">
- <mtext>codomain</mtext>
- </xsl:if>
- <xsl:if test="*[1]=image">
- <mtext>image</mtext>
- </xsl:if>
- <mo> <xsl:text disable-output-escaping='yes'>&#x2061;</xsl:text> </mo>
- <mfenced separators="">
- <xsl:apply-templates select="*[position()>1]" mode = "semantics"/>
- </mfenced>
- </mrow>
- </xsl:template>
- <xsl:template match = "domainofapplication">
- <mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select = "*" mode = "semantics"/>
- </mrow>
- </xsl:template>
- <xsl:template match="piecewise">
- <mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <mo stretchy="true"> { </mo>
- <mtable columnalign="left left">
- <xsl:for-each select="piece">
- <mtr>
- <mtd>
- <xsl:apply-templates select="*[position()=1]" mode = "semantics"/>
- </mtd>
- <mtd>
- <mtext>if </mtext>
- <xsl:apply-templates select="*[position()=2]" mode = "semantics"/>
- </mtd>
- </mtr>
- </xsl:for-each>
- <xsl:if test="otherwise">
- <mtr>
- <mtd>
- <xsl:apply-templates select="otherwise/*" mode = "semantics"/>
- </mtd>
- <mtd>
- <mtext>otherwise</mtext>
- </mtd>
- </mtr>
- </xsl:if>
- </mtable>
- </mrow>
- </xsl:template>
- <!-- ***************** ARITHMETIC, ALGEBRA & LOGIC ***************** -->
- <xsl:template match = "apply[quotient[1]]">
- <xsl:param name="IN_PREC" select="$NO_PREC"/>
- <xsl:param name="PARAM" select="$NO_PARAM"/>
- <xsl:param name="PAREN" select="$PAR_NO"/>
- <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
- <mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <mo> <xsl:text disable-output-escaping='yes'>&#x230A;</xsl:text> </mo>
- <mfrac>
- <mrow>
- <xsl:apply-templates select="*[2]" mode = "semantics">
- <xsl:with-param name="IN_PREC" select="$DIV_PREC"/>
- <xsl:with-param name="PARAM" select="$PARAM"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- </mrow>
- <mrow>
- <xsl:apply-templates select="*[3]" mode = "semantics">
- <xsl:with-param name="IN_PREC" select="$DIV_PREC"/>
- <xsl:with-param name="PARAM" select="$PARAM"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- </mrow>
- </mfrac>
- <mo> <xsl:text disable-output-escaping='yes'>&#x230B;</xsl:text> </mo>
- </mrow>
- </xsl:template>
- <xsl:template match = "apply[*[1][self::exp]]">
- <msup>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <mn> <xsl:text disable-output-escaping='yes'>e</xsl:text> </mn>
- <xsl:apply-templates select = "*[2]" mode = "semantics"/>
- </msup>
- </xsl:template>
- <xsl:template match = "apply[factorial[1]]">
- <mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select = "*[2]" mode = "semantics">
- <xsl:with-param name="IN_PREC" select="$FUNCTN_PREC"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
- </xsl:apply-templates>
- <mo> ! </mo>
- </mrow>
- </xsl:template>
- <xsl:template match = "apply[max[1] | min[1]]">
- <mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:choose>
- <xsl:when test="*[2]=bvar">
- <munder>
- <xsl:if test="*[1]=max">
- <mo> max </mo>
- </xsl:if>
- <xsl:if test="*[1]=min">
- <mo> min </mo>
- </xsl:if>
- <xsl:apply-templates select="*[2]" mode = "semantics"/>
- </munder>
- </xsl:when>
- <xsl:otherwise>
- <xsl:if test="*[1]=max">
- <mo> max </mo>
- </xsl:if>
- <xsl:if test="*[1]=min">
- <mo> min </mo>
- </xsl:if>
- </xsl:otherwise>
- </xsl:choose>
- <mfenced open="{{" close="}}">
- <xsl:if test="child::condition">
- <xsl:attribute name="separators"/>
- <xsl:if test="*[position()>1 and not(self::bvar) and not(self::condition)]">
- <mfenced open="" close="" separators=",">
- <xsl:for-each select = "*[position()>1 and not(self::bvar) and not(self::condition)]">
- <xsl:apply-templates select = "." mode="semantics"/>
- </xsl:for-each>
- </mfenced>
- <mo lspace="0.1666em" rspace="0.1666em"> | </mo>
- </xsl:if>
- <xsl:apply-templates select="condition" mode = "semantics"/>
- </xsl:if>
- <xsl:if test="not(child::condition)">
- <xsl:for-each select = "*[position()>1 and not(self::bvar)]">
- <xsl:apply-templates select = "." mode="semantics"/>
- </xsl:for-each>
- </xsl:if>
- </mfenced>
- </mrow>
- </xsl:template>
- <xsl:template match = "apply[minus[1]]">
- <xsl:param name="IN_PREC" select="$NO_PREC"/>
- <xsl:param name="PARAM" select="$NO_PARAM"/>
- <xsl:param name="PAREN" select="$PAR_NO"/>
- <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
- <xsl:choose>
- <xsl:when test="$IN_PREC < $GEN_FUN_PREC and
- ($IN_PREC > $MINUS_PREC or $IN_PREC=$MINUS_PREC and $PARAM=$PAR_SAME)">
- <mfenced separators="">
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select="." mode="minus">
- <xsl:with-param name="PARAM" select="$PARAM"/>
- <xsl:with-param name="PAREN" select="$PAR_YES"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- </mfenced>
- </xsl:when>
- <xsl:when test="$IN_PREC > $NO_PREC and $IN_PREC < $GEN_FUN_PREC
- and not($SEM_SW=$SEM_ALL) and not($SEM_SW=$SEM_XREF)
- and not($SEM_SW=$SEM_XREF_EXT)">
- <xsl:apply-templates select="." mode="minus">
- <xsl:with-param name="PARAM" select="$PARAM"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:otherwise>
- <mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select="." mode="minus">
- <xsl:with-param name="PARAM" select="$PARAM"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- </mrow>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template match = "apply[minus[1]]" mode="minus">
- <xsl:param name="PARAM" select="$NO_PARAM"/>
- <xsl:param name="PAREN" select="$PAR_NO"/>
- <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
- <xsl:if test="not(*[3])">
- <mo> - </mo>
- <xsl:apply-templates select="*[2]" mode = "semantics">
- <xsl:with-param name="IN_PREC" select="$NEG_PREC"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
- </xsl:apply-templates>
- </xsl:if>
- <xsl:if test="*[3]">
- <xsl:apply-templates select="*[2]" mode = "semantics">
- <xsl:with-param name="IN_PREC" select="$MINUS_PREC"/>
- <xsl:with-param name="PARAM" select="$PARAM"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- <mo> - </mo>
- <xsl:apply-templates select="*[3]" mode = "semantics">
- <xsl:with-param name="IN_PREC" select="$MINUS_PREC"/>
- <xsl:with-param name="PARAM" select="$PAR_SAME"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
- </xsl:apply-templates>
- </xsl:if>
- </xsl:template>
- <xsl:template match = "apply[plus[1]]">
- <xsl:param name="IN_PREC" select="$NO_PREC"/>
- <xsl:param name="PARAM" select="$NO_PARAM"/>
- <xsl:param name="PAREN" select="$PAR_NO"/>
- <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
- <xsl:choose>
- <xsl:when test="$IN_PREC < $GEN_FUN_PREC and
- ($IN_PREC > $PLUS_PREC or $IN_PREC=$PLUS_PREC and $PARAM=$PAR_SAME)">
- <mfenced separators="">
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select="." mode="plus">
- <xsl:with-param name="PARAM" select="$IN_PREC"/>
- <xsl:with-param name="PAREN" select="$PAR_YES"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- </mfenced>
- </xsl:when>
- <xsl:when test="$IN_PREC > $NO_PREC and $IN_PREC < $GEN_FUN_PREC
- and not($SEM_SW=$SEM_ALL) and not($SEM_SW=$SEM_XREF)
- and not($SEM_SW=$SEM_XREF_EXT)">
- <xsl:apply-templates select="." mode="plus">
- <xsl:with-param name="PARAM" select="$PARAM"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:otherwise>
- <mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select="." mode="plus">
- <xsl:with-param name="PARAM" select="$IN_PREC"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- </mrow>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template match = "apply[plus[1]]" mode="plus">
- <xsl:param name="PARAM" select="$NO_PARAM"/>
- <xsl:param name="PAREN" select="$PAR_NO"/>
- <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
- <xsl:if test="*[2]">
- <xsl:apply-templates select="*[2]" mode = "semantics">
- <xsl:with-param name="IN_PREC" select="$PLUS_PREC"/>
- <xsl:with-param name="PARAM" select="$PARAM"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- <xsl:for-each select = "*[position()>2]">
- <xsl:choose>
- <xsl:when test=". < 0">
- <mo> - </mo>
- <mn> <xsl:value-of select="-."/> </mn>
- </xsl:when>
- <xsl:when test="self::apply[minus[1]] and not(*[3])">
- <xsl:apply-templates select="." mode = "semantics">
- <xsl:with-param name="IN_PREC" select="$PLUS_PREC"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:otherwise>
- <mo> + </mo>
- <xsl:apply-templates select="." mode = "semantics">
- <xsl:with-param name="IN_PREC" select="$PLUS_PREC"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
- </xsl:apply-templates>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:for-each>
- </xsl:if>
- </xsl:template>
- <xsl:template match = "apply[*[1][self::power]]">
- <xsl:choose>
- <xsl:when test="*[2]=apply[ln[1] | log[1] | abs[1] |
- gcd[1] | lcm[1] | sin[1] | cos[1] | tan[1] |
- sec[1] | csc[1] | cot[1] | sinh[1] |
- cosh[1] | tanh[1] | sech[1] | csch[1] |
- coth[1] | arcsin[1] | arccos[1] |
- arctan[1] | arcsec[1] | arccsc[1] |
- arccot[1] | arcsinh[1] | arccosh[1] |
- arctanh[1] | arcsech[1] | arccsch[1] |
- arccoth[1]]">
- <xsl:apply-templates select="*[2]" mode = "semantics"/>
- </xsl:when>
- <xsl:otherwise>
- <msup>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select = "*[2]" mode = "semantics">
- <xsl:with-param name="IN_PREC" select="$FUNCTN_PREC"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
- </xsl:apply-templates>
- <xsl:apply-templates select = "*[3]" mode = "semantics"/>
- </msup>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template match = "apply[divide[1]]">
- <xsl:param name="IN_PREC" select="$NO_PREC"/>
- <xsl:param name="PARAM" select="$NO_PARAM"/>
- <xsl:param name="PAREN" select="$PAR_NO"/>
- <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
- <xsl:choose>
- <xsl:when test="$IN_PREC < $GEN_FUN_PREC and
- ($IN_PREC > $DIV_PREC or $IN_PREC=$DIV_PREC and $PARAM=$PAR_SAME)">
- <mfenced separators="">
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select="." mode="div">
- <xsl:with-param name="PARAM" select="$IN_PREC"/>
- <xsl:with-param name="PAREN" select="$PAR_YES"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- </mfenced>
- </xsl:when>
- <xsl:when test="$IN_PREC > $NO_PREC and $IN_PREC < $GEN_FUN_PREC
- and not($SEM_SW=$SEM_ALL) and not($SEM_SW=$SEM_XREF)
- and not($SEM_SW=$SEM_XREF_EXT)">
- <xsl:apply-templates select="." mode="div">
- <xsl:with-param name="PARAM" select="$PARAM"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:otherwise>
- <mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select="." mode="div">
- <xsl:with-param name="PARAM" select="$IN_PREC"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- </mrow>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template match = "apply[divide[1]]" mode="div">
- <xsl:param name="PARAM" select="$NO_PARAM"/>
- <xsl:param name="PAREN" select="$PAR_NO"/>
- <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
- <mfrac>
- <mrow>
- <xsl:apply-templates select = "*[2]" mode = "semantics">
- <xsl:with-param name="IN_PREC" select="$GEN_FUN_PREC"/>
- <xsl:with-param name="PARAM" select="$PARAM"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- </mrow>
- <mrow>
- <xsl:apply-templates select = "*[3]" mode = "semantics">
- <xsl:with-param name="IN_PREC" select="$GEN_FUN_PREC"/>
- <xsl:with-param name="PARAM" select="$PARAM"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- </mrow>
- </mfrac>
- </xsl:template>
- <xsl:template match = "apply[rem[1]]">
- <xsl:param name="IN_PREC" select="$NO_PREC"/>
- <xsl:param name="PARAM" select="$NO_PARAM"/>
- <xsl:param name="PAREN" select="$PAR_NO"/>
- <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
- <xsl:choose>
- <xsl:when test="$IN_PREC < $GEN_FUN_PREC and
- ($IN_PREC > $REM_PREC or $IN_PREC=$REM_PREC and $PARAM=$PAR_SAME)">
- <mfenced separators="">
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select="." mode="rem">
- <xsl:with-param name="PARAM" select="$IN_PREC"/>
- <xsl:with-param name="PAREN" select="$PAR_YES"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- </mfenced>
- </xsl:when>
- <xsl:when test="$IN_PREC > $NO_PREC and $IN_PREC < $GEN_FUN_PREC
- and not($SEM_SW=$SEM_ALL) and not($SEM_SW=$SEM_XREF)
- and not($SEM_SW=$SEM_XREF_EXT)">
- <xsl:apply-templates select="." mode="rem">
- <xsl:with-param name="PARAM" select="$PARAM"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:otherwise>
- <mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select="." mode="rem">
- <xsl:with-param name="PARAM" select="$IN_PREC"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- </mrow>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template match = "apply[rem[1]]" mode="rem">
- <xsl:param name="PARAM" select="$NO_PARAM"/>
- <xsl:param name="PAREN" select="$PAR_NO"/>
- <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
- <xsl:apply-templates select = "*[2]" mode = "semantics">
- <xsl:with-param name="IN_PREC" select="$REM_PREC"/>
- <xsl:with-param name="PARAM" select="$PARAM"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- <mo lspace="thickmathspace" rspace="thickmathspace"> <xsl:value-of select="'mod'"/> </mo>
- <xsl:apply-templates select = "*[3]" mode = "semantics">
- <xsl:with-param name="IN_PREC" select="$REM_PREC"/>
- <xsl:with-param name="PARAM" select="$PAR_SAME"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
- </xsl:apply-templates>
- </xsl:template>
- <xsl:template match = "apply[times[1]]">
- <xsl:param name="IN_PREC" select="$NO_PREC"/>
- <xsl:param name="PARAM" select="$NO_PARAM"/>
- <xsl:param name="PAREN" select="$PAR_NO"/>
- <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
- <xsl:choose>
- <xsl:when test="$IN_PREC < $GEN_FUN_PREC and
- ($IN_PREC > $MUL_PREC or $IN_PREC=$MUL_PREC and $PARAM=$PAR_SAME)">
- <mfenced separators="">
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select="." mode="times">
- <xsl:with-param name="PARAM" select="$IN_PREC"/>
- <xsl:with-param name="PAREN" select="$PAR_YES"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- </mfenced>
- </xsl:when>
- <xsl:when test="$IN_PREC > $NO_PREC and $IN_PREC < $GEN_FUN_PREC
- and not($SEM_SW=$SEM_ALL) and not($SEM_SW=$SEM_XREF)
- and not($SEM_SW=$SEM_XREF_EXT)">
- <xsl:apply-templates select="." mode="times">
- <xsl:with-param name="PARAM" select="$PARAM"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:otherwise>
- <mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select="." mode="times">
- <xsl:with-param name="PARAM" select="$IN_PREC"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- </mrow>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template match = "apply[times[1]]" mode="times">
- <xsl:param name="PARAM" select="$NO_PARAM"/>
- <xsl:param name="PAREN" select="$PAR_NO"/>
- <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
- <xsl:apply-templates select="*[2]" mode = "semantics">
- <xsl:with-param name="IN_PREC" select="$MUL_PREC"/>
- <xsl:with-param name="PARAM" select="$PARAM"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- <xsl:if test="*[3]">
- <xsl:for-each select = "*[position()>2]">
- <mo> <xsl:text disable-output-escaping='yes'>&#x2062;</xsl:text> </mo>
- <xsl:apply-templates select="." mode = "semantics">
- <xsl:with-param name="IN_PREC" select="$MUL_PREC"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
- </xsl:apply-templates>
- </xsl:for-each>
- </xsl:if>
- </xsl:template>
- <xsl:template match = "apply[*[1]=root and *[2]=degree]">
- <mroot>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select="*[3]" mode = "semantics">
- <xsl:with-param name="IN_PREC" select="$GEN_FUN_PREC"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
- </xsl:apply-templates>
- <xsl:apply-templates select="*[2]" mode = "semantics"/>
- </mroot>
- </xsl:template>
- <xsl:template match = "apply[*[1]=root and not(*[2]=degree)]">
- <msqrt>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select="*[2]" mode = "semantics">
- <xsl:with-param name="IN_PREC" select="$GEN_FUN_PREC"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
- </xsl:apply-templates>
- </msqrt>
- </xsl:template>
- <xsl:template match = "apply[gcd[1] | lcm[1]]">
- <mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:if test="not(parent::apply[power[1]])">
- <xsl:if test="gcd[1]">
- <mo> gcd </mo>
- </xsl:if>
- <xsl:if test="lcm[1]">
- <mo> lcm </mo>
- </xsl:if>
- </xsl:if>
- <xsl:if test="parent::apply[power[1]]">
- <msup>
- <xsl:if test="gcd[1]">
- <mo> gcd </mo>
- </xsl:if>
- <xsl:if test="lcm[1]">
- <mo> lcm </mo>
- </xsl:if>
- <xsl:apply-templates select = "../*[3]" mode = "semantics"/>
- </msup>
- </xsl:if>
- <mo> <xsl:text disable-output-escaping='yes'>&#x2061;</xsl:text> </mo>
- <mfenced separators=",">
- <xsl:for-each select = "*[position()>1]">
- <xsl:apply-templates select = "." mode="semantics"/>
- </xsl:for-each>
- </mfenced>
- </mrow>
- </xsl:template>
- <xsl:template match = "apply[and[1]]">
- <xsl:param name="IN_PREC" select="$NO_PREC"/>
- <xsl:param name="PARAM" select="$NO_PARAM"/>
- <xsl:param name="PAREN" select="$PAR_NO"/>
- <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
- <xsl:choose>
- <xsl:when test="$IN_PREC < $GEN_FUN_PREC and
- ($IN_PREC > $AND_PREC or $IN_PREC=$AND_PREC and $PARAM=$PAR_SAME)">
- <mfenced separators="">
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select="." mode="and">
- <xsl:with-param name="PARAM" select="$IN_PREC"/>
- <xsl:with-param name="PAREN" select="$PAR_YES"/>
- </xsl:apply-templates>
- </mfenced>
- </xsl:when>
- <xsl:when test="$IN_PREC > $NO_PREC and $IN_PREC < $GEN_FUN_PREC
- and not($SEM_SW=$SEM_ALL) and not($SEM_SW=$SEM_XREF)
- and not($SEM_SW=$SEM_XREF_EXT)">
- <xsl:apply-templates select="." mode="and">
- <xsl:with-param name="PARAM" select="$IN_PREC"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:otherwise>
- <mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select="." mode="and">
- <xsl:with-param name="PARAM" select="$IN_PREC"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- </mrow>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template match = "apply[and[1]]" mode="and">
- <xsl:param name="PARAM" select="$NO_PARAM"/>
- <xsl:param name="PAREN" select="$PAR_NO"/>
- <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
- <xsl:apply-templates select="*[2]" mode = "semantics">
- <xsl:with-param name="IN_PREC" select="$AND_PREC"/>
- <xsl:with-param name="PARAM" select="$PARAM"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- <xsl:for-each select = "*[position()>2]">
- <mo> <xsl:text disable-output-escaping='yes'>&#x2227;</xsl:text> </mo>
- <mo> <xsl:text disable-output-escaping='yes'>&#x2061;</xsl:text> </mo>
- <xsl:apply-templates select="." mode = "semantics">
- <xsl:with-param name="IN_PREC" select="$AND_PREC"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
- </xsl:apply-templates>
- </xsl:for-each>
- </xsl:template>
- <xsl:template match = "apply[or[1]]">
- <xsl:param name="IN_PREC" select="$NO_PREC"/>
- <xsl:param name="PARAM" select="$NO_PARAM"/>
- <xsl:param name="PAREN" select="$PAR_NO"/>
- <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
- <xsl:choose>
- <xsl:when test="$IN_PREC < $GEN_FUN_PREC and
- ($IN_PREC > $OR_PREC or $IN_PREC=$OR_PREC and $PARAM=$PAR_SAME)">
- <mfenced separators="">
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select="." mode="or">
- <xsl:with-param name="PARAM" select="$IN_PREC"/>
- <xsl:with-param name="PAREN" select="$PAR_YES"/>
- </xsl:apply-templates>
- </mfenced>
- </xsl:when>
- <xsl:when test="$IN_PREC > $NO_PREC and $IN_PREC < $GEN_FUN_PREC
- and not($SEM_SW=$SEM_ALL) and not($SEM_SW=$SEM_XREF)
- and not($SEM_SW=$SEM_XREF_EXT)">
- <xsl:apply-templates select="." mode="or">
- <xsl:with-param name="PARAM" select="$IN_PREC"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:otherwise>
- <mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select="." mode="or">
- <xsl:with-param name="PARAM" select="$IN_PREC"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- </mrow>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template match = "apply[or[1]]" mode="or">
- <xsl:param name="PARAM" select="$NO_PARAM"/>
- <xsl:param name="PAREN" select="$PAR_NO"/>
- <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
- <xsl:apply-templates select="*[2]" mode = "semantics">
- <xsl:with-param name="IN_PREC" select="$OR_PREC"/>
- <xsl:with-param name="PARAM" select="$PARAM"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- <xsl:for-each select = "*[position()>2]">
- <mo> <xsl:text disable-output-escaping='yes'>&#x2228;</xsl:text> </mo>
- <mo> <xsl:text disable-output-escaping='yes'>&#x2061;</xsl:text> </mo>
- <xsl:apply-templates select="." mode = "semantics">
- <xsl:with-param name="IN_PREC" select="$OR_PREC"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
- </xsl:apply-templates>
- </xsl:for-each>
- </xsl:template>
- <xsl:template match = "apply[xor[1]]">
- <xsl:param name="IN_PREC" select="$NO_PREC"/>
- <xsl:param name="PARAM" select="$NO_PARAM"/>
- <xsl:param name="PAREN" select="$PAR_NO"/>
- <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
- <xsl:choose>
- <xsl:when test="$IN_PREC < $GEN_FUN_PREC and
- ($IN_PREC > $XOR_PREC or $IN_PREC=$XOR_PREC and $PARAM=$PAR_SAME)">
- <mfenced separators="">
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select="." mode="xor">
- <xsl:with-param name="PARAM" select="$IN_PREC"/>
- <xsl:with-param name="PAREN" select="$PAR_YES"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- </mfenced>
- </xsl:when>
- <xsl:when test="$IN_PREC > $NO_PREC and $IN_PREC < $GEN_FUN_PREC
- and not($SEM_SW=$SEM_ALL)">
- <xsl:apply-templates select="." mode="xor">
- <xsl:with-param name="PARAM" select="$IN_PREC"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:otherwise>
- <mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select="." mode="xor">
- <xsl:with-param name="PARAM" select="$IN_PREC"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- </mrow>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template match = "apply[xor[1]]" mode="xor">
- <xsl:param name="PARAM" select="$NO_PARAM"/>
- <xsl:param name="PAREN" select="$PAR_NO"/>
- <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
- <xsl:apply-templates select="*[2]" mode = "semantics">
- <xsl:with-param name="IN_PREC" select="$XOR_PREC"/>
- <xsl:with-param name="PARAM" select="$PARAM"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- <xsl:for-each select = "*[position()>2]">
- <mo> <xsl:text disable-output-escaping='yes'>&#x22BB;</xsl:text> </mo>
- <mo> <xsl:text disable-output-escaping='yes'>&#x2061;</xsl:text> </mo>
- <xsl:apply-templates select="." mode = "semantics">
- <xsl:with-param name="IN_PREC" select="$XOR_PREC"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
- </xsl:apply-templates>
- </xsl:for-each>
- </xsl:template>
- <xsl:template match = "apply[not[1]]">
- <xsl:param name="IN_PREC" select="$NO_PREC"/>
- <xsl:param name="PARAM" select="$NO_PARAM"/>
- <xsl:param name="PAREN" select="$PAR_NO"/>
- <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
- <xsl:choose>
- <xsl:when test="$IN_PREC < $GEN_FUN_PREC and $IN_PREC >= $NOT_PREC">
- <mfenced separators="">
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <mo> <xsl:text disable-output-escaping='yes'>&#x00AC;</xsl:text> </mo>
- <mo> <xsl:text disable-output-escaping='yes'>&#x2061;</xsl:text> </mo>
- <xsl:apply-templates select = "*[2]" mode = "semantics">
- <xsl:with-param name="IN_PREC" select="$NOT_PREC"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
- </xsl:apply-templates>
- </mfenced>
- </xsl:when>
- <xsl:otherwise>
- <mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <mo> <xsl:text disable-output-escaping='yes'>&#x00AC;</xsl:text> </mo>
- <mo> <xsl:text disable-output-escaping='yes'>&#x2061;</xsl:text> </mo>
- <xsl:apply-templates select = "*[2]" mode = "semantics">
- <xsl:with-param name="IN_PREC" select="$NOT_PREC"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
- </xsl:apply-templates>
- </mrow>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template match = "apply[forall[1]]">
- <mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <mo> <xsl:text disable-output-escaping='yes'>&#x2200;</xsl:text> </mo>
- <xsl:if test="count(bvar)=1">
- <xsl:apply-templates select = "bvar" mode="semantics"/>
- </xsl:if>
- <xsl:if test="count(bvar) > 1">
- <mfenced open="" close="">
- <xsl:for-each select = "bvar">
- <xsl:apply-templates select = "." mode="semantics"/>
- </xsl:for-each>
- </mfenced>
- </xsl:if>
- <xsl:if test="condition">
- <mo> : </mo>
- <xsl:apply-templates select = "condition/*" mode = "semantics"/>
- </xsl:if>
- <xsl:if test="*[position()>1 and not(self::bvar) and not(self::condition)]">
- <mo> , </mo>
- <xsl:apply-templates select = "*[position()>1 and not(self::bvar) and
- not(self::condition)]" mode = "semantics"/>
- </xsl:if>
- </mrow>
- </xsl:template>
- <xsl:template match = "apply[exists[1]]">
- <mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <mo> <xsl:text disable-output-escaping='yes'>&#x2203;</xsl:text> </mo>
- <xsl:if test="count(bvar) > 1">
- <mfenced open="" close="">
- <xsl:for-each select = "bvar">
- <xsl:apply-templates select = "." mode="semantics"/>
- </xsl:for-each>
- </mfenced>
- </xsl:if>
- <xsl:if test="count(bvar)=1">
- <xsl:apply-templates select = "bvar" mode="semantics"/>
- </xsl:if>
- <xsl:if test="condition">
- <mo> : </mo>
- <xsl:apply-templates select = "condition/*" mode = "semantics"/>
- </xsl:if>
- <xsl:if test="*[position()>1 and not(self::bvar) and not(self::condition)]">
- <mo> , </mo>
- <xsl:apply-templates select = "*[position()>1 and not(self::bvar) and
- not(self::condition)]" mode = "semantics"/>
- </xsl:if>
- </mrow>
- </xsl:template>
- <xsl:template match = "apply[abs[1]]">
- <xsl:if test="not(parent::apply[power[1]])">
- <mfenced open="∣" close="∣" separators="">
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select = "*[position()>1]" mode = "semantics"/>
- </mfenced>
- </xsl:if>
- <xsl:if test="parent::apply[power[1]]">
- <msup>
- <mfenced open="∣" close="∣" separators="">
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select = "*[position()>1]" mode = "semantics"/>
- </mfenced>
- <xsl:apply-templates select = "../*[3]" mode = "semantics"/>
- </msup>
- </xsl:if>
- </xsl:template>
- <xsl:template match = "apply[conjugate[1]]">
- <mover>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <mrow>
- <xsl:apply-templates select = "*[position()>1]" mode = "semantics"/>
- </mrow>
- <mo> <xsl:text disable-output-escaping='yes'>&#x00AF;</xsl:text> </mo>
- </mover>
- </xsl:template>
- <xsl:template match = "apply[arg[1] | real[1] | imaginary[1]]">
- <mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <mo>
- <xsl:if test="arg">
- <xsl:value-of select="'arg'"/>
- </xsl:if>
- <xsl:if test="real">
- <xsl:text disable-output-escaping='yes'>&#x211C;</xsl:text>
- </xsl:if>
- <xsl:if test="imaginary">
- <xsl:text disable-output-escaping='yes'>&#x2111;</xsl:text>
- </xsl:if>
- </mo>
- <mo> <xsl:text disable-output-escaping='yes'>&#x2061;</xsl:text> </mo>
- <mfenced separators="">
- <xsl:apply-templates select = "*[2]" mode = "semantics"/>
- </mfenced>
- </mrow>
- </xsl:template>
- <xsl:template match = "apply[floor[1] or ceiling[1]]">
- <mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <mo>
- <xsl:if test="floor[1]">
- <xsl:text disable-output-escaping='yes'>&#x230A;</xsl:text>
- </xsl:if>
- <xsl:if test="ceiling[1]">
- <xsl:text disable-output-escaping='yes'>&#x2308;</xsl:text>
- </xsl:if>
- </mo>
- <xsl:apply-templates select="*[position()>1]" mode="semantics"/>
- <mo>
- <xsl:if test="floor[1]">
- <xsl:text disable-output-escaping='yes'>&#x230B;</xsl:text>
- </xsl:if>
- <xsl:if test="ceiling[1]">
- <xsl:text disable-output-escaping='yes'>&#x2309;</xsl:text>
- </xsl:if>
- </mo>
- </mrow>
- </xsl:template>
- <!-- ***************** RELATIONS ***************** -->
- <xsl:template match = "apply[neq | approx | tendsto | implies
- | in | notin | notsubset | notprsubset
- | subset | prsubset | eq | gt | lt
- | geq | leq | equivalent | factorof]">
- <mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select="." mode="relations"/>
- </mrow>
- </xsl:template>
- <!-- reln is ***DEPRECATED*** -->
- <xsl:template match = "reln[neq | approx | tendsto | implies
- | in | notin | notsubset | notprsubset
- | subset | prsubset | eq | gt | lt
- | geq | leq | equivalent | factorof]">
- <mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select="." mode="relations"/>
- </mrow>
- </xsl:template>
- <xsl:template match = "*" mode="relations">
- <xsl:if test="*[1]=neq or *[1]=approx or *[1]=factorof or *[1]=tendsto or
- *[1]=implies or *[1]=in or *[1]=notin or
- *[1]=notsubset or *[1]=notprsubset">
- <xsl:apply-templates select = "*[2]" mode = "semantics"/>
- <mo>
- <xsl:if test="*[1]=neq">
- <xsl:text disable-output-escaping='yes'>&#x2260;</xsl:text>
- </xsl:if>
- <xsl:if test="*[1]=approx">
- <xsl:text disable-output-escaping='yes'>&#x2248;</xsl:text>
- </xsl:if>
- <xsl:if test="*[1]=factorof">
- <xsl:text disable-output-escaping='yes'>&#x2223;</xsl:text>
- </xsl:if>
- <xsl:if test="*[1]=tendsto">
- <xsl:choose>
- <xsl:when test="tendsto[@type='above']">
- <xsl:text disable-output-escaping='yes'>&#x2198;</xsl:text>
- </xsl:when>
- <xsl:when test="tendsto[@type='below']">
- <xsl:text disable-output-escaping='yes'>&#x2197;</xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text disable-output-escaping='yes'>&#x2192;</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:if>
- <xsl:if test="*[1]=implies">
- <xsl:text disable-output-escaping='yes'>&#x21D2;</xsl:text>
- </xsl:if>
- <xsl:if test="*[1]=in">
- <xsl:text disable-output-escaping='yes'>&#x2208;</xsl:text>
- </xsl:if>
- <xsl:if test="*[1]=notin">
- <xsl:text disable-output-escaping='yes'>&#x2209;</xsl:text>
- </xsl:if>
- <xsl:if test="*[1]=notsubset">
- <xsl:text disable-output-escaping='yes'>&#x2284;</xsl:text>
- </xsl:if>
- <xsl:if test="*[1]=notprsubset">
- <xsl:text disable-output-escaping='yes'>&#x2288;</xsl:text>
- </xsl:if>
- </mo>
- <xsl:apply-templates select = "*[3]" mode = "semantics"/>
- </xsl:if>
- <xsl:if test="*[1]=subset or *[1]=prsubset or *[1]=eq or *[1]=gt
- or *[1]=lt or *[1]=geq or *[1]=leq or *[1]=equivalent">
- <xsl:apply-templates select = "*[2]" mode="semantics"/>
- <xsl:for-each select = "*[position()>2]">
- <mo>
- <xsl:if test="../*[self::subset][1]">
- <xsl:text disable-output-escaping='yes'>&#x2286;</xsl:text>
- </xsl:if>
- <xsl:if test="../*[self::prsubset][1]">
- <xsl:text disable-output-escaping='yes'>&#x2282;</xsl:text>
- </xsl:if>
- <xsl:if test="../*[self::eq][1]">
- <xsl:value-of select="'='"/>
- </xsl:if>
- <xsl:if test="../*[self::gt][1]">
- <xsl:value-of select="'>'"/>
- </xsl:if>
- <xsl:if test="../*[self::lt][1]">
- <xsl:value-of select="'<'"/>
- </xsl:if>
- <xsl:if test="../*[self::geq][1]">
- <xsl:text disable-output-escaping='yes'>&#x2265;</xsl:text>
- </xsl:if>
- <xsl:if test="../*[self::leq][1]">
- <xsl:text disable-output-escaping='yes'>&#x2264;</xsl:text>
- </xsl:if>
- <xsl:if test="../*[self::equivalent][1]">
- <xsl:text disable-output-escaping='yes'>&#x2261;</xsl:text>
- </xsl:if>
- </mo>
- <xsl:apply-templates select = "." mode="semantics"/>
- </xsl:for-each>
- </xsl:if>
- </xsl:template>
- <!-- ***************** CALCULUS ***************** -->
- <xsl:template match = "apply[*[1][self::ln]]">
- <mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:choose>
- <xsl:when test="parent::apply[power[1]]">
- <msup>
- <mo> ln </mo>
- <xsl:apply-templates select = "../*[3]" mode = "semantics"/>
- </msup>
- </xsl:when>
- <xsl:otherwise>
- <mo rspace="thinmathspace"> ln </mo>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:apply-templates select = "*[2]" mode = "semantics">
- <xsl:with-param name="IN_PREC" select="$FUNCTN_PREC"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
- </xsl:apply-templates>
- </mrow>
- </xsl:template>
- <xsl:template match = "apply[log[1]]">
- <mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:choose>
- <xsl:when test="parent::apply[power[1]]">
- <xsl:if test="not(*[2]=logbase)">
- <msup>
- <mo> log </mo>
- <xsl:apply-templates select = "../*[3]" mode = "semantics"/>
- </msup>
- </xsl:if>
- <xsl:if test="*[2]=logbase">
- <msubsup>
- <mo> log </mo>
- <xsl:apply-templates select = "../*[3]" mode = "semantics"/>
- <xsl:apply-templates select = "logbase" mode = "semantics"/>
- </msubsup>
- </xsl:if>
- </xsl:when>
- <xsl:otherwise>
- <xsl:if test="not(*[2]=logbase)">
- <mo rspace="thinmathspace"> log </mo>
- </xsl:if>
- <xsl:if test="*[2]=logbase">
- <msub>
- <mo> log </mo>
- <xsl:apply-templates select = "logbase" mode = "semantics"/>
- </msub>
- </xsl:if>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:if test="*[2]=logbase">
- <xsl:apply-templates select = "*[3]" mode = "semantics">
- <xsl:with-param name="IN_PREC" select="$FUNCTN_PREC"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
- </xsl:apply-templates>
- </xsl:if>
- <xsl:if test="not(*[2]=logbase)">
- <xsl:apply-templates select = "*[2]" mode = "semantics">
- <xsl:with-param name="IN_PREC" select="$FUNCTN_PREC"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
- </xsl:apply-templates>
- </xsl:if>
- </mrow>
- </xsl:template>
- <xsl:template match = "apply[diff[1]]">
- <mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:choose>
- <xsl:when test="bvar">
- <xsl:if test="not(bvar[*[2]=degree])">
- <mfrac>
- <mo> <xsl:text disable-output-escaping='yes'>d</xsl:text> </mo>
- <mrow>
- <mo> <xsl:text disable-output-escaping='yes'>d</xsl:text> </mo>
- <xsl:apply-templates select = "bvar/*[1]" mode = "semantics"/>
- </mrow>
- </mfrac>
- </xsl:if>
- <xsl:if test="bvar[*[2]=degree]">
- <mfrac>
- <msup>
- <mo> <xsl:text disable-output-escaping='yes'>d</xsl:text> </mo>
- <xsl:apply-templates select = "bvar/degree" mode = "semantics"/>
- </msup>
- <mrow>
- <mo> <xsl:text disable-output-escaping='yes'>d</xsl:text> </mo>
- <msup>
- <xsl:apply-templates select = "bvar/*[1]" mode = "semantics"/>
- <xsl:apply-templates select = "bvar/degree" mode = "semantics"/>
- </msup>
- </mrow>
- </mfrac>
- </xsl:if>
- <xsl:apply-templates select = "*[position()=last() and not(self::bvar)]" mode = "semantics">
- <xsl:with-param name="IN_PREC" select="$FUNCTN_PREC"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:otherwise>
- <xsl:apply-templates select = "*[position()=last() and not(self::bvar)]" mode = "semantics">
- <xsl:with-param name="IN_PREC" select="$FUNCTN_PREC"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
- </xsl:apply-templates>
- <mo> <xsl:text disable-output-escaping='yes'>&#x2032;</xsl:text> </mo>
- </xsl:otherwise>
- </xsl:choose>
- </mrow>
- </xsl:template>
- <xsl:template match = "apply[partialdiff[1]]">
- <mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:choose>
- <xsl:when test="list">
- <msub>
- <mo> <xsl:text disable-output-escaping='yes'>&#x2145;</xsl:text> </mo>
- <xsl:apply-templates select = "list" mode = "semantics"/>
- </msub>
- </xsl:when>
- <xsl:otherwise>
- <xsl:if test="degree">
- <mfrac>
- <msup>
- <mo> <xsl:text disable-output-escaping='yes'>&#x2202;</xsl:text> </mo>
- <xsl:apply-templates select = "degree" mode = "semantics"/>
- </msup>
- <mrow>
- <xsl:for-each select = "bvar">
- <mo> <xsl:text disable-output-escaping='yes'>&#x2202;</xsl:text> </mo>
- <xsl:if test="*[last()]=degree">
- <msup>
- <xsl:apply-templates select = "*[1]" mode = "semantics"/>
- <xsl:apply-templates select = "degree" mode = "semantics"/>
- </msup>
- </xsl:if>
- <xsl:if test="not(*[last()]=degree)">
- <xsl:apply-templates select = "*[1]" mode = "semantics"/>
- </xsl:if>
- </xsl:for-each>
- </mrow>
- </mfrac>
- </xsl:if>
- <xsl:if test="not(degree)">
- <xsl:for-each select = "bvar">
- <xsl:if test="*[last()]=degree">
- <mfrac>
- <msup>
- <mo> <xsl:text disable-output-escaping='yes'>&#x2202;</xsl:text> </mo>
- <xsl:apply-templates select = "degree" mode = "semantics"/>
- </msup>
- <mrow>
- <mo> <xsl:text disable-output-escaping='yes'>&#x2202;</xsl:text> </mo>
- <msup>
- <xsl:apply-templates select = "*[1]" mode = "semantics"/>
- <xsl:apply-templates select = "degree" mode = "semantics"/>
- </msup>
- </mrow>
- </mfrac>
- </xsl:if>
- <xsl:if test="not(*[last()]=degree)">
- <mfrac>
- <mo> <xsl:text disable-output-escaping='yes'>&#x2202;</xsl:text> </mo>
- <mrow>
- <mo> <xsl:text disable-output-escaping='yes'>&#x2202;</xsl:text> </mo>
- <xsl:apply-templates select = "*[1]" mode = "semantics"/>
- </mrow>
- </mfrac>
- </xsl:if>
- </xsl:for-each>
- </xsl:if>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:apply-templates select = "*[last()]" mode = "semantics">
- <xsl:with-param name="IN_PREC" select="$GEN_FUN_PREC"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
- </xsl:apply-templates>
- </mrow>
- </xsl:template>
- <xsl:template match = "lowlimit | uplimit | bvar | degree | logbase">
- <mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select="*" mode = "semantics"/>
- </mrow>
- </xsl:template>
- <xsl:template match = "apply[divergence[1] | grad[1] | curl[1]]">
- <mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <mo>
- <xsl:if test="*[1]=divergence">
- <xsl:value-of select="'div'"/>
- </xsl:if>
- <xsl:if test="*[1]=grad">
- <xsl:value-of select="'grad'"/>
- </xsl:if>
- <xsl:if test="*[1]=curl">
- <xsl:value-of select="'curl'"/>
- </xsl:if>
- </mo>
- <mspace width="0.01em" linebreak="nobreak"/>
- <xsl:choose>
- <xsl:when test="*[2]=ci">
- <xsl:apply-templates select = "*[2]" mode = "semantics"/>
- </xsl:when>
- <xsl:otherwise>
- <mfenced separators="">
- <xsl:apply-templates select = "*[2]" mode = "semantics"/>
- </mfenced>
- </xsl:otherwise>
- </xsl:choose>
- </mrow>
- </xsl:template>
- <xsl:template match = "apply[laplacian[1]]">
- <mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <msup>
- <mo> <xsl:text disable-output-escaping='yes'>&#x2207;</xsl:text> </mo>
- <mn> 2 </mn>
- </msup>
- <mo> <xsl:text disable-output-escaping='yes'>&#x2061;</xsl:text> </mo>
- <xsl:apply-templates select = "*[2]" mode = "semantics">
- <xsl:with-param name="IN_PREC" select="$GEN_FUN_PREC"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
- </xsl:apply-templates>
- </mrow>
- </xsl:template>
- <!-- ***************** SET THEORY ***************** -->
- <xsl:template match = "set | list">
- <mfenced>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:if test="self::set">
- <xsl:attribute name="open">
- <xsl:value-of select="'{'"/>
- </xsl:attribute>
- <xsl:attribute name="close">
- <xsl:value-of select="'}'"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:if test="self::list">
- <xsl:attribute name="open">
- <xsl:value-of select="'['"/>
- </xsl:attribute>
- <xsl:attribute name="close">
- <xsl:value-of select="']'"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:choose>
- <xsl:when test="not(child::bvar) and not(child::condition)">
- <xsl:apply-templates select = "*" mode="semantics"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:attribute name="separators"/>
- <xsl:apply-templates select = "*[not(self::condition) and not(self::bvar)]" mode="semantics"/>
- <mo lspace="0.1666em" rspace="0.1666em"> | </mo>
- <xsl:apply-templates select="condition" mode = "semantics"/>
- </xsl:otherwise>
- </xsl:choose>
- </mfenced>
- </xsl:template>
- <xsl:template match = "apply[union[1]]">
- <xsl:param name="IN_PREC" select="$NO_PREC"/>
- <xsl:param name="PARAM" select="$NO_PARAM"/>
- <xsl:param name="PAREN" select="$PAR_NO"/>
- <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
- <xsl:choose>
- <xsl:when test="$IN_PREC > $UNION_PREC or $IN_PREC=$UNION_PREC
- and $PARAM=$PAR_SAME">
- <mfenced separators="">
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select="." mode="union">
- <xsl:with-param name="PARAM" select="$PARAM"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- </mfenced>
- </xsl:when>
- <xsl:when test="$IN_PREC > $NO_PREC and $IN_PREC < $GEN_FUN_PREC
- and not($SEM_SW=$SEM_ALL) and not($SEM_SW=$SEM_XREF)
- and not($SEM_SW=$SEM_XREF_EXT)">
- <xsl:apply-templates select="." mode="union">
- <xsl:with-param name="PARAM" select="$PARAM"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:otherwise>
- <mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select="." mode="union">
- <xsl:with-param name="PARAM" select="$PARAM"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- </mrow>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template match = "apply[union[1]]" mode="union">
- <xsl:param name="PARAM" select="$NO_PARAM"/>
- <xsl:param name="PAREN" select="$PAR_NO"/>
- <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
- <xsl:apply-templates select = "*[2]" mode="semantics">
- <xsl:with-param name="IN_PREC" select="$UNION_PREC"/>
- <xsl:with-param name="PARAM" select="$PARAM"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- <xsl:for-each select = "*[position()>2]">
- <mo> <xsl:text disable-output-escaping='yes'>&#x222A;</xsl:text> </mo>
- <xsl:apply-templates select = "." mode="semantics">
- <xsl:with-param name="IN_PREC" select="$UNION_PREC"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
- </xsl:apply-templates>
- </xsl:for-each>
- </xsl:template>
- <xsl:template match = "apply[intersect[1]]">
- <xsl:param name="IN_PREC" select="$NO_PREC"/>
- <xsl:param name="PARAM" select="$NO_PARAM"/>
- <xsl:param name="PAREN" select="$PAR_NO"/>
- <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
- <xsl:choose>
- <xsl:when test="$IN_PREC > $INTERSECT_PREC or $IN_PREC=$INTERSECT_PREC
- and $PARAM=$PAR_SAME">
- <mfenced separators="">
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select="." mode="intersect">
- <xsl:with-param name="PARAM" select="$PARAM"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- </mfenced>
- </xsl:when>
- <xsl:when test="$IN_PREC > $NO_PREC and $IN_PREC < $GEN_FUN_PREC
- and not($SEM_SW=$SEM_ALL) and not($SEM_SW=$SEM_XREF)
- and not($SEM_SW=$SEM_XREF_EXT)">
- <xsl:apply-templates select="." mode="intersect">
- <xsl:with-param name="PARAM" select="$PARAM"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:otherwise>
- <mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select="." mode="intersect">
- <xsl:with-param name="PARAM" select="$PARAM"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- </mrow>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template match = "apply[intersect[1]]" mode="intersect">
- <xsl:param name="PARAM" select="$NO_PARAM"/>
- <xsl:param name="PAREN" select="$PAR_NO"/>
- <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
- <xsl:apply-templates select = "*[2]" mode="semantics">
- <xsl:with-param name="IN_PREC" select="$INTERSECT_PREC"/>
- <xsl:with-param name="PARAM" select="$PARAM"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- <xsl:for-each select = "*[position()>2]">
- <mo> <xsl:text disable-output-escaping='yes'>&#x2229;</xsl:text> </mo>
- <xsl:apply-templates select = "." mode="semantics">
- <xsl:with-param name="IN_PREC" select="$INTERSECT_PREC"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
- </xsl:apply-templates>
- </xsl:for-each>
- </xsl:template>
- <xsl:template match = "apply[setdiff[1]]">
- <xsl:param name="IN_PREC" select="$NO_PREC"/>
- <xsl:param name="PARAM" select="$NO_PARAM"/>
- <xsl:param name="PAREN" select="$PAR_NO"/>
- <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
- <xsl:choose>
- <xsl:when test="$IN_PREC > $SETDIFF_PREC or $IN_PREC=$SETDIFF_PREC
- and $PARAM=$PAR_SAME">
- <mfenced separators="">
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select="." mode="setdiff">
- <xsl:with-param name="PARAM" select="$PARAM"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- </mfenced>
- </xsl:when>
- <xsl:when test="$IN_PREC > $NO_PREC and $IN_PREC < $GEN_FUN_PREC
- and not($SEM_SW=$SEM_ALL) and not($SEM_SW=$SEM_XREF)
- and not($SEM_SW=$SEM_XREF_EXT)">
- <xsl:apply-templates select="." mode="setdiff">
- <xsl:with-param name="PARAM" select="$PARAM"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:otherwise>
- <mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select="." mode="setdiff">
- <xsl:with-param name="PARAM" select="$PARAM"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- </mrow>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template match = "apply[setdiff[1]]" mode="setdiff">
- <xsl:param name="PARAM" select="$NO_PARAM"/>
- <xsl:param name="PAREN" select="$PAR_NO"/>
- <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
- <xsl:apply-templates select = "*[2]" mode = "semantics">
- <xsl:with-param name="IN_PREC" select="$SETDIFF_PREC"/>
- <xsl:with-param name="PARAM" select="$PARAM"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- <mo>\</mo>
- <xsl:apply-templates select = "*[3]" mode = "semantics">
- <xsl:with-param name="IN_PREC" select="$SETDIFF_PREC"/>
- <xsl:with-param name="PARAM" select="$PAR_SAME"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
- </xsl:apply-templates>
- </xsl:template>
- <xsl:template match = "apply[cartesianproduct[1]]">
- <xsl:param name="IN_PREC" select="$NO_PREC"/>
- <xsl:param name="PARAM" select="$NO_PARAM"/>
- <xsl:param name="PAREN" select="$PAR_NO"/>
- <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
- <xsl:choose>
- <xsl:when test="$IN_PREC > $CARTPROD_PREC or $IN_PREC=$CARTPROD_PREC
- and $PARAM=$PAR_SAME">
- <mfenced separators="">
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select="." mode="cartprod">
- <xsl:with-param name="PARAM" select="$PARAM"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- </mfenced>
- </xsl:when>
- <xsl:when test="$IN_PREC > $NO_PREC and $IN_PREC < $GEN_FUN_PREC
- and not($SEM_SW=$SEM_ALL) and not($SEM_SW=$SEM_XREF)
- and not($SEM_SW=$SEM_XREF_EXT)">
- <xsl:apply-templates select="." mode="cartprod">
- <xsl:with-param name="PARAM" select="$PARAM"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- </xsl:when>
- <xsl:otherwise>
- <mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select="." mode="cartprod">
- <xsl:with-param name="PARAM" select="$PARAM"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- </mrow>
- </xsl:otherwise>
- </xsl:choose>
- </xsl:template>
- <xsl:template match = "*" mode="cartprod">
- <xsl:param name="PARAM" select="$NO_PARAM"/>
- <xsl:param name="PAREN" select="$PAR_NO"/>
- <xsl:param name="PAR_NO_IGNORE" select="$YES"/>
- <xsl:apply-templates select = "*[2]" mode = "semantics">
- <xsl:with-param name="IN_PREC" select="$CARTPROD_PREC"/>
- <xsl:with-param name="PARAM" select="$PARAM"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$PAR_NO_IGNORE"/>
- </xsl:apply-templates>
- <xsl:for-each select = "*[position()>2]">
- <mo><xsl:text disable-output-escaping='yes'>&#x00D7;</xsl:text></mo>
- <xsl:apply-templates select = "." mode="semantics">
- <xsl:with-param name="IN_PREC" select="$CARTPROD_PREC"/>
- <xsl:with-param name="PARAM" select="$PAR_SAME"/>
- <xsl:with-param name="PAREN" select="$PAREN"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
- </xsl:apply-templates>
- </xsl:for-each>
- </xsl:template>
- <xsl:template match = "apply[card[1]]">
- <mfenced open="∣" close="∣" separators=",">
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:for-each select = "*[position()>1]">
- <xsl:apply-templates select = "." mode="semantics"/>
- </xsl:for-each>
- </mfenced>
- </xsl:template>
- <!-- ***************** SEQUENCES AND SERIES ***************** -->
- <xsl:template match = "apply[sum[1] | product[1]]">
- <mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:choose>
- <xsl:when test="*[2]=bvar and lowlimit and uplimit">
- <munderover>
- <mo>
- <xsl:if test="*[1]=sum">
- <xsl:text disable-output-escaping='yes'>&#x2211;</xsl:text>
- </xsl:if>
- <xsl:if test="*[1]=product">
- <xsl:text disable-output-escaping='yes'>&#x220F;</xsl:text>
- </xsl:if>
- </mo>
- <mrow>
- <xsl:apply-templates select = "*[2]" mode = "semantics"/>
- <mo> = </mo>
- <xsl:apply-templates select = "lowlimit" mode = "semantics"/>
- </mrow>
- <xsl:apply-templates select = "uplimit" mode = "semantics"/>
- </munderover>
- <xsl:apply-templates select = "*[5]" mode = "semantics"/>
- </xsl:when>
- <xsl:when test="*[2]=bvar and *[3]=condition">
- <munder>
- <mo>
- <xsl:if test="*[1]=sum">
- <xsl:text disable-output-escaping='yes'>&#x2211;</xsl:text>
- </xsl:if>
- <xsl:if test="*[1]=product">
- <xsl:text disable-output-escaping='yes'>&#x220F;</xsl:text>
- </xsl:if>
- </mo>
- <xsl:apply-templates select = "*[3]" mode = "semantics"/>
- </munder>
- <xsl:apply-templates select = "*[4]" mode = "semantics"/>
- </xsl:when>
- <xsl:when test="*[2]=domainofapplication">
- <munder>
- <mo>
- <xsl:if test="*[1]=sum">
- <xsl:text disable-output-escaping='yes'>&#x2211;</xsl:text>
- </xsl:if>
- <xsl:if test="*[1]=product">
- <xsl:text disable-output-escaping='yes'>&#x220F;</xsl:text>
- </xsl:if>
- </mo>
- <xsl:apply-templates select="domainofapplication" mode = "semantics"/>
- </munder>
- <mrow>
- <xsl:apply-templates select="*[position()=last()]" mode = "semantics"/>
- </mrow>
- </xsl:when>
- </xsl:choose>
- </mrow>
- </xsl:template>
- <xsl:template match="apply[*[1][self::int]]">
- <mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:choose>
- <xsl:when test="domainofapplication">
- <munder>
- <mo> <xsl:text disable-output-escaping='yes'>&#x222B;</xsl:text> </mo>
- <xsl:apply-templates select="domainofapplication" mode="semantics"/>
- </munder>
- </xsl:when>
- <xsl:when test="condition">
- <munder>
- <mo> <xsl:text disable-output-escaping='yes'>&#x222B;</xsl:text> </mo>
- <xsl:apply-templates select="condition" mode="semantics"/>
- </munder>
- </xsl:when>
- <xsl:when test="interval">
- <munderover>
- <mo> <xsl:text disable-output-escaping='yes'>&#x222B;</xsl:text> </mo>
- <mrow>
- <xsl:apply-templates select="interval/*[position()=1]" mode="semantics"/>
- </mrow>
- <mrow>
- <mspace width="1em"/>
- <xsl:apply-templates select="interval/*[position()=2]" mode="semantics"/>
- </mrow>
- </munderover>
- </xsl:when>
- <xsl:when test="lowlimit | uplimit">
- <munderover>
- <mo> <xsl:text disable-output-escaping='yes'>&#x222B;</xsl:text> </mo>
- <xsl:apply-templates select="lowlimit" mode="semantics"/>
- <mrow>
- <mspace width="1em"/>
- <xsl:apply-templates select="uplimit" mode="semantics"/>
- </mrow>
- </munderover>
- </xsl:when>
- <xsl:otherwise>
- <mo> <xsl:text disable-output-escaping='yes'>&#x222B;</xsl:text> </mo>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:apply-templates select="*[position()=last() and last()>1 and not(self::domainofapplication) and not(self::condition) and not(self::interval) and not(self::lowlimit) and not(self::uplimit) and not(self::bvar)]" mode="semantics">
- <xsl:with-param name="IN_PREC" select="$FUNCTN_PREC"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
- </xsl:apply-templates>
- <xsl:if test="bvar">
- <mrow>
- <mo> <xsl:text disable-output-escaping='yes'>d</xsl:text> </mo>
- <xsl:apply-templates select="bvar" mode="semantics"/>
- </mrow>
- </xsl:if>
- </mrow>
- </xsl:template>
- <xsl:template match = "apply[limit[1]]">
- <mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <munder>
- <mo> lim </mo>
- <mrow>
- <xsl:if test="*[2]=bvar and *[3]=lowlimit">
- <xsl:apply-templates select = "*[2]" mode = "semantics"/>
- <mo> <xsl:text disable-output-escaping='yes'>&#x2192;</xsl:text> </mo>
- <xsl:apply-templates select = "*[3]" mode = "semantics"/>
- </xsl:if>
- <xsl:if test="*[2]=bvar and *[3]=condition">
- <xsl:apply-templates select = "*[3]" mode = "semantics"/>
- </xsl:if>
- </mrow>
- </munder>
- <xsl:apply-templates select = "*[4]" mode = "semantics"/>
- </mrow>
- </xsl:template>
- <!-- ***************** TRIGONOMETRY ***************** -->
- <xsl:template match = "apply[*[1][self::sin | self::cos |
- self::tan | self::sec | self::csc |
- self::cot | self::sinh | self::cosh |
- self::tanh | self::sech | self::csch |
- self::coth | self::arcsin | self::arccos |
- self::arctan | self::arcsec | self::arccsc |
- self::arccot | self::arcsinh | self::arccosh |
- self::arctanh | self::arcsech | self::arccsch |
- self::arccoth]]">
- <mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:if test="not(parent::apply[power[1]])">
- <xsl:apply-templates select = "*[1]" mode = "trigonometry"/>
- </xsl:if>
- <xsl:if test="parent::apply[power[1]]">
- <msup>
- <xsl:apply-templates select = "*[1]" mode = "trigonometry"/>
- <xsl:apply-templates select = "../*[3]" mode = "semantics"/>
- </msup>
- </xsl:if>
- <mspace width="0.01em" linebreak="nobreak"/>
- <xsl:apply-templates select = "*[2]" mode = "semantics">
- <xsl:with-param name="IN_PREC" select="$FUNCTN_PREC"/>
- <xsl:with-param name="PAR_NO_IGNORE" select="$NO"/>
- </xsl:apply-templates>
- </mrow>
- </xsl:template>
- <xsl:template match = "sin | cos |
- tan | sec | csc |
- cot | sinh | cosh |
- tanh | sech | csch |
- coth | arcsin | arccos |
- arctan | arcsec | arccsc |
- arccot | arcsinh | arccosh |
- arctanh | arcsech | arccsch |
- arccoth">
- <xsl:apply-templates select = "." mode = "trigonometry"/>
- </xsl:template>
- <xsl:template match = "*" mode="trigonometry">
- <mo>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:choose>
- <xsl:when test="self::sin">
- <xsl:value-of select="'sin'"/>
- </xsl:when>
- <xsl:when test="self::cos">
- <xsl:value-of select="'cos'"/>
- </xsl:when>
- <xsl:when test="self::tan">
- <xsl:value-of select="'tan'"/>
- </xsl:when>
- <xsl:when test="self::sec">
- <xsl:value-of select="'sec'"/>
- </xsl:when>
- <xsl:when test="self::csc">
- <xsl:value-of select="'csc'"/>
- </xsl:when>
- <xsl:when test="self::cot">
- <xsl:value-of select="'cot'"/>
- </xsl:when>
- <xsl:when test="self::sinh">
- <xsl:value-of select="'sinh'"/>
- </xsl:when>
- <xsl:when test="self::cosh">
- <xsl:value-of select="'cosh'"/>
- </xsl:when>
- <xsl:when test="self::tanh">
- <xsl:value-of select="'tanh'"/>
- </xsl:when>
- <xsl:when test="self::sech">
- <xsl:value-of select="'sech'"/>
- </xsl:when>
- <xsl:when test="self::csch">
- <xsl:value-of select="'csch'"/>
- </xsl:when>
- <xsl:when test="self::coth">
- <xsl:value-of select="'coth'"/>
- </xsl:when>
- <xsl:when test="self::arcsin">
- <xsl:value-of select="'arcsin'"/>
- </xsl:when>
- <xsl:when test="self::arccos">
- <xsl:value-of select="'arccos'"/>
- </xsl:when>
- <xsl:when test="self::arctan">
- <xsl:value-of select="'arctan'"/>
- </xsl:when>
- <xsl:when test="self::arcsec">
- <xsl:value-of select="'arcsec'"/>
- </xsl:when>
- <xsl:when test="self::arccsc">
- <xsl:value-of select="'arccsc'"/>
- </xsl:when>
- <xsl:when test="self::arccot">
- <xsl:value-of select="'arccot'"/>
- </xsl:when>
- <xsl:when test="self::arcsinh">
- <xsl:value-of select="'arcsinh'"/>
- </xsl:when>
- <xsl:when test="self::arccosh">
- <xsl:value-of select="'arccosh'"/>
- </xsl:when>
- <xsl:when test="self::arctanh">
- <xsl:value-of select="'arctanh'"/>
- </xsl:when>
- <xsl:when test="self::arcsech">
- <xsl:value-of select="'arcsech'"/>
- </xsl:when>
- <xsl:when test="self::arccsch">
- <xsl:value-of select="'arccsch'"/>
- </xsl:when>
- <xsl:when test="self::arccoth">
- <xsl:value-of select="'arccot'"/>
- </xsl:when>
- </xsl:choose>
- </mo>
- </xsl:template>
- <!-- ***************** STATISTICS ***************** -->
- <xsl:template match = "apply[mean[1]]">
- <mfenced open="〈" close="〉" separators=",">
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:for-each select = "*[position()>1]">
- <xsl:apply-templates select = "." mode="semantics"/>
- </xsl:for-each>
- </mfenced>
- </xsl:template>
- <xsl:template match = "apply[sdev[1]]">
- <mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <mo> <xsl:text disable-output-escaping='yes'>&#x03C3;</xsl:text> </mo>
- <mfenced separators=",">
- <xsl:for-each select = "*[position()>1]">
- <xsl:apply-templates select = "." mode="semantics"/>
- </xsl:for-each>
- </mfenced>
- </mrow>
- </xsl:template>
- <xsl:template match = "apply[variance[1]]">
- <mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <mo> <xsl:text disable-output-escaping='yes'>&#x03C3;</xsl:text> </mo>
- <msup>
- <mfenced separators=",">
- <xsl:for-each select = "*[position()>1]">
- <xsl:apply-templates select = "." mode="semantics"/>
- </xsl:for-each>
- </mfenced>
- <mn> 2 </mn>
- </msup>
- </mrow>
- </xsl:template>
- <xsl:template match = "apply[median[1]]">
- <mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <mo> median </mo>
- <mfenced separators=",">
- <xsl:for-each select = "*[position()>1]">
- <xsl:apply-templates select = "." mode="semantics"/>
- </xsl:for-each>
- </mfenced>
- </mrow>
- </xsl:template>
- <xsl:template match = "apply[mode[1]]">
- <mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <mo> mode </mo>
- <mfenced separators=",">
- <xsl:for-each select = "*[position()>1]">
- <xsl:apply-templates select = "." mode="semantics"/>
- </xsl:for-each>
- </mfenced>
- </mrow>
- </xsl:template>
- <xsl:template match = "apply[moment[1]]">
- <mfenced open="〈" close="〉" separators="">
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:if test="*[2]=degree and not(*[3]=momentabout)">
- <msup>
- <xsl:apply-templates select="*[3]" mode = "semantics"/>
- <xsl:apply-templates select="*[2]" mode = "semantics"/>
- </msup>
- </xsl:if>
- <xsl:if test="*[2]=degree and *[3]=momentabout">
- <msup>
- <xsl:apply-templates select="*[4]" mode = "semantics"/>
- <xsl:apply-templates select="*[2]" mode = "semantics"/>
- </msup>
- </xsl:if>
- <xsl:if test="not(*[2]=degree) and *[2]=momentabout">
- <xsl:for-each select = "*[position()>2]">
- <xsl:apply-templates select = "." mode="semantics"/>
- </xsl:for-each>
- </xsl:if>
- <xsl:if test="not(*[2]=degree) and not(*[2]=momentabout)">
- <xsl:for-each select = "*[position()>1]">
- <xsl:apply-templates select = "." mode="semantics"/>
- </xsl:for-each>
- </xsl:if>
- </mfenced>
- </xsl:template>
- <!-- ***************** LINEAR ALGEBRA ***************** -->
- <xsl:template match="vector">
- <mfenced separators="">
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <mtable columnalign="center">
- <xsl:for-each select="*">
- <mtr>
- <mtd> <xsl:apply-templates select="." mode = "semantics"/> </mtd>
- </mtr>
- </xsl:for-each>
- </mtable>
- </mfenced>
- </xsl:template>
- <xsl:template match = "matrix">
- <mfenced separators="">
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <mtable>
- <xsl:apply-templates mode = "semantics"/>
- </mtable>
- </mfenced>
- </xsl:template>
- <xsl:template match = "matrixrow">
- <mtr>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:for-each select="*">
- <mtd>
- <xsl:apply-templates select="." mode = "semantics"/>
- </mtd>
- </xsl:for-each>
- </mtr>
- </xsl:template>
- <xsl:template match = "apply[determinant[1]]">
- <mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <mo> det </mo>
- <mspace width="0.2em" linebreak="nobreak"/>
- <xsl:apply-templates select = "*[2]" mode = "semantics"/>
- </mrow>
- </xsl:template>
- <xsl:template match = "apply[transpose[1]]">
- <msup>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select = "*[2]" mode = "semantics"/>
- <mo> T </mo>
- </msup>
- </xsl:template>
- <xsl:template match = "apply[selector[1]]">
- <msub>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select="*[2]" mode = "semantics"/>
- <mfenced open="" close="">
- <xsl:for-each select="*[position()>2]">
- <xsl:apply-templates select="." mode = "semantics"/>
- </xsl:for-each>
- </mfenced>
- </msub>
- </xsl:template>
- <xsl:template match = "apply[vectorproduct[1] |
- scalarproduct[1] | outerproduct[1]]">
- <mrow>
- <xsl:if test="($SEM_SW=$SEM_XREF or $SEM_SW=$SEM_XREF_EXT) and @id">
- <xsl:attribute name="xref">
- <xsl:value-of select="@id"/>
- </xsl:attribute>
- </xsl:if>
- <xsl:apply-templates select="*[2]" mode = "semantics"/>
- <mo>
- <xsl:if test="vectorproduct[1]">
- <xsl:text disable-output-escaping='yes'>&#x00D7;</xsl:text>
- </xsl:if>
- <xsl:if test="scalarproduct[1]">
- <xsl:text disable-output-escaping='yes'>&#x22C5;</xsl:text>
- </xsl:if>
- <xsl:if test="outerproduct[1]">
- <xsl:text disable-output-escaping='yes'>&#x2297;</xsl:text>
- </xsl:if>
- </mo>
- <xsl:apply-templates select="*[3]" mode = "semantics"/>
- </mrow>
- </xsl:template>
- <!-- ***************** CONSTANT and SYMBOL ELEMENTS ***************** -->
- <xsl:template match="integers">
- <mo> <xsl:text disable-output-escaping='yes'>&#x2124;</xsl:text> </mo>
- </xsl:template>
- <xsl:template match="reals">
- <mo> <xsl:text disable-output-escaping='yes'>&#x211D;</xsl:text> </mo>
- </xsl:template>
- <xsl:template match="rationals">
- <mo> <xsl:text disable-output-escaping='yes'>&#x211A;</xsl:text> </mo>
- </xsl:template>
- <xsl:template match="naturalnumbers">
- <mo> <xsl:text disable-output-escaping='yes'>&#x2115;</xsl:text> </mo>
- </xsl:template>
- <xsl:template match="complexes">
- <mo> <xsl:text disable-output-escaping='yes'>&#x2102;</xsl:text> </mo>
- </xsl:template>
- <xsl:template match="primes">
- <mo> <xsl:text disable-output-escaping='yes'>&#x2119;</xsl:text> </mo>
- </xsl:template>
- <xsl:template match="exponentiale">
- <mn> <xsl:text disable-output-escaping='yes'>e</xsl:text> </mn>
- </xsl:template>
- <xsl:template match="imaginaryi">
- <mn> <xsl:text disable-output-escaping='yes'>&#x2148;</xsl:text> </mn>
- </xsl:template>
- <xsl:template match="notanumber">
- <mo> NaN </mo>
- </xsl:template>
- <xsl:template match="true">
- <mo> true </mo>
- </xsl:template>
- <xsl:template match="false">
- <mo> false </mo>
- </xsl:template>
- <xsl:template match="emptyset">
- <mo> <xsl:text disable-output-escaping='yes'>&#x2205;</xsl:text> </mo>
- </xsl:template>
- <xsl:template match="pi">
- <mn> <xsl:text disable-output-escaping='yes'>&#x03C0;</xsl:text> </mn>
- </xsl:template>
- <xsl:template match="eulergamma">
- <mo> <xsl:text disable-output-escaping='yes'>&#x213D;</xsl:text> </mo>
- </xsl:template>
- <xsl:template match="infinity">
- <mo> <xsl:text disable-output-escaping='yes'>&#x221E;</xsl:text> </mo>
- </xsl:template>
- </xsl:stylesheet>
|