summaryrefslogtreecommitdiff
path: root/tex/context/base/x-mathml.mkiv
diff options
context:
space:
mode:
Diffstat (limited to 'tex/context/base/x-mathml.mkiv')
-rw-r--r--tex/context/base/x-mathml.mkiv67
1 files changed, 49 insertions, 18 deletions
diff --git a/tex/context/base/x-mathml.mkiv b/tex/context/base/x-mathml.mkiv
index 15c1694ff..3fd58a5b3 100644
--- a/tex/context/base/x-mathml.mkiv
+++ b/tex/context/base/x-mathml.mkiv
@@ -106,14 +106,24 @@
\settrue \mmlsomeleftdelimiter\expandafter\MMLright
\fi}
-\ifx\MMLleft \undefined \let\MMLleft \firstofoneargument \fi
-\ifx\MMLright \undefined \let\MMLright \firstofoneargument \fi
-\ifx\MMLmiddle\undefined \let\MMLmiddle\firstofoneargument \fi
+% \ifx\MMLleft \undefined \let\MMLleft \firstofoneargument \fi
+% \ifx\MMLright \undefined \let\MMLright \firstofoneargument \fi
+% \ifx\MMLmiddle\undefined \let\MMLmiddle\firstofoneargument \fi
-\def\mmlleftdelimiter #1{\ifconditional\mmlignoredelimiter#1\else\normalordelimiter{#1}{\MMLleft #1}\fi}
-\def\mmlrightdelimiter #1{\ifconditional\mmlignoredelimiter#1\else\normalordelimiter{#1}{\MMLright #1}\fi}
-\def\mmlmiddledelimiter #1{\ifconditional\mmlignoredelimiter#1\else\normalordelimiter{#1}{\MMLmiddle #1}\fi}
-\def\mmlleftorrightdelimiter#1{\ifconditional\mmlignoredelimiter#1\else\normalordelimiter{#1}{\MMLleftorright#1}\fi}
+% \def\mmlleftdelimiter #1{\ifconditional\mmlignoredelimiter#1\else\normalordelimiter{#1}{\MMLleft #1}\fi}
+% \def\mmlrightdelimiter #1{\ifconditional\mmlignoredelimiter#1\else\normalordelimiter{#1}{\MMLright #1}\fi}
+% \def\mmlmiddledelimiter #1{\ifconditional\mmlignoredelimiter#1\else\normalordelimiter{#1}{\MMLmiddle #1}\fi}
+% \def\mmlleftorrightdelimiter#1{\ifconditional\mmlignoredelimiter#1\else\normalordelimiter{#1}{\MMLleftorright#1}\fi}
+
+% assumes
+%
+% \math_fences_checked_start
+% \math_fences_checked_stop
+
+\let\mmlleftdelimiter \math_fences_checked_left
+\let\mmlmiddledelimiter \math_fences_checked_middle
+\let\mmlleftorrightdelimiter\math_fences_checked_left_or_middle
+\let\mmlrightdelimiter \math_fences_checked_right
\def\mmlchar#1{\char#1 } % used in lua code
@@ -1887,13 +1897,20 @@
\setfalse\mmlignoredelimiter
\stopxmlsetups
+% \startxmlsetups mml:mfenced % {} around separator is needed for spacing
+% \def\MMLleft {\left }% weird
+% \def\MMLright {\right}
+% \def\MMLmiddle{\middle}
+% \ctxmodulemathml{mfenced("#1")}
+% \stopxmlsetups
+
\startxmlsetups mml:mfenced % {} around separator is needed for spacing
- \def\MMLleft {\left }% weird
- \def\MMLright {\right}
- \def\MMLmiddle{\middle}
+ \math_fences_checked_start
\ctxmodulemathml{mfenced("#1")}
+ \math_fences_checked_stop
\stopxmlsetups
+
\defineoverlay [mml:enclose:box] [\useMPgraphic{mml:enclose:box}]
\defineoverlay [mml:enclose:roundedbox] [\useMPgraphic{mml:enclose:roundedbox}]
\defineoverlay [mml:enclose:circle] [\useMPgraphic{mml:enclose:circle}]
@@ -2105,18 +2122,32 @@
%
% fails on { ... so we need
+% \startxmlsetups mml:mrow
+% \begingroup
+% \xmldoifelse {#1} {/mml:mo[first() or last()]} {% we need a {}
+% \def\MMLleft {\left }
+% \def\MMLright {\right}
+% \def\MMLmiddle{\middle}
+% \enabledelimiter
+% \checkdelimiters{\xmlall{#1}{/mml:mo}}
+% \fakeleftdelimiter
+% \xmlflush{#1}
+% \fakerightdelimiter
+% \disabledelimiter
+% } {
+% \xmlflush{#1}
+% }
+% \endgroup
+% \stopxmlsetups
+%
+% more modern:
+
\startxmlsetups mml:mrow
\begingroup
\xmldoifelse {#1} {/mml:mo[first() or last()]} {% we need a {}
- \def\MMLleft {\left }
- \def\MMLright {\right}
- \def\MMLmiddle{\middle}
- \enabledelimiter
- \checkdelimiters{\xmlall{#1}{/mml:mo}}
- \fakeleftdelimiter
+ \math_fences_checked_start
\xmlflush{#1}
- \fakerightdelimiter
- \disabledelimiter
+ \math_fences_checked_stop
} {
\xmlflush{#1}
}