From 5d695b87d2f514578ee4872da7957007d0d36f79 Mon Sep 17 00:00:00 2001 From: Hans Hagen Date: Wed, 19 Dec 2018 19:26:36 +0100 Subject: 2018-12-19 18:57:00 --- tex/context/base/mkiv/math-noa.lua | 48 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) (limited to 'tex/context/base/mkiv/math-noa.lua') 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 @@ -1138,6 +1150,42 @@ do 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) -- cgit v1.2.3