• R/O
  • HTTP
  • SSH
  • HTTPS

luatexja: コミット

ソースコードの管理場所


コミットメタ情報

リビジョン08bdf852d967522a4cb546c75971c9c2a527ade1 (tree)
日時2020-10-05 07:18:52
作者Hironori Kitagawa <h_kitagawa2001@yaho...>
コミッターHironori Kitagawa

ログメッセージ

luatexja-ruby: bugfix

変更サマリ

差分

--- a/doc/luatexja-ruby.tex
+++ b/doc/luatexja-ruby.tex
@@ -42,6 +42,8 @@
4242 HaranoAjiMincho-Regular:extend=0.67;jfm=ujisc33}{}
4343
4444 \title{\textsf{luatexja-ruby}パッケージ}
45+\author{\LuaTeX-jaプロジェクトチーム}
46+\date{\texttt{\csname ver@luatexja-ruby.sty\endcsname}(\today)}
4547 \begin{document}
4648 \catcode`\<=13
4749 \def<#1>{{\rmfamily\mdseries\itshape$\langle$#1\/$\rangle$}}
@@ -116,6 +118,7 @@ plain \LuaTeX でのロードはまだサポートしておらず,
116118 \]
117119 \end{description}
118120
121+ \typeout{AAAA}
119122 組み方の具体例を実際に示す.例示のため,平仮名にはルビが1字まで,「立」にはルビを
120123 0.5字分までかけてよいことにしている.
121124 \begin{description}
@@ -131,7 +134,10 @@ plain \LuaTeX でのロードはまだサポートしておらず,
131134 \quad は\ltjruby{聴衆}{ちようしゆう}と\quad
132135 は\ltjruby{暁}{あかつき}立\quad
133136 は\ltjruby{聴衆}{ちようしゆう}立\par}
134-\item[10]{\setkeys[ltj]{ruby}{mode=9}%
137+\item[10]{%
138+ \typeout{MODE: \csname ltj@@rubyip@mode\endcsname.}%
139+ \setkeys[ltj]{ruby}{mode=9}%
140+ \typeout{MODE: \csname ltj@@rubyip@mode\endcsname.}%
135141 \ltjsetparameter{rubypreintrusion={`立,0.5}, rubypostintrusion={`立,0.5}}%
136142 は\ltjruby{美}{うつく}しい
137143 \quad は\ltjruby{聴衆}{ちようしゆう}と\quad
@@ -363,15 +369,15 @@ mode=9, stretch={1}{2}{1}, stretchruby={0}{0}{1}
363369 -\underbrace{0.25\,\mathrm{zw}}_{\text{前のルビの後側進入量(行中形)}}=0.25\,\mathrm{zw}
364370 \]
365371 となる.行分割後,「\ltjruby{陵}{りよう}」の実際の後側進入量は
366-auxファイルに記述される.
367-\item 2回目以降の実行では,auxファイルに保存された「\ltjruby{陵}{りよう}」の後側進入量
372+<jobname>\texttt{.ltjruby}ファイルに記述される.
373+\item 2回目以降の実行では,<jobname>\texttt{.ltjruby}ファイルに保存された「\ltjruby{陵}{りよう}」の後側進入量
368374 を用いて,「\ltjruby{陵}{みささぎ}」前側進入許容量を次のように計算する:
369375 \[
370376 \underbrace{0.5\,\mathrm{zw}}_{\text{元々の許容量}}
371--\underbrace{0.25\,\mathrm{zw}}_{\text{前のルビの後側進入量 (from aux)}}=0.25\,\mathrm{zw}.
377+-\underbrace{0.25\,\mathrm{zw}}_{\text{前のルビの後側進入量 (from \texttt{.ltjruby})}}=0.25\,\mathrm{zw}.
372378 \]
373379 \end{enumerate}
374-auxファイルに保存する際,各 \verb+\ltjruby+ 命令の呼び出しを識別するキーが必要になるが,
380+<jobname>\texttt{.ltjruby}ファイルに保存する際,各 \verb+\ltjruby+ 命令の呼び出しを識別するキーが必要になるが,
375381 そのキーとしては単純に「何個目の \verb+\ltjruby+ 命令か」である.
376382
377383 なお,以上の処理は,1行目と2行目を比較すれば分かるように,
--- a/src/addons/luatexja-ruby.sty
+++ b/src/addons/luatexja-ruby.sty
@@ -4,7 +4,7 @@
44
55 % LaTeX only!
66 \NeedsTeXFormat{LaTeX2e}
7-\ProvidesPackage{luatexja-ruby}[2020-10-04 v0.3]
7+\ProvidesPackage{luatexja-ruby}[2020-10-05 v0.3]
88 \RequirePackage{luatexja}
99
1010 %%------------------
@@ -96,9 +96,9 @@
9696 + 512 * \expandafter\ltj@@ruby@cts\ltj@@rubyip@stretcheol
9797 + \expandafter\ltj@@ruby@cts\ltj@@rubyip@stretch,
9898 mode
99- = 2097152 * \expandafter\ltj@@ruby@cts\ltj@@rubyip@stretchruby
99+ = (2097152 * \expandafter\ltj@@ruby@cts\ltj@@rubyip@stretchruby
100100 + \ltj@safe@num{\ltj@@rubyip@mode}
101- + 1048576 * \ifltj@ruby@rubysmash1\else0\fi,
101+ + 1048576 * \ifltj@ruby@rubysmash1\else0\fi),
102102 baseheight = \ltj@safe@dimen{\ltj@@rubyip@baseheight\zh},
103103 \string}
104104 }
--- a/src/ltj-ruby.lua
+++ b/src/ltj-ruby.lua
@@ -358,16 +358,17 @@ end
358358 local max_margin
359359 local function new_ruby_box(r, p, tmp_tbl)
360360 local post_intrusion = 0
361- local imode = tmp_tbl.imode
361+ local imode
362362 local ppre, pmid, ppost = tmp_tbl.ppre, tmp_tbl.pmid, tmp_tbl.ppost
363363 local mapre, mapost = tmp_tbl.mapre, tmp_tbl.mapost
364364 local rpre, rmid, rpost, rsmash
365- imode = floor(imode/262144); rsmash = (imode%2 ==1)
365+ imode = floor(tmp_tbl.imode/0x100000); rsmash = (imode%2 ==1)
366366 imode = floor(imode/2); rpost = imode%8;
367367 imode = (imode-rpost)/8; rmid = imode%8;
368368 imode = (imode-rmid)/8; rpre = imode%8
369369 if getfield(r, 'width') > getfield(p, 'width') then -- change the width of p
370- r, p, post_intrusion = enlarge_parent(r, p, tmp_tbl, imode%4)
370+ r, p, post_intrusion = enlarge_parent(r, p, tmp_tbl,
371+ floor(tmp_tbl.imode/4)%4)
371372 elseif getfield(r, 'width') < getfield(p, 'width') then -- change the width of r
372373 r = enlarge(r, getfield(p, 'width'), rpre, rmid, rpost, 0, 0)
373374 post_intrusion = 0
@@ -430,7 +431,7 @@ pre_low_cal_box = function (w, cmp)
430431 local coef = {} -- 連立一次方程式の拡大係数行列
431432 local rtb = expand_3bits(has_attr(wv, attr_ruby_stretch))
432433 tmp_tbl.rgap = has_attr(wv, attr_ruby_intergap)
433- tmp_tbl.imode = floor(has_attr(wv, attr_ruby_mode)/4)
434+ tmp_tbl.imode = has_attr(wv, attr_ruby_mode)
434435 tmp_tbl.bheight = has_attr(wv, attr_ruby_baseheight)
435436
436437 -- node list 展開・行末形の計算
@@ -560,7 +561,7 @@ local function pre_high(ahead)
560561 local n = first_whatsit(head)
561562 while n do
562563 if getsubtype(n) == sid_user and getfield(n, 'user_id') == RUBY_PRE then
563- local around_skip = get_around_skip(head, n)
564+-- local around_skip = get_around_skip(head, n)
564565 local nv = getfield(n, 'value')
565566 max_allow_pre = has_attr(nv, attr_ruby_maxprep) or 0
566567 local atr = has_attr(n, attr_ruby) or 0
旧リポジトリブラウザで表示