summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/context/base/x-asciimath.mkiv
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/context/base/x-asciimath.mkiv')
-rw-r--r--Master/texmf-dist/tex/context/base/x-asciimath.mkiv16
1 files changed, 14 insertions, 2 deletions
diff --git a/Master/texmf-dist/tex/context/base/x-asciimath.mkiv b/Master/texmf-dist/tex/context/base/x-asciimath.mkiv
index cc98b54acca..1d62fb93d32 100644
--- a/Master/texmf-dist/tex/context/base/x-asciimath.mkiv
+++ b/Master/texmf-dist/tex/context/base/x-asciimath.mkiv
@@ -156,8 +156,20 @@
}}%
\to \everysetupasciimath
-\unexpanded\def\asciimath#1%
- {\clf_asciimath{\detokenize\expandafter{\normalexpanded{#1}}}}
+\newtoks\everyascimath
+
+% \appendtoks
+% \ignorediscretionaries
+% \to \everyasciimath
+
+\unexpanded\def\asciimath
+ {\doifnextoptionalelse\asciimath_yes\asciimath_nop}
+
+\def\asciimath_yes[#1]#2%
+ {\mathematics[#1]{\clf_justasciimath{\detokenize\expandafter{\normalexpanded{#2}}}}}
+
+\def\asciimath_nop#1%
+ {\mathematics{\clf_justasciimath{\detokenize\expandafter{\normalexpanded{#1}}}}}
\unexpanded\def\ctxmoduleasciimath#1%
{\ctxlua{moduledata.asciimath.#1}}