OSDN Git Service

Fix ticket #36913
authorHironori Kitagawa <h_kitagawa2001@yahoo.co.jp>
Sat, 31 Dec 2016 05:41:16 +0000 (14:41 +0900)
committerHironori Kitagawa <h_kitagawa2001@yahoo.co.jp>
Sat, 31 Dec 2016 05:41:16 +0000 (14:41 +0900)
src/lltjext.sty
src/ltj-direction.lua

index 02557dc..b814bbe 100644 (file)
@@ -3,7 +3,7 @@
 %
 
 \NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{lltjext}[2015/12/16 v1.2c-ltj-5 Macros for vertical writing]
+\ProvidesPackage{lltjext}[2016/12/16 v1.2c-ltj-5 Macros for vertical writing]
 \RequirePackage{luatexja}
 
 {\catcode`\*=11
index 0947f34..5228662 100644 (file)
@@ -106,14 +106,14 @@ do
       end
    end
    function get_dir_count()
-      for i=tex_nest.ptr, 1, -1 do
-        local h = tex_nest[i].head.next
-        if h then
-           local t = get_dir_count_inner(h)
-           if t~=0 then return t end
-        end
-      end
-      return page_direction
+       for i=tex_nest.ptr, 1, -1 do
+          local h = tex_nest[i].head.next
+          if h then
+              local t = get_dir_count_inner(h)
+              if t~=0 then return t end
+          end
+       end
+       return page_direction
    end
    function get_adjust_dir_count()
       for i=tex_nest.ptr, 1, -1 do
@@ -951,6 +951,9 @@ do
       local list_dir = get_dir_count()
       local a = tex_nest[tex_nest.ptr].tail
       local ad = to_direct(a)
+      if (not a) or getid(ad)~=id_ins then
+         a = node.tail(tex.lists.page_head); ad = to_direct(a)
+      end
       if a and getid(ad)==id_ins then
         local h = getfield(ad, 'head')
         if getid(h)==id_whatsit and