summaryrefslogtreecommitdiff
path: root/tex/context/base/math-ini.lua
diff options
context:
space:
mode:
authorContext Git Mirror Bot <phg42.2a@gmail.com>2014-09-25 19:15:03 +0200
committerContext Git Mirror Bot <phg42.2a@gmail.com>2014-09-25 19:15:03 +0200
commitf7ecbf1b2c879f004c9276d5cec634814d78b576 (patch)
tree1b240cb2be3e9e3699741ffb7aae5bb88f8ff372 /tex/context/base/math-ini.lua
parent6f8440fd75c76e40620c2110ac445ab92635460c (diff)
downloadcontext-f7ecbf1b2c879f004c9276d5cec634814d78b576.tar.gz
2014-09-25 19:00:00
Diffstat (limited to 'tex/context/base/math-ini.lua')
-rw-r--r--tex/context/base/math-ini.lua46
1 files changed, 39 insertions, 7 deletions
diff --git a/tex/context/base/math-ini.lua b/tex/context/base/math-ini.lua
index 9772ce538..4cfa02e4e 100644
--- a/tex/context/base/math-ini.lua
+++ b/tex/context/base/math-ini.lua
@@ -24,6 +24,7 @@ local commands = commands
local context_sprint = context.sprint
----- context_fprint = context.fprint -- a bit inefficient
+local ctx_doifelse = commands.doifelse
local trace_defining = false trackers.register("math.defining", function(v) trace_defining = v end)
@@ -464,7 +465,7 @@ end
local function utfmathfiller(chr, default)
local cd = somechar[chr]
- local cmd = cd and (cd.mathfiller or cd.mathname)
+ local cmd = cd and cd.mathfiller -- or cd.mathname
return cmd or default or ""
end
@@ -481,15 +482,46 @@ function commands.utfmathstretch(...) context(utfmathstretch(...)) end
function commands.utfmathcommand(...) context(utfmathcommand(...)) end
function commands.utfmathfiller (...) context(utfmathfiller (...)) end
-function commands.doifelseutfmathaccent(chr,asked)
- commands.doifelse(utfmathaccent(chr,nil,asked))
+function commands.utfmathcommandabove(asked)
+ local c = utfmathcommand(asked,nil,"topaccent","over" )
+ if c ~= "" then
+ context(c)
+ end
+end
+
+function commands.utfmathcommandbelow (asked)
+ local c = utfmathcommand(asked,nil,"botaccent","under")
+ if c ~= "" then
+ context(c)
+ end
end
-function commands.utfmathcommandabove(asked) context(utfmathcommand(asked,nil,"topaccent","over" )) end
-function commands.utfmathcommandbelow(asked) context(utfmathcommand(asked,nil,"botaccent","under")) end
+function commands.utfmathcommandfiller(asked)
+ local c = utfmathfiller(asked,nil)
+ if c ~= "" then
+ context(c)
+ end
+end
-function commands.doifelseutfmathabove(chr) commands.doifelse(utfmathaccent(chr,nil,"topaccent","over" )) end
-function commands.doifelseutfmathbelow(chr) commands.doifelse(utfmathaccent(chr,nil,"botaccent","under")) end
+function commands.doifelseutfmathabove(chr)
+ local c = utfmathaccent(chr,nil,"topaccent","over")
+ ctx_doifelse(c and c ~= "")
+end
+
+function commands.doifelseutfmathbelow(chr)
+ local c = utfmathaccent(chr,nil,"botaccent","under")
+ ctx_doifelse(c and c ~= "")
+end
+
+function commands.doifelseutfmathaccent(chr,asked)
+ local c = utfmathaccent(chr,nil,asked)
+ ctx_doifelse(c and c ~= "")
+end
+
+function commands.doifelseutfmathfiller(chr)
+ local c = utfmathfiller(chr,nil)
+ ctx_doifelse(c and c ~= "")
+end
-- helpers
--