From a0eaab2fea8dde90ee74f98064e78f6231b8f48d Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sun, 28 Aug 2016 22:18:55 +0000 Subject: luatexja (28aug16) git-svn-id: svn://tug.org/texlive/trunk@41945 c570f23f-e606-0410-a88d-b1316a301751 --- .../tex/luatex/luatexja/ltj-direction.lua | 29 +++++++++++++++++----- 1 file changed, 23 insertions(+), 6 deletions(-) (limited to 'Master/texmf-dist/tex/luatex/luatexja/ltj-direction.lua') diff --git a/Master/texmf-dist/tex/luatex/luatexja/ltj-direction.lua b/Master/texmf-dist/tex/luatex/luatexja/ltj-direction.lua index 970a3f75972..8a2af68374c 100644 --- a/Master/texmf-dist/tex/luatex/luatexja/ltj-direction.lua +++ b/Master/texmf-dist/tex/luatex/luatexja/ltj-direction.lua @@ -956,7 +956,25 @@ end -- vsplit do - local split_dir_whatsit + local split_dir_whatsit, split_dir_head + local cat_lp = luatexbase.catcodetables['latex-package'] + local sprint, scan_int, tex_getbox = tex.sprint, token.scan_int, tex.getbox + function luatexja.direction.vsplit() + local n = scan_int(); + local p = to_direct(tex_getbox(n)) + split_dir_head = nil + if p then + local bh = getlist(p) + if getid(bh)==id_whatsit and getsubtype(bh)==sid_user and getfield(bh, 'user_id')==DIR + and node_next(bh) then + ltjs.list_dir = has_attr(bh, attr_dir) + local q = node_next(p) + setfield(p, 'head', node_remove(bh,bh,bh)) + split_dir_head = bh + end + end + sprint(cat_lp, '\\ltj@@orig@vsplit' .. tostring(n)) + end local function dir_adjust_vpack(h, gc) start_time_measure('direction_vpack') local hd = to_direct(h) @@ -965,10 +983,9 @@ do hd = create_dir_whatsit_vbox(hd, gc) split_dir_whatsit = hd elseif gc=='split_off' then - for bh in traverse_id(id_whatsit, hd) do - if getsubtype(bh)==sid_user and getfield(bh, 'user_id')==DIR then - ltjs.list_dir = has_attr(bh, attr_dir); break - end + if split_dir_head then + list_dir = has_attr(split_dir_head, attr_dir) + hd = insert_before(hd, hd, split_dir_head) end if split_dir_whatsit then -- adjust direction of 'split_keep' @@ -1070,7 +1087,7 @@ do [get_box_dir(b, dir_yoko)%dir_math_mod][new_dir][getid(b)]) do local cmd, arg, nn = v[1], v[2] if cmd=='kern' then - nn = node_new(id_kern) + nn = node_new(id_kern, 1) setfield(nn, 'kern', arg(w, h, d, dn_w, dn_h, dn_d)) elseif cmd=='whatsit' then nn = node_new(id_whatsit, arg) -- cgit v1.2.3