From f7ecbf1b2c879f004c9276d5cec634814d78b576 Mon Sep 17 00:00:00 2001 From: Context Git Mirror Bot Date: Thu, 25 Sep 2014 19:15:03 +0200 Subject: 2014-09-25 19:00:00 --- tex/context/base/math-ini.lua | 46 ++++++++++++++++++++++++++++++++++++------- 1 file changed, 39 insertions(+), 7 deletions(-) (limited to 'tex/context/base/math-ini.lua') 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 -- -- cgit v1.2.3