summaryrefslogtreecommitdiff
path: root/tex/context/base/x-asciimath.mkiv
diff options
context:
space:
mode:
Diffstat (limited to 'tex/context/base/x-asciimath.mkiv')
-rw-r--r--tex/context/base/x-asciimath.mkiv17
1 files changed, 15 insertions, 2 deletions
diff --git a/tex/context/base/x-asciimath.mkiv b/tex/context/base/x-asciimath.mkiv
index acdcae64a..6a9595a59 100644
--- a/tex/context/base/x-asciimath.mkiv
+++ b/tex/context/base/x-asciimath.mkiv
@@ -119,11 +119,25 @@
%D
%D In retrospect I sometimes wonder if the energy put into constantly adapting to
%D the fashion of the day pays off. Probably not. It definitely doesn't pay of.
+%D
+%D More complex crap:
+%D
+%D 1: $x + \stackrel{comment}{\stackrel{\utfchar{"23DE}}{yyyyyyyy}} = y$ \blank
+%D 2: \asciimath{x + stackrel{\utfchar{"23DE}}{yyyyyyyy} = y} \blank
+%D 3: \asciimath{x + stackrel{yyyyyyyy}{\utfchar{"23DE}} = y} \blank
+%D 4: \asciimath{x + stackrel{"comment"}{stackrel{\utfchar{"23DE}}{yyyyyyyy}} = y} \blank
\unprotect
\writestatus{asciimath}{beware, this is an experimental (m4all only) module}
+%D Hacks:
+
+\unexpanded\def\asciimathoptext #1{\ifmmode\mathop{\text{#1}}\else#1\fi}
+\unexpanded\def\asciimathoptexttraced#1{\ifmmode\mathop{\text{\color[darkgreen]{#1}}}\else\color[darkgreen]{#1}\fi}
+
+\unexpanded\def\asciimathstackrel #1#2{\mathematics{\mathop{\let\limits\relax\mover{#2}{#1}}}}
+
%D The core commands:
\unexpanded\def\asciimath#1%
@@ -168,8 +182,7 @@
\unexpanded\def\ShowAsciiMathStart
{\begingroup
- \let\normalmathoptext\mathoptext
- \unexpanded\def\mathoptext##1{\normalmathoptext{\color[darkgreen]{##1}}}%
+ \let\asciimathoptext\asciimathoptexttraced
\setuptyping[\v!buffer][\c!before=,\c!after=]
\setupmargindata[\v!left][\c!style=]}