summaryrefslogtreecommitdiff
path: root/tex/context/base/mkiv/syst-lua.mkxl
diff options
context:
space:
mode:
Diffstat (limited to 'tex/context/base/mkiv/syst-lua.mkxl')
-rw-r--r--tex/context/base/mkiv/syst-lua.mkxl37
1 files changed, 37 insertions, 0 deletions
diff --git a/tex/context/base/mkiv/syst-lua.mkxl b/tex/context/base/mkiv/syst-lua.mkxl
index b6f1e8eaa..cceb4f160 100644
--- a/tex/context/base/mkiv/syst-lua.mkxl
+++ b/tex/context/base/mkiv/syst-lua.mkxl
@@ -58,4 +58,41 @@
\let\syst_write_execute\clf_execute % always {...}
+%D There is a probably rather useless \type {\expression} command that can mix \LUA\ numeric
+%D expressions with \TEX\ commands (for as far that makes sense) that works like this:
+%D
+%D \starttyping
+%D \mathchardef\foooo 1234
+%D \def \mymacro {123.45}
+%D \scratchdimen 123pt
+%D \scratchskip 123pt
+%D \scratchtoks {34}
+%D
+%D \testfeatureonce{10000}{\edef\foo{\expression
+%D round(
+%D 12.3 * \scratchdimen
+%D - (12.3 * \scratchskip) / 2
+%D + 2 ^ 3
+%D * (
+%D - sqrt(12)
+%D - 10pt
+%D - \foooo
+%D + \luatexversion
+%D - \mymacro
+%D + \scratchtoks
+%D + \the\scratchcounter
+%D + \number\scratchcounter
+%D )
+%D )
+%D \relax}}
+%D
+%D \expression string.format("\letterpercent f",\elapsedtime/50000) \relax
+%D \stoptyping
+%D
+%D The final \type {\relax} is mandate because we also accept spaces. Of course we
+%D could have avoided it by using outer parenthesis but this is cleaner anyway.
+%D
+%D The \LMTX\ version supports te \type {xmath} and \type {xcomplex} functions and
+%D therefore one can have expressions that don't work in \MKIV.
+
\protect \endinput