summaryrefslogtreecommitdiff
path: root/tex/context/base/mkiv/math-noa.lua
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2018-12-19 19:26:36 +0100
committerContext Git Mirror Bot <phg@phi-gamma.net>2018-12-19 19:26:36 +0100
commit5d695b87d2f514578ee4872da7957007d0d36f79 (patch)
tree59d13c3016393a959c0eb408eba540ecd08eda55 /tex/context/base/mkiv/math-noa.lua
parent65d8c090a0a9fe003f171eabdf0493b534270636 (diff)
downloadcontext-5d695b87d2f514578ee4872da7957007d0d36f79.tar.gz
2018-12-19 18:57:00
Diffstat (limited to 'tex/context/base/mkiv/math-noa.lua')
-rw-r--r--tex/context/base/mkiv/math-noa.lua48
1 files changed, 48 insertions, 0 deletions
diff --git a/tex/context/base/mkiv/math-noa.lua b/tex/context/base/mkiv/math-noa.lua
index 0ff189e06..5cf367fba 100644
--- a/tex/context/base/mkiv/math-noa.lua
+++ b/tex/context/base/mkiv/math-noa.lua
@@ -1114,6 +1114,18 @@ do
setnext(stop_super)
end
if start_sub then
+
+-- if mode == "sub" then
+-- local sup = getsup(pointer)
+-- if sup and not getsub(pointer) then
+-- local nxt = getnext(pointer)
+-- local new = new_noad(pointer)
+-- setnucleus(new,new_submlist())
+-- setlink(pointer,new,nxt)
+-- pointer = new
+-- end
+-- end
+
if start_sub == stop_sub then
setsub(pointer,getnucleus(start_sub))
else
@@ -1140,6 +1152,42 @@ end
do
+ local unstack = { } noads.processors.unstack = unstack
+ local enabled = false
+
+ unstack[math_noad] = function(pointer,what,n,parent)
+ local sup = getsup(pointer)
+ local sub = getsub(pointer)
+ if sup and sub then
+ local nxt = getnext(pointer)
+ local new = new_noad(pointer)
+ setnucleus(new,new_submlist())
+ setsub(pointer)
+ setsub(new,sub)
+ setlink(pointer,new,nxt)
+ end
+ end
+
+ function handlers.unstack(head,style,penalties)
+ if enabled then
+ processnoads(head,unstack,"unstack")
+ return true -- not needed
+ end
+ end
+
+ implement {
+ name = "enablescriptunstacking",
+ onlyonce = true,
+ actions = function()
+ enableaction("math","noads.handlers.unstack")
+ enabled = true
+ end
+ }
+
+end
+
+do
+
local function collected(list)
if list and next(list) then
local n, t = 0, { }