diff options
Diffstat (limited to 'tex/context/base/node-aux.lua')
-rw-r--r-- | tex/context/base/node-aux.lua | 39 |
1 files changed, 19 insertions, 20 deletions
diff --git a/tex/context/base/node-aux.lua b/tex/context/base/node-aux.lua index 443c78547..e3fc7ad6f 100644 --- a/tex/context/base/node-aux.lua +++ b/tex/context/base/node-aux.lua @@ -43,7 +43,7 @@ local unsetvalue = attributes.unsetvalue local current_font = font.current -local texgetbox = tex.getbox +local texbox = tex.box local report_error = logs.reporter("node-aux:error") @@ -195,7 +195,7 @@ function nodes.firstcharacter(n,untagged) -- tagged == subtype > 255 end function nodes.firstcharinbox(n) - local l = texgetbox(n).list + local l = texbox[n].list if l then for g in traverse_id(glyph_code,l) do return g.char @@ -370,21 +370,20 @@ end nodes.locate = locate --- I have no use for this yet: --- --- \skip0=10pt plus 2pt minus 2pt --- \cldcontext{"\letterpercent p",tex.stretch_amount(tex.skip[0],1000)} -- 14.30887pt --- --- local gluespec_code = nodes.nodecodes.gluespec --- --- function tex.badness_to_ratio(badness) --- return (badness/100)^(1/3) --- end --- --- function tex.stretch_amount(skip,badness) --- if skip.id == gluespec_code then --- return skip.width + (badness and (badness/100)^(1/3) or 1) * skip.stretch --- else --- return 0 --- end --- end +function nodes.concat(list) + local head, tail + for i=1,#list do + local li = list[i] + if not li then + -- skip + elseif head then + tail.next = li + li.prev = tail + tail = li.next and slide_nodes(li) or li + else + head = li + tail = li.next and slide_nodes(li) or li + end + end + return head, tail +end |