summaryrefslogtreecommitdiff
path: root/tex/context/base/math-frc.lua
diff options
context:
space:
mode:
Diffstat (limited to 'tex/context/base/math-frc.lua')
-rw-r--r--tex/context/base/math-frc.lua18
1 files changed, 12 insertions, 6 deletions
diff --git a/tex/context/base/math-frc.lua b/tex/context/base/math-frc.lua
index 4f531a530..639edc94b 100644
--- a/tex/context/base/math-frc.lua
+++ b/tex/context/base/math-frc.lua
@@ -25,13 +25,13 @@ table.setmetatableindex(resolved, function(t,k)
return v
end)
-local normalatop = context.normalatop
-local normalover = context.normalover
+local ctx_normalatop = context.normalatop
+local ctx_normalover = context.normalover
-function commands.math_frac(how,left,right,width)
- if how == v_no then
+local function mathfraction(how,left,right,width) -- of course we could use the scanners directly here which
+ if how == v_no then -- is faster but also less abstract ... maybe some day
if left == 0x002E and right == 0x002E then
- normalatop()
+ ctx_normalatop()
else
context("\\atopwithdelims%s%s",resolved[left],resolved[right])
end
@@ -43,9 +43,15 @@ function commands.math_frac(how,left,right,width)
end
else -- v_auto
if left == 0x002E and right == 0x002E then
- normalover()
+ ctx_normalover()
else
context("\\overwithdelims%s%s",resolved[left],resolved[right])
end
end
end
+
+interfaces.implement {
+ name = "mathfraction",
+ actions = mathfraction,
+ arguments = { "string", "number", "number", "dimen" }
+}