summaryrefslogtreecommitdiff
path: root/tex/context/modules/mkiv/x-mathml.mkiv
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2017-10-10 13:36:53 +0200
committerContext Git Mirror Bot <phg42.2a@gmail.com>2017-10-10 13:36:53 +0200
commitd47ee9fc195ba82eef5e4be132b1d88b7f009a9c (patch)
tree45964c47b2242f6ff9bf6a881639146be1edd201 /tex/context/modules/mkiv/x-mathml.mkiv
parentedaa6851d5c096acba2ad5817f70d3eb7cec46e6 (diff)
downloadcontext-d47ee9fc195ba82eef5e4be132b1d88b7f009a9c.tar.gz
2017-10-10 12:06:00
Diffstat (limited to 'tex/context/modules/mkiv/x-mathml.mkiv')
-rw-r--r--tex/context/modules/mkiv/x-mathml.mkiv28
1 files changed, 24 insertions, 4 deletions
diff --git a/tex/context/modules/mkiv/x-mathml.mkiv b/tex/context/modules/mkiv/x-mathml.mkiv
index 31ccbc153..db9cdc958 100644
--- a/tex/context/modules/mkiv/x-mathml.mkiv
+++ b/tex/context/modules/mkiv/x-mathml.mkiv
@@ -66,6 +66,9 @@
\xmlmapvalue {mml:math:dir} {ltr} {\setfalse\c_math_right_to_left\math_basics_synchronize_direction}
\xmlmapvalue {mml:math:dir} {rtl} {\settrue \c_math_right_to_left\math_basics_synchronize_direction}
+\edef\mmlconstantone {1}
+\edef\mmlconstantfalse{false}
+
\startxmlsetups mml:math
\begingroup
\enableautofences
@@ -110,8 +113,9 @@
%D First we define some general formula elements.
\startxmlsetups mml:formula
- \edef\mmlformulalabel {\xmlatt{#1}{label}\xmlatt{#1}{id}}
- \edef\mmlformulasublabel{\xmlatt{#1}{sublabel}\xmlatt{#1}{id}}
+ \edef\mmlformulaid {\xmlatt{#1}{id}}
+ \edef\mmlformulalabel {\xmlatt{#1}{label}\mmlformulaid}
+ \edef\mmlformulasublabel{\xmlatt{#1}{sublabel}\mmlformulaid}
\doifsomething\mmlformulalabel{\placeformula[\mmlformulalabel]{\mmlformulasublabel}}
\startformula
%\MMLhack
@@ -1937,12 +1941,28 @@
% spacing between - and 2 is taken care of by tex itself
\startxmlsetups mml:mo
- \doif {\xmlatt{#1}{maxsize}} {1} {\settrue\mmlignoredelimiter}
- \doif {\xmlatt{#1}{stretchy}} {false} {\settrue\mmlignoredelimiter}
+ \edef\mmlattvalue{\xmlatt{#1}{maxsize}}
+ \ifx\mmlattvalue\mmlconstantone
+ \settrue\mmlignoredelimiter
+ \else
+ \edef\mmlattvalue{\xmlatt{#1}{stretchy}}
+ \ifx\mmlattvalue\mmlconstantfalse
+ \settrue\mmlignoredelimiter
+ \fi
+ \fi
+ \edef\mmlattvalue{\xmlatt{#1}{lspace}}
+ \ifx\mmlattvalue\empty\else
+ \hskip\mmlattvalue\relax % todo: check for dimension
+ \fi
\ctxmodulemathml{mo("#1")}
+ \edef\mmlattvalue{\xmlatt{#1}{rspace}}
+ \ifx\mmlattvalue\empty\else
+ \hskip\mmlattvalue\relax % todo: check for dimension
+ \fi
\setfalse\mmlignoredelimiter
\stopxmlsetups
+
% \startxmlsetups mml:mfenced % {} around separator is needed for spacing
% \def\MMLleft {\left }% weird
% \def\MMLright {\right}