diff options
Diffstat (limited to 'Master/texmf-dist/tex/context/base/node-ref.lua')
-rw-r--r-- | Master/texmf-dist/tex/context/base/node-ref.lua | 34 |
1 files changed, 24 insertions, 10 deletions
diff --git a/Master/texmf-dist/tex/context/base/node-ref.lua b/Master/texmf-dist/tex/context/base/node-ref.lua index 04598082304..7128b1a6d20 100644 --- a/Master/texmf-dist/tex/context/base/node-ref.lua +++ b/Master/texmf-dist/tex/context/base/node-ref.lua @@ -1,6 +1,6 @@ if not modules then modules = { } end modules ['node-bck'] = { version = 1.001, - comment = "companion to node-bck.tex", + comment = "companion to node-bck.mkiv", author = "Hans Hagen, PRAGMA-ADE, Hasselt NL", copyright = "PRAGMA ADE / ConTeXt Development Team", license = "see context related readme files" @@ -67,6 +67,8 @@ local function dimensions(parent,start,stop) end end +-- is pardir important at all? + local function inject_range(head,first,last,reference,make,stack,parent,pardir,txtdir) local width, height, depth = dimensions(parent,first,last) if pardir == "TRT" or txtdir == "+TRT" then @@ -112,6 +114,9 @@ local function inject_list(id,current,reference,make,stack,pardir,txtdir) if id == hlist then -- can be either an explicit hbox or a line and there is no way -- to recognize this; anyway only if ht/dp (then inline) + -- + -- to be tested: 0=unknown, 1=linebreak, 2=hbox +--~ if id.subtype == 1 then local sr = stack[reference] if first then if sr and sr[2] then @@ -122,10 +127,10 @@ local function inject_list(id,current,reference,make,stack,pardir,txtdir) if prev and prev.id == glue and prev.subtype == 15 then width = dimensions(current,first,prev.prev) -- maybe not current as we already take care of it else - if moveright and first.spec then + if moveright and first.writable then width = width - first.spec.stretch*current.glue_set * current.glue_sign end - if last.spec then + if last.writable then width = width - last.spec.stretch*current.glue_set * current.glue_sign end end @@ -133,6 +138,10 @@ local function inject_list(id,current,reference,make,stack,pardir,txtdir) else -- also weird end +--~ else +--~ print("!!!!!!!!!!!!!!!!!") + -- simple +--~ end else -- ok end @@ -185,26 +194,27 @@ local function inject_areas(head,attribute,make,stack,done,skip,parent,pardir,tx txtdir = current.dir end elseif id == hlist or id == vlist then ---~ if r and (not skip or r > skip) then if not reference and r and (not skip or r > skip) then inject_list(id,current,r,make,stack,pardir,txtdir) ---~ done[r] = true end -if r then done[r] = (done[r] or 0) + 1 end + if r then + done[r] = (done[r] or 0) + 1 + end local list = current.list if list then local _ current.list, _, pardir, txtdir = inject_areas(list,attribute,make,stack,done,r or skip or 0,current,pardir,txtdir) end -if r then done[r] = done[r] - 1 end + if r then + done[r] = done[r] - 1 + end elseif not r then -- just go on, can be kerns elseif not reference then reference, first, last, firstdir = r, current, current, txtdir elseif r == reference then last = current ---~ elseif not done[reference] then -elseif (done[reference] or 0) == 0 then + elseif (done[reference] or 0) == 0 then if not skip or r > skip then head, current = inject_range(head,first,last,reference,make,stack,parent,pardir,firstdir) reference, first, last, firstdir = nil, nil, nil, nil @@ -214,7 +224,6 @@ elseif (done[reference] or 0) == 0 then end current = current.next end ---~ if reference and not done[reference] then if reference and (done[reference] or 0) == 0 then head = inject_range(head,first,last,reference,make,stack,parent,pardir,firstdir) end @@ -517,3 +526,8 @@ statistics.register("interactive elements", function() return nil end end) + +function jobreferences.enable_interaction() + tasks.enableaction("shipouts","nodes.add_references") + tasks.enableaction("shipouts","nodes.add_destinations") +end |