From 35abc8d5257bf4a8dd76354b821b22fb8fb5e135 Mon Sep 17 00:00:00 2001 From: Hironori Kitagawa Date: Sun, 17 May 2020 21:21:11 +0900 Subject: [PATCH] Babel 3.44 inserts \textdir --- src/ltj-direction.lua | 6 +++++- src/luatexja.lua | 3 +++ src/luatexja.sty | 2 +- test/test32-babel.tex | 16 ++++++++++++++++ 4 files changed, 25 insertions(+), 2 deletions(-) create mode 100644 test/test32-babel.tex diff --git a/src/ltj-direction.lua b/src/ltj-direction.lua index e97da05..7dd0dee 100644 --- a/src/ltj-direction.lua +++ b/src/ltj-direction.lua @@ -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", diff --git a/src/luatexja.lua b/src/luatexja.lua index df1b57d..1b3bd81 100644 --- a/src/luatexja.lua +++ b/src/luatexja.lua @@ -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 diff --git a/src/luatexja.sty b/src/luatexja.sty index 68b11f7..da8ecf7 100644 --- a/src/luatexja.sty +++ b/src/luatexja.sty @@ -41,7 +41,7 @@ \ProcessOptions\relax \fi % %%%% 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 index 0000000..54bb2fa --- /dev/null +++ b/test/test32-babel.tex @@ -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} -- 2.11.0