OSDN Git Service

Babel 3.44 inserts \textdir
authorHironori Kitagawa <h_kitagawa2001@yahoo.co.jp>
Sun, 17 May 2020 12:21:11 +0000 (21:21 +0900)
committerHironori Kitagawa <h_kitagawa2001@yahoo.co.jp>
Sun, 17 May 2020 12:21:11 +0000 (21:21 +0900)
src/ltj-direction.lua
src/luatexja.lua
src/luatexja.sty
test/test32-babel.tex [new file with mode: 0644]

index e97da05..7dd0dee 100644 (file)
@@ -139,6 +139,7 @@ do
    local STCK = luatexja.userid_table.STCK
    local IHB = luatexja.userid_table.IHB
    local id_local = node.id('local_par')
+   local id_dir = node.id('dir')
 
    local function test_list(h, lv)
       if not h then
@@ -157,7 +158,7 @@ do
                     flag = 0; break -- error
                  end
               end
-           elseif p.id~=id_local then
+           elseif p.id~=id_local and p.id~=id_dir then
               flag = 0; break
            end
         end
@@ -220,6 +221,9 @@ do
            if lv==0 and not page_direction then
               page_direction = v -- for first call of \yoko (in luatexja-core.sty)
            else
+              if luatexja.debug then
+                luatexja.ext_show_node_list(node.direct.tonode(h),'>> ', texio.write_nl)
+              end
               ltjb.package_error(
                  'luatexja',
                  "Use `\\" .. tostring(name) .. "' at top of list",
index df1b57d..1b3bd81 100644 (file)
@@ -516,6 +516,9 @@ local function debug_show_node_X(p,print_fn, limit, inner_depth)
         s = s .. ' (for kinsoku)'
       end
       print_fn(s)
+   elseif pt == 'dir' then
+      s = base .. ' ' .. tostring(p.dir) .. ' (level ' .. tostring(p.level) .. ')'
+      print_fn(s)
    elseif pt == 'whatsit' then
       s = base
       if p.subtype==sid_user then
index 68b11f7..da8ecf7 100644 (file)
@@ -41,7 +41,7 @@
   \ProcessOptions\relax
 \fi                             %</LaTeX>
 %%%% VERSION
-\def\LuaTeXjaversion{20200517.0}
+\def\LuaTeXjaversion{20200518.0}
 
 \directlua{require('ltj-unicode-ccfix.lua')}% catcode of ideographs
 
diff --git a/test/test32-babel.tex b/test/test32-babel.tex
new file mode 100644 (file)
index 0000000..54bb2fa
--- /dev/null
@@ -0,0 +1,16 @@
+\ifdefined\directlua
+  \directlua{luatexja_debug=1}
+  \documentclass{ltjarticle}
+  \usepackage{luatexja}
+\else
+  \documentclass{jarticle}
+\fi
+%\usepackage[bidi=basic-r]{babel}
+%\babelprovide[import=ar, main]{arabic}
+%\babelfont{rm}{Amiri}
+\usepackage[english]{babel}
+\begin{document}
+あasdfghjklいうえお
+\footnote{\ifdefined\directlua\else\yoko\fi かqwertyuioき}%
+さ/.,mnbvcxzし
+\end{document}