OSDN Git Service

luatexja-ruby: forum:3652
authorHironori Kitagawa <h_kitagawa2001@yahoo.co.jp>
Sun, 8 Oct 2023 07:45:26 +0000 (16:45 +0900)
committerHironori Kitagawa <h_kitagawa2001@yahoo.co.jp>
Sun, 8 Oct 2023 07:45:26 +0000 (16:45 +0900)
src/addons/luatexja-ruby.sty
src/luatexja.lua

index e24164d..d0d8e54 100644 (file)
@@ -4,7 +4,7 @@
 
 % LaTeX only!
 \NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{luatexja-ruby}[2023-01-21 v0.61]
+\ProvidesPackage{luatexja-ruby}[2023-10-08 v0.62]
 \RequirePackage{luatexja}
 
 %%------------------
   \directlua{luatexja.ruby.read_old_break_info()}%
 }
 \protected\def\ltj@@ruby[#1]#2#3{{% #1: option #2: 親文字群,#3: ルビ文字列群,共に| 区切り
-  \setkeys[ltj]{ruby}{#1}%
+  \leavevmode\setkeys[ltj]{ruby}{#1}%
   \directlua{luatexja.ruby.ruby_tmplist_r = \string{\string};
        luatexja.ruby.ruby_tmplist_p = \string{\string}}%
   \leavevmode\dimen0=\f@size pt\dimen1=\ltj@@rubyip@size\dimen0%
 
 \protected\def\ltjkenten{\@ifnextchar[\ltj@@kenten{\ltj@@kenten[]}}%]
 \def\ltj@@kenten[#1]#2{{%
-  \setkeys[ltj]{ruby}{#1, stretchruby=101}%
+  \leavevmode\setkeys[ltj]{ruby}{#1, stretchruby=101}%
   \@tfor\ltj@@kenten@temp:=#2\do{\ltj@@ruby[]{\ltj@@kenten@temp}{\ltj@@rubyip@kenten}}%
 }}
 
index f453658..1013684 100644 (file)
@@ -424,7 +424,8 @@ local function debug_show_node_X(p,print_fn, limit, inner_depth)
    local k = prefix
    local s
    local pt, pic = node_type(p.id), (get_attr(p, attr_icflag) or 0) % icflag_table.PROCESSED_BEGIN_FLAG
-   local base = prefix .. string.format('%X', pic) .. ' ' .. pt .. ' ' .. tostring(p.subtype) .. ' '
+   local base = prefix .. '[' .. string.format('%7d', node.direct.todirect(p)) .. '] ' ..
+     string.format('%X', pic) .. ' ' .. pt .. ' ' .. tostring(p.subtype) .. ' '
    if pt == 'glyph' then
       s = base .. ' '
           .. (p.char<0xF0000 and utfchar(p.char) or '')
@@ -531,7 +532,7 @@ local function debug_show_node_X(p,print_fn, limit, inner_depth)
          local t = tostring(p.user_id) .. ' (' ..
             luatexbase.get_user_whatsit_name(p.user_id) .. ') '
          if p.type ~= 110 then
-            s = s .. ' userid:' .. t .. p.value
+            s = s .. ' userid:' .. t .. tostring(p.value)
             print_fn(s)
          else
             s = s .. ' userid:' .. t .. '(node list)'