summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/context/base/x-mathml.mkiv
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/context/base/x-mathml.mkiv')
-rw-r--r--Master/texmf-dist/tex/context/base/x-mathml.mkiv304
1 files changed, 136 insertions, 168 deletions
diff --git a/Master/texmf-dist/tex/context/base/x-mathml.mkiv b/Master/texmf-dist/tex/context/base/x-mathml.mkiv
index a5245c83588..44e2b7432f5 100644
--- a/Master/texmf-dist/tex/context/base/x-mathml.mkiv
+++ b/Master/texmf-dist/tex/context/base/x-mathml.mkiv
@@ -21,7 +21,9 @@
\startmodule [mathml]
-\ctxloadluafile{x-mathml}{}
+\registerctxluafile{x-mathml}{}
+
+\def\ctxmodulemathml#1{\directlua\zerocount{moduledata.mathml.#1}}
\startxmlsetups xml:mml:define
\xmlsetsetup{\xmldocument} {(formula|subformula)} {mml:formula}
@@ -327,7 +329,7 @@
\startxmlsetups mml:apply:mml:fn
\xmldoifelse {#1} {/mml:ci} {
- \edef\mmlfnci{\xmlcontent{#1}{/mml:ci}}% replaces \XMLfnoperator
+ \edef\mmlfnci{\xmlcontent{#1}{/mml:ci}}%
\doifsetupselse{mml:fn:\mmlfnci} { % was mmc:fn:...
\xmlsetup{#1}{mml:fn:\mmlfnci} % \MMLdoL/MMLdoR to be handled in plugin
} {
@@ -391,12 +393,12 @@
\let\MMCfnright\relax
\fi
\xmldoifelse {#1} {/mml:ci} { % first
- \edef\mmlfnci{\xmlcontent{#1}{/mml:ci}}% replaces \XMLfnoperator
+ \edef\mmlfnci{\xmlcontent{#1}{/mml:ci}}%
\doifsetupselse{mml:fn:\mmlfnci} { % was mmc:fn:...
\xmlsetup{#1}{mml:fn:\mmlfnci} % \MMLdoL/MMLdoR to be handled in plugin
} {
\MMLcreset
- \getXMLstackdata\plusone
+ \mmlfirst{#1}
}
} {
\xmldoifelse {#1} {/mml:apply} { % first
@@ -422,7 +424,7 @@
\startxmlsetups mmc:fn:apply % where used?
\xmldoifelse {#1} {/mml:ci} { % first
- \edef\mmlfnci{\xmlcontent{#1}{/mml:ci}}% replaces \XMLfnoperator
+ \edef\mmlfnci{\xmlcontent{#1}{/mml:ci}}%
\doifsetupselse{mml:fn:\mmlfnci} { % was mmc:fn:...
\xmlsetup{#1}{mml:fn:\mmlfnci} % \MMLdoL/MMLdoR to be handled in plugin
} {
@@ -465,7 +467,7 @@
\stoptexdefinition
\startxmlsetups mml:csymbol
- \ctxlua{lxml.mml.csymbol("#1")}
+ \ctxmodulemathml{csymbol("#1")}
\stopxmlsetups
\startxmlsetups mml:csymbol:cdots
@@ -475,22 +477,6 @@
% \startxmlsetups mml:csymbol:<url> \stopxmlsetups
%D Alternative b will convert periods into comma's:
-%D
-%D \startbuffer
-%D \startXMLdata
-%D <imath><apply><cn>1.23</cn></apply></imath>
-%D <dmath><apply><cn>1.23</cn></apply></dmath>
-%D \stopXMLdata
-%D
-%D \type{\setupMMLappearance[cn] [alternative=b]}
-%D
-%D \startXMLdata
-%D <imath><apply><cn>1.23</cn></apply></imath>
-%D <dmath><apply><cn>1.23</cn></apply></dmath>
-%D \stopXMLdata
-%D \stopbuffer
-%D
-%D \start \typebuffer \getbuffer \stop
\setupMMLappearance[cn] [\c!alternative=\v!a]
\setupMMLappearance[polar] [\c!alternative=\v!a] % a|b|c
@@ -564,7 +550,7 @@
\doifelse \MMLbasesymbol \v!no {
\MMLcCNbasedata{\xmlflush{#1}}
} {
- \MMLcCNbasedata{\xmlflush{#1}}_{
+ \MMLcCNbasedata{\xmlflush{#1}}\normalsubscript{
\hbox {$
\mr
\scriptscriptstyle
@@ -599,13 +585,11 @@
\stopxmlsetups
\startxmlsetups mml:cn:polar:b
-% {\mr e}^{\xmlsnippet{#1}{1}\mskip2mu\getXMLentity{imaginaryi}}
- {\mr e}^{\xmlsnippet{#1}{1}+\xmlsnippet{#1}{3}\thinspace{\mr i}}
+ {\mr e}\normalsuperscript{\xmlsnippet{#1}{1}+\xmlsnippet{#1}{3}\thinspace{\mr i}}
\stopxmlsetups
\startxmlsetups mml:cn:polar:c
-% \exp\left(\xmlsnippet{#1}{1}\mskip2mu\getXMLentity{imaginaryi}\right)}
- \exp\left(\xmlsnippet{#1}{1}+\xmlsnippet{#1}{3}\thinspace\getXMLentity{imaginaryi}\right)
+ \exp\left(\xmlsnippet{#1}{1}+\xmlsnippet{#1}{3}\thinspace{\mr i}\right)
\stopxmlsetups
\startxmlsetups mml:cn:complex-polar
@@ -635,7 +619,7 @@
\else
\first
\doifelse \MMLfloatsymbol {dot} \cdot \times
- 10^{\last}
+ 10\normalsuperscript{\last}
\fi \fi
}
\stopxmlsetups
@@ -652,7 +636,7 @@
} {
\xmlsnippet{#1}{1}
\doifelse \MMLenotationsymbol {dot} \cdot
- \times10^{\xmlsnippet{#1}{3}}
+ \times10\normalsuperscript{\xmlsnippet{#1}{3}}
}
\stopxmlsetups
@@ -860,7 +844,7 @@
\startxmlsetups mml:minmax
\xmldoif {#1} {/mml:bvar} {
- {}_{\xmlfirst{#1}{/mml:bvar}}
+ {}\normalsubscript{\xmlfirst{#1}{/mml:bvar}}
}
\left\{
\xmlconcat{#1}{/!(mml:bvar\string|mml:max\string|mml:min)}{\MMLseparator,}
@@ -969,13 +953,13 @@
\gdef\MMLpowerelement{\mmlthird{#1}}% postpone, no xdef
\MMLcreset\mmlsecond{#1}
} {
- \left(\MMLcreset\mmlsecond{#1}\right)^{\MMLcreset\mmlthird{#1}}
+ \left(\MMLcreset\mmlsecond{#1}\right)\normalsuperscript{\MMLcreset\mmlthird{#1}}
}
} {
- \left(\MMLcreset\mmlsecond{#1}\right)^{\MMLcreset\mmlthird{#1}}
+ \left(\MMLcreset\mmlsecond{#1}\right)\normalsuperscript{\MMLcreset\mmlthird{#1}}
}
} {
- \mmlsecond{#1}^{\MMLcreset\mmlthird{#1}}
+ \mmlsecond{#1}\normalsuperscript{\MMLcreset\mmlthird{#1}}
}
\stopxmlsetups
@@ -1061,7 +1045,7 @@
\def\mmlforallexistslist{mml:bvar\string|mml:forall\string|mml:exists\string|mml:condition}
\startxmlsetups mml:forallexists
- _{\xmlconcat{#1}{/mml:bvar}{\MMLseparator,}}
+ \normalsubscript{\xmlconcat{#1}{/mml:bvar}{\MMLseparator,}}
\xmldoifelse {#1} {/mml:condition} {
\thickspace
\begingroup
@@ -1203,17 +1187,17 @@
\startxmlsetups mml:int
\MMLcreset
\xmldoifelse {#1} {/mml:domainofapplication} {
- \int \doMMLlimits{int}_{\xmlfirst{#1}{/mml:domainofapplication}}\relax
+ \int \doMMLlimits{int}\normalsubscript{\xmlfirst{#1}{/mml:domainofapplication}}\relax
} {
\xmldoifelse {#1} {/mml:condition} {
- \int \doMMLlimits{int}_{\xmlfirst{#1}{/mml:condition}}\relax
+ \int \doMMLlimits{int}\normalsubscript{\xmlfirst{#1}{/mml:condition}}\relax
} {
\xmldoifelse {#1} {/mml:lowlimit} {
- \int \doMMLlimits{int}_{\xmlfirst{#1}{/mml:lowlimit}}^{\xmlfirst{#1}{/mml:uplimit}}
+ \int \doMMLlimits{int}\normalsubscript{\xmlfirst{#1}{/mml:lowlimit}}\normalsuperscript{\xmlfirst{#1}{/mml:uplimit}}
} {
% funny, why do we have lowlimit/uplimit then
\xmldoifelse {#1} {/mml:apply/mml:interval} {
- \int \doMMLlimits{int}_{\xmlindex{#1}{/mml:apply}{2}}^{\xmlindex{#1}{/mml:apply}{3}}
+ \int \doMMLlimits{int}\normalsubscript{\xmlindex{#1}{/mml:apply}{2}}\normalsuperscript{\xmlindex{#1}{/mml:apply}{3}}
} {
\int
}
@@ -1240,41 +1224,25 @@
\setupMMLappearance[diff][\c!location=\v!top,\c!alternative=\v!a]
-% \setupMMLappearance[diff][alternative=b]
-%
-% \startXMLdata
-% <math><apply><apply><diff/><bvar><ci>x</ci></bvar><ci>f</ci></apply><ci>a</ci></apply></math>
-% <math><apply><apply><diff/><bvar><ci>x</ci></bvar><degree>2</degree><ci>f</ci></apply><ci>a</ci></apply></math>
-% \stopXMLdata
-
-% d^y/dx^2
-%
-% \startXMLdata
-% <math><apply><diff/>
-% <bvar><ci>x</ci><cn type="integer">2</cn></bvar>
-% <lambda><bvar><ci>x</ci></bvar><ci>y</ci></lambda>
-% </apply></math>
-% \stopXMLdata
-
\startxmlsetups mml:diff
\MMLcreset
\doifelse \MMLdiffalternative \v!a {
\xmldoifelse {#1} {/mml:lambda} {
% a special case (mathadore/openmath)
\frac {
- d^{\xmlfirst{#1}{/mml:bvar}\xmlfirst{#1}{/mml:cn}}{\xmlfirst{#1}{/mml:lambda}\xmlfirst{#1}{/mml:ci}}
+ d\normalsuperscript{\xmlfirst{#1}{/mml:bvar}\xmlfirst{#1}{/mml:cn}}{\xmlfirst{#1}{/mml:lambda}\xmlfirst{#1}{/mml:ci}}
} {
- d{\xmlfirst{#1}{/mml:bvar}\xmlfirst{#1}{/mml:ci}}^{\xmlfirst{#1}{/mml:bvar}\xmlfirst{#1}{/mml:cn}}
+ d{\xmlfirst{#1}{/mml:bvar}\xmlfirst{#1}{/mml:ci}}\normalsuperscript{\xmlfirst{#1}{/mml:bvar}\xmlfirst{#1}{/mml:cn}}
}
} {
\xmldoifelse {#1} {/mml:bvar} {
\frac {
{\mr d}{
\xmldoifelse {#1} {/mml:degree} {
- ^{\xmlconcat{#1}{/mml:degree}\empty}
+ \normalsuperscript{\xmlconcat{#1}{/mml:degree}\empty}
} {
\xmldoif {#1} {/mml:bvar/mml:degree} {
- ^{\xmlconcat{#1}{/mml:bvar/mml:degree}+}
+ \normalsuperscript{\xmlconcat{#1}{/mml:bvar/mml:degree}+}
}
}
}
@@ -1290,22 +1258,22 @@
{\mr d}
\xmlfirst{#1}{/mml:bvar/!mml:degree}
\xmldoif {#1} {/mml:bvar/mml:degree} {
- ^{\xmlfirst{#1}{/mml:bvar/mml:degree}}
+ \normalsuperscript{\xmlfirst{#1}{/mml:bvar/mml:degree}}
}
}
\doifnot \MMLdifflocation \v!top {
\left(\MMLcreset\xmlfirst{#1}{/(mml:apply\string|mml:ci)}\right)
}
} {
- \xmlconcatrange{#1}{/*}{2}{}^\prime
+ \xmlconcatrange{#1}{/*}{2}{}\normalsuperscript\prime
}
}
} {
\MMLcreset
\xmlfirst{#1}{/(mml:apply\string|mml:ci)}
- % there can be problems with nested diff's: ^^{} error
+ % there can be problems with nested diff's: \normalsuperscript\normalsuperscript{} error
% so we add an empty group here
- {}^
+ {}\normalsuperscript
{
\xmldoifelse {#1} {/mml:degree} {
\edef\mmldegree{\xmlfirst{#1}{/mml:degree/mml:cn}}
@@ -1323,7 +1291,7 @@
\startxmlsetups mml:partialdiff
\xmldoifelse {#1} {/mml:list} {
- {\mr D}_{
+ {\mr D}\normalsubscript{
\begingroup
\setfalse\mmllistdelimiters
\xmlall{#1}{/mml:list}
@@ -1333,7 +1301,7 @@
} {
\xmldoifelse {#1} {/mml:bvar} {
\frac {
- {\mr d}^{
+ {\mr d}\normalsuperscript{
\xmldoifelse {#1} {/mml:degree} {
\xmlconcat{#1}{/mml:degree}\empty
} {
@@ -1348,7 +1316,7 @@
}
{\mr d}\xmlfirst{#1}{/(mml:apply\string|mml:reln\string|mml:ci\string|mml:cn)}
\xmldoif {#1} {/mml:bvar/mml:degree} {
- ^{\xmlfirst{#1}{/mml:bvar/mml:degree}}
+ \normalsuperscript{\xmlfirst{#1}{/mml:bvar/mml:degree}}
}
}
} {
@@ -1360,7 +1328,7 @@
\startxmlsetups mml:divergence \mathopnolimits{div} \xmlall{#1}{/!mml:divergence} \stopxmlsetups
\startxmlsetups mml:grad \mathopnolimits{grad} \xmlall{#1}{/!mml:grad} \stopxmlsetups
\startxmlsetups mml:curl \mathopnolimits{curl} \xmlall{#1}{/!mml:curl} \stopxmlsetups
-\startxmlsetups mml:laplacian \nabla^2 \xmlall{#1}{/!mml:laplacian} \stopxmlsetups
+\startxmlsetups mml:laplacian \nabla\normalsuperscript2 \xmlall{#1}{/!mml:laplacian} \stopxmlsetups
\startxmlsetups mml:ident \mathopnolimits{identity} \xmlall{#1}{/!mml:ident} \stopxmlsetups
\setupMMLappearance[domain] [symbol=]
@@ -1370,7 +1338,7 @@
\doifelsenothing \MMLdomainsymbol {
\mathopnolimits{domain}\MMLcreset\xmlall{#1}{/!mml:domain}
} {
- \MMLdomainsymbol_{\xmlall{#1}{/!mml:domain}}
+ \MMLdomainsymbol\normalsubscript{\xmlall{#1}{/!mml:domain}}
}
\stopxmlsetups
@@ -1378,7 +1346,7 @@
\doifelsenothing \MMLcodomainsymbol {
\mathopnolimits{codomain}\MMLcreset\xmlall{#1}{/!mml:codomain}
} {
- \MMLcodomainsymbol_{\xmlall{#1}{/!mml:codomain}}
+ \MMLcodomainsymbol\normalsubscript{\xmlall{#1}{/!mml:codomain}}
}
\stopxmlsetups
@@ -1448,7 +1416,7 @@
\begingroup
\xmldoifelse {#1} {/(mml:condition\string|mml:bvar\string|mml:lowlimit)} {
\def\mmlsumprodlower{
- _{
+ \normalsubscript{
\xmldoifelse {#1} {/mml:condition} {
\mmlstackedsubscripts{\xmlconcat{#1}{/mml:condition}{\crcr}}
} {
@@ -1464,7 +1432,7 @@
\let\mmlsumprodlower\empty
}
\xmldoifelse {#1} {/mml:uplimit} {
- \def\mmlsumprodupper{^{\xmlfirst{#1}{/mml:uplimit}}}
+ \def\mmlsumprodupper{\normalsuperscript{\xmlfirst{#1}{/mml:uplimit}}}
} {
\let\mmlsumprodupper\empty
}
@@ -1472,10 +1440,10 @@
\edef\mmlintervalfrom{\xmlindex{#1}{/mml:interval}{1}}
\edef\mmlintervalto {\xmlindex{#1}{/mml:interval}{2}}
\ifx \mmlintervalfrom \empty \else
- \def\mmlsumprodlower{_{\xmldoif{#1}{/mml:bvar}{\xmlfirst{#1}{/mml:bvar}{=}}\mmlintervalfrom}}
+ \def\mmlsumprodlower{\normalsubscript{\xmldoif{#1}{/mml:bvar}{\xmlfirst{#1}{/mml:bvar}{=}}\mmlintervalfrom}}
\fi
\ifx \mmlintervalto \empty \else
- \def\mmlsumprodupper{^{\mmlintervalto}}
+ \def\mmlsumprodupper{\normalsuperscript{\mmlintervalto}}
\fi
}
\MMLcreset
@@ -1493,7 +1461,7 @@
\startxmlsetups mml:limit
\MMLcreset \lim
- \doMMLlimits {limit}_{
+ \doMMLlimits {limit}\normalsubscript{
\MMLcreset
\xmldoifelse {#1} {/mml:condition} {
\xmlfirst{#1}{/mml:condition}
@@ -1529,18 +1497,18 @@
\setupMMLappearance[log][\c!location=\v!right]
\startxmlsetups mml:exp
-% {\mr e}^{\xmlfirst{#1}{/mml:apply\string|mml:reln\string|mml:ci\string|mml:cn}}
- {\mr e}^{\xmlfirst{#1}{/!mml:exp}}
+% {\mr e}\normalsuperscript{\xmlfirst{#1}{/mml:apply\string|mml:reln\string|mml:ci\string|mml:cn}}
+ {\mr e}\normalsuperscript{\xmlfirst{#1}{/!mml:exp}}
\stopxmlsetups
\startxmlsetups mml:log
\xmldoifelse {#1} {/mml:logbase} {
\doifelse \MMLloglocation \v!left {
\mathop {
- {}^{\xmlfirst{#1}{/mml:logbase}}\negthinspace\mathopnolimits{log}
+ {}\normalsuperscript{\xmlfirst{#1}{/mml:logbase}}\negthinspace\mathopnolimits{log}
}
} {
- \mathopnolimits{log}_{\xmlfirst{#1}{/mml:logbase}}
+ \mathopnolimits{log}\normalsubscript{\xmlfirst{#1}{/mml:logbase}}
}
% \MMLcreset
\xmlfirst{#1}{/(mml:apply\string|mml:reln\string|mml:ci\string|mml:cn)}
@@ -1562,20 +1530,20 @@
% statistics
-\startxmlsetups mml:mean \overline {\mmlsecond{#1}} \stopxmlsetups
-\startxmlsetups mml:sdev \sigma \left(\MMLcreset\mmlsecond{#1}\right) \stopxmlsetups
-\startxmlsetups mml:variance \sigma \left(\MMLcreset\mmlsecond{#1}\right)^2 \stopxmlsetups
-\startxmlsetups mml:median \mathopnolimits{median}\left(\MMLcreset\mmlsecond{#1}\right) \stopxmlsetups
-\startxmlsetups mml:mode \mathopnolimits{mode} \left(\MMLcreset\mmlsecond{#1}\right) \stopxmlsetups
+\startxmlsetups mml:mean \overline {\mmlsecond{#1}} \stopxmlsetups
+\startxmlsetups mml:sdev \sigma \left(\MMLcreset\mmlsecond{#1}\right) \stopxmlsetups
+\startxmlsetups mml:variance \sigma \left(\MMLcreset\mmlsecond{#1}\right)\normalsuperscript2 \stopxmlsetups
+\startxmlsetups mml:median \mathopnolimits{median}\left(\MMLcreset\mmlsecond{#1}\right) \stopxmlsetups
+\startxmlsetups mml:mode \mathopnolimits{mode} \left(\MMLcreset\mmlsecond{#1}\right) \stopxmlsetups
% moments
\startxmlsetups mml:moment
\left\langle
- \xmlfirst{#1}{/(mml:apply\string|mml:reln\string|mml:ci\string|mml:cn)}^{\xmlfirst{#1}{/mml:degree}}
+ \xmlfirst{#1}{/(mml:apply\string|mml:reln\string|mml:ci\string|mml:cn)}\normalsuperscript{\xmlfirst{#1}{/mml:degree}}
\right\rangle
\xmldoif {#1} {mml:momentabout} {
- _{\xmlfirst{#1}{mml:momentabout}}
+ \normalsubscript{\xmlfirst{#1}{mml:momentabout}}
}
\stopxmlsetups
@@ -1630,11 +1598,11 @@
\stopxmlsetups
\startxmlsetups mml:transpose
- \mmlsecond{#1}^{\mathopnolimits{T}}
+ \mmlsecond{#1}\normalsuperscript{\mathopnolimits{T}}
\stopxmlsetups
\startxmlsetups mml:selector
- \MMLmathinner{\mmlsecond{#1}_{\MMLcreset\xmlconcatrange{#1}{/*}{3}{}{\MMLseparator,}}}
+ \MMLmathinner{\mmlsecond{#1}\normalsubscript{\MMLcreset\xmlconcatrange{#1}{/*}{3}{}{\MMLseparator,}}}
\stopxmlsetups
\startxmlsetups mml:vectorproduct \mmlsecond{#1}\times \mmlthird{#1} \stopxmlsetups
@@ -1734,10 +1702,10 @@
\startxmlsetups mml:function
\ifx\MMLpowerelement\empty
- \ifconditional\xmlinversefunction^{-1}\fi
+ \ifconditional\xmlinversefunction\normalsuperscript{-1}\fi
\setfalse\xmlinversefunction
\else
- ^{\ifconditional\xmlinversefunction-\fi\MMLpowerelement}
+ \normalsuperscript{\ifconditional\xmlinversefunction-\fi\MMLpowerelement}
\setfalse\xmlinversefunction
\glet\MMLpowerelement\empty
\fi
@@ -1848,12 +1816,12 @@
% setups
\startxmlsetups mml:mi % todo: mathvariant mathsize mathcolor mathbackground
- \ctxlua{lxml.mml.mi("#1")}
+ \ctxmodulemathml{mi("#1")}
\stopxmlsetups
\startxmlsetups mml:mn % todo: mathvariant mathsize mathcolor mathbackground
\begingroup
- \mr \ctxlua{lxml.mml.mn("#1")}% no \hbox, would be ok for . , but spoils rest
+ \mr \ctxmodulemathml{mn("#1")}% no \hbox, would be ok for . , but spoils rest
\endgroup
\stopxmlsetups
@@ -1864,7 +1832,7 @@
\startxmlsetups mml:mo
\doif {\xmlatt{#1}{maxsize}} {1} {\settrue\mmlignoredelimiter}
\doif {\xmlatt{#1}{stretchy}} {false} {\settrue\mmlignoredelimiter}
- \ctxlua{lxml.mml.mo("#1")}
+ \ctxmodulemathml{mo("#1")}
\setfalse\mmlignoredelimiter
\stopxmlsetups
@@ -1872,7 +1840,7 @@
\def\MMLleft {\left }% weird
\def\MMLright {\right}
\def\MMLmiddle{\middle}
- \ctxlua{lxml.mml.mfenced("#1")}
+ \ctxmodulemathml{mfenced("#1")}
\stopxmlsetups
\defineoverlay [mml:enclose:box] [\useMPgraphic{mml:enclose:box}]
@@ -1934,7 +1902,7 @@
\stopuseMPgraphic
\startxmlsetups mml:menclose
- \edef\mmlmenclosenotation{\ctxlua{lxml.mml.menclosepattern("#1")}}
+ \edef\mmlmenclosenotation{\ctxmodulemathml{menclosepattern("#1")}}
\ifx\mmlmenclosenotation\empty
\xmlflush{#1}
\else
@@ -1987,7 +1955,7 @@
\frac{\mmlfirst{#1}}{\mmlsecond{#1}}
}
\else
- \doifXMLvalelse {mml:mfrac:linethickness} \mmlfraclinethickness {
+ \doifelse {\xmlval{mml:mfrac:linethickness}{\mmlfraclinethickness}{}} {} {
\scratchdimen\xmlval{mml:mfrac:linethickness}\mmlfraclinethickness{.4pt}
} {
\setdimensionwithunit\scratchdimen\mmlfraclinethickness{pt}
@@ -2025,7 +1993,7 @@
\domathtext {
\applymmlsometext{#1}{
\doifelse\MMLscriptsalternative\v!a {
- %\ctxlua{lxml.mml.stripped(\!!bs\xmlflush{#1}\!!es)}
+ %\ctxmodulemathml{stripped(\!!bs\xmlflush{#1}\!!es)}
\ignorespaces
\xmlflush{#1}
\unskip
@@ -2109,25 +2077,25 @@
\startxmlsetups mml:msub
\doifelse\MMLscriptsalternative\v!a {
- {\mmlfirst{#1}}_{\mmlsecond{#1}}
+ {\mmlfirst{#1}}\normalsubscript{\mmlsecond{#1}}
} {
- \mmlfirst{#1} _{\mmlsecond{#1}}
+ \mmlfirst{#1} \normalsubscript{\mmlsecond{#1}}
}
\stopxmlsetups
\startxmlsetups mml:msup
\doifelse\MMLscriptsalternative\v!a {
- {\mmlfirst{#1}}^{\mmlsecond{#1}}
+ {\mmlfirst{#1}}\normalsuperscript{\mmlsecond{#1}}
} {
- \mmlfirst{#1} ^{\mmlsecond{#1}}
+ \mmlfirst{#1} \normalsuperscript{\mmlsecond{#1}}
}
\stopxmlsetups
\startxmlsetups mml:msubsup
\doifelse\MMLscriptsalternative\v!a {
- {\mmlfirst{#1}}_{\mmlsecond{#1}}^{\mmlthird{#1}}
+ {\mmlfirst{#1}}\normalsubscript{\mmlsecond{#1}}\normalsuperscript{\mmlthird{#1}}
} {
- \mmlfirst{#1} _{\mmlsecond{#1}}^{\mmlthird{#1}}
+ \mmlfirst{#1} \normalsubscript{\mmlsecond{#1}}\normalsuperscript{\mmlthird{#1}}
}
\stopxmlsetups
@@ -2192,17 +2160,17 @@
\startxmlsetups mml:munderover
\edef\mmlbasetoken{\xmlraw{#1}{/mml:*[1]}}
\edef\mmlbasecommand{\utfmathcommand\mmlbasetoken}
- \mmlexecuteifdefined\mmlbasecommand{\mathematics{\mmlfirst{#1}}}_{\mmlsecond{#1}}^{\mmlthird{#1}}
+ \mmlexecuteifdefined\mmlbasecommand{\mathematics{\mmlfirst{#1}}}\normalsubscript{\mmlsecond{#1}}\normalsuperscript{\mmlthird{#1}}
\stopxmlsetups
% tables (mml:mtable, mml:mtr, mml:mlabledtr, mml:mtd)
\startxmlsetups mml:mtable % some more attributes need to be supported
- \vcenter{\ctxlua{lxml.mml.mtable("#1")}}
+ \vcenter{\ctxmodulemathml{mtable("#1")}}
\stopxmlsetups
\startxmlsetups mml:mcolumn
- \ctxlua{lxml.mml.mcolumn("#1")}
+ \ctxmodulemathml{mcolumn("#1")}
\stopxmlsetups
\def\mmlsetfakewidth#1{\setbox\scratchbox\hbox{#1}\scratchdimen\wd\scratchbox}
@@ -2283,34 +2251,21 @@
\startxmlsetups mml:mprescripts \stopxmlsetups
\startxmlsetups mml:mmultiscripts
- \ctxlua{lxml.mml.mmultiscripts("#1")}
+ \ctxmodulemathml{mmultiscripts("#1")}
\stopxmlsetups
-\stopmodule
+% goodie
-\protect \endinput
+\definebuffer[mml]
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\def\stopmml{\xmlprocessbuffer{@mml@}{\thedefinedbuffer{mml}}{}}
-% TODO:
-
-\startmoduletestsection
-
-\def\xflushXMLstackwith#1#2#3#4% num bgroup egroup whatever
- {\dostepwiserecurse{#1}\XMLstacklevel\plusone
- {#2\relax
- \ifnum\recurselevel>#1\relax#4\fi
- \getXMLstackdata\recurselevel
- #3}}
+\stopmodule
-\def\xflushXMLstackfrom#1#2#3%
- {\dostepwiserecurse{#1}\XMLstacklevel\plusone
- {#2\getXMLstackdata\recurselevel#3}}
+\protect \endinput
+% TODO:
+%
% <apply><divide/>
% <apply><minus/>
% <apply><minus/><ci>b</ci></apply>
@@ -2324,46 +2279,59 @@
% </apply>
% </apply>
-\startxmlsetups mml:minus
- \doif \MMLsignreduction \v!yes {
- \setMMLcreset{fn,\MMLcfunctionlist}
- }
- \ifcase\XMLstacklevel
- \or
- % self
- \or
- -\getXMLstackdata\plustwo
- \else
- \dostepwiserecurse \plustwo \XMLstacklevel \plusone {
- \begingroup
- \doifelse {\getXMLstackname\recurselevel} {apply} {
- \ifnum\recurselevel=\plustwo
- \begingroup
- \dodoifelseMMCfunctioninapply \recurselevel {minus} {
- \ifnum\XMLstacklevel>\plustwo
- \endgroup
- \else
- \endgroup
- \MMLcreset
- \fi
- } {
- \endgroup
- }
- \else
- \doifelseMMCfunctioninapply \recurselevel {\MMLcfunctionlist,\MMLcconstructlist} {
- \MMLcreset
- } {
- }
- \fi
- } {
- }
- \getXMLstackdata\recurselevel
- \ifnum\recurselevel<\XMLstacklevel\relax
- -
- \fi
- \endgroup
- }
- \fi
-\stopxmlsetups
-
-\stopmoduletestsection
+% \startmoduletestsection
+%
+% \def\xflushXMLstackwith#1#2#3#4% num bgroup egroup whatever
+% {\dostepwiserecurse{#1}\XMLstacklevel\plusone
+% {#2\relax
+% \ifnum\recurselevel>#1\relax#4\fi
+% \getXMLstackdata\recurselevel
+% #3}}
+%
+% \def\xflushXMLstackfrom#1#2#3%
+% {\dostepwiserecurse{#1}\XMLstacklevel\plusone
+% {#2\getXMLstackdata\recurselevel#3}}
+%
+% \startxmlsetups mml:minus
+% \doif \MMLsignreduction \v!yes {
+% \setMMLcreset{fn,\MMLcfunctionlist}
+% }
+% \ifcase\XMLstacklevel
+% \or
+% % self
+% \or
+% -\getXMLstackdata\plustwo
+% \else
+% \dostepwiserecurse \plustwo \XMLstacklevel \plusone {
+% \begingroup
+% \doifelse {\getXMLstackname\recurselevel} {apply} {
+% \ifnum\recurselevel=\plustwo
+% \begingroup
+% \dodoifelseMMCfunctioninapply \recurselevel {minus} {
+% \ifnum\XMLstacklevel>\plustwo
+% \endgroup
+% \else
+% \endgroup
+% \MMLcreset
+% \fi
+% } {
+% \endgroup
+% }
+% \else
+% \doifelseMMCfunctioninapply \recurselevel {\MMLcfunctionlist,\MMLcconstructlist} {
+% \MMLcreset
+% } {
+% }
+% \fi
+% } {
+% }
+% \getXMLstackdata\recurselevel
+% \ifnum\recurselevel<\XMLstacklevel\relax
+% -
+% \fi
+% \endgroup
+% }
+% \fi
+% \stopxmlsetups
+%
+% \stopmoduletestsection