summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/context/base/x-calcmath.mkiv
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/context/base/x-calcmath.mkiv')
-rw-r--r--Master/texmf-dist/tex/context/base/x-calcmath.mkiv29
1 files changed, 11 insertions, 18 deletions
diff --git a/Master/texmf-dist/tex/context/base/x-calcmath.mkiv b/Master/texmf-dist/tex/context/base/x-calcmath.mkiv
index c726843fa4f..7dfa60e0e92 100644
--- a/Master/texmf-dist/tex/context/base/x-calcmath.mkiv
+++ b/Master/texmf-dist/tex/context/base/x-calcmath.mkiv
@@ -13,14 +13,16 @@
%D Lua code.
-\ctxloadluafile{x-calcmath}{}
+\registerctxluafile{x-calcmath}{}
+
+\def\ctxmodulecalcmath#1{\directlua\zerocount{moduledata.calcmath.#1}}
%D Interface:
\unprotect
-\def\inlinecalcmath #1{\mathematics{\ctxlua{calcmath.tex("#1",1)}}}
-\def\displaycalcmath#1{\startformula\ctxlua{calcmath.tex("#1",2)}\stopformula}
+\unexpanded\def\inlinecalcmath #1{\mathematics{\ctxmodulecalcmath{tex("#1",1)}}}
+\unexpanded\def\displaycalcmath#1{\startformula\ctxmodulecalcmath{tex("#1",2)}\stopformula}
\let\calcmath\inlinecalcmath
@@ -37,24 +39,24 @@
\xmlregistersetup{xml:cam:define}
% tex -> lua -> tex -> lua -> tex
-% \mathematics{\ctxlua{calcmath.xml(\!!bs\xmlflush{#1}\!!es,1)}}
+% \mathematics{\ctxmodulecalcmath{xml(\!!bs\xmlflush{#1}\!!es,1)}}
% tex -> lua -> tex
-% \mathematics{\ctxlua{calcmath.xml("#1",1)}}%
+% \mathematics{\ctxmodulecalcmath{xml("#1",1)}}%
\startxmlsetups cam:i
- \mathematics{\ctxlua{calcmath.xml("#1",1)}}%
+ \mathematics{\ctxmodulecalcmath{xml("#1",1)}}%
\stopxmlsetups
\startxmlsetups cam:d
- \startformula\ctxlua{calcmath.xml("#1",2)}\stopformula
+ \startformula\ctxmodulecalcmath{xml("#1",2)}\stopformula
\stopxmlsetups
\startxmlsetups cam:icm
- \mathematics{\ctxlua{calcmath.xml("#1",1)}}
+ \mathematics{\ctxmodulecalcmath{xml("#1",1)}}
\stopxmlsetups
\startxmlsetups cam:dcm
- \startformula\ctxlua{calcmath.xml("#1",2)}\stopformula
+ \startformula\ctxmodulecalcmath{xml("#1",2)}\stopformula
\stopxmlsetups
\protect \endinput
@@ -76,12 +78,3 @@
% \calcmath{D(x+D(y))}
% \calcmath{Df(x)}
% \calcmath{g(x)}
-
-\calcmath{sqrt(sin^2(x)+cos^2(x))}
-
-\startXMLdata
-test <icm>sqrt(sin^2(x)+cos^2(x))</icm> test
-test <dcm>sqrt(sin^2(x)+cos^2(x))</dcm> test
-\stopXMLdata
-
-\stoptext