diff options
Diffstat (limited to 'Master/texmf-dist/tex/luatex/luatexja/addons/luatexja-ruby.sty')
-rw-r--r-- | Master/texmf-dist/tex/luatex/luatexja/addons/luatexja-ruby.sty | 62 |
1 files changed, 32 insertions, 30 deletions
diff --git a/Master/texmf-dist/tex/luatex/luatexja/addons/luatexja-ruby.sty b/Master/texmf-dist/tex/luatex/luatexja/addons/luatexja-ruby.sty index 1e50b1f680c..e24164d1b6a 100644 --- a/Master/texmf-dist/tex/luatex/luatexja/addons/luatexja-ruby.sty +++ b/Master/texmf-dist/tex/luatex/luatexja/addons/luatexja-ruby.sty @@ -4,7 +4,7 @@ % LaTeX only! \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{luatexja-ruby}[2022-07-03 v0.53] +\ProvidesPackage{luatexja-ruby}[2023-01-21 v0.61] \RequirePackage{luatexja} %%------------------ @@ -32,14 +32,16 @@ %% attr_ruby_mode %% bit 0: intrusion を有効にするか(1: 有効) %% bit 1: 前後の intrusion 許容量を小さい方に揃える (1: yes) -%% bit 2, 3: intrusion をどう使って親文字を配置するか -%% 00: intrusion なしでとりあえず計算し,左右の突出分を進入に割り当てる -%% 01: pre-intrusion でまかなえるだけまかない,無理なら post- も使う -%% 10: post を優先 -%% 11: 2 min (pre,post) までは pre, post に均等配分しようとする -%% >=01 で,intrusion で賄えきれなかった場合はいつものように伸長する. -%% bit 4: 熟語ルビの際の処理方法(0: 常にグループ,1: 可能な限りブロックごとに) -%% ↑bit 4 は今は無効 +%% bit 2--4: intrusion をどう使って親文字を配置するか +%% 00: intrusion なしでとりあえず計算し,左右の突出分を進入に割り当てる +%% 01: pre-intrusion でまかなえるだけまかない,無理なら post- も使う +%% 10: post を優先 +%% 11: 2 min (pre,post) までは pre, post に均等配分しようとする +%% 100: 2 min (pre,post) までは pre, post に均等配分. +%% それでだめでも pre, post でまかなえるまでまかなう +%% ※ 01--100 で,intrusion で賄えきれなかった場合はいつものように伸長する. +%% bit 5: 熟語ルビの際の処理方法(0: 常にグループ,1: 可能な限りブロックごとに) +%% ↑bit 5 は今は無効 \ltj@@rkeydef{mode} %% intrusion 量強制固定(bit 0, bit 1 より優先,負数で「自動」) %% attr は sp 単位だが,ユーザーはルビ全角単位で指定する @@ -153,36 +155,36 @@ %%%%%%%% ZR さんの PXrubrica パッケージ中のコードから引用・改変 % \pxrr@decompbar: a|bc -> \ltj@@ruby@mark{a}\ltj@@ruby@mark{bc} -\let\pxrr@res\empty -\def\pxrr@ifx#1{% +\let\ltj@@ruby@res\empty +\def\ltj@@ruby@ifx#1{% \ifx#1\expandafter\@firstoftwo \else\expandafter\@secondoftwo \fi } -\def\pxrr@nil{\noexpand\pxrr@nil} -\def\pxrr@end{\noexpand\pxrr@end} -\def\pxrr@appto#1#2{% +\def\ltj@@ruby@nil{\noexpand\ltj@@ruby@nil} +\def\ltj@@ruby@end{\noexpand\ltj@@ruby@end} +\def\ltj@@ruby@appto#1#2{% \expandafter\def\expandafter#1\expandafter{#1#2}% } -\def\pxrr@decompbar#1{% - \let\pxrr@res\@empty - \pxrr@decompbar@loopa\pxrr@nil#1|\pxrr@end|% +\def\ltj@@ruby@decompbar#1{% + \let\ltj@@ruby@res\@empty + \ltj@@ruby@decompbar@loopa\ltj@@ruby@nil#1|\ltj@@ruby@end|% } -\def\pxrr@decompbar@loopa#1|{% - \expandafter\pxrr@decompbar@loopb\expandafter{\@gobble#1}% +\def\ltj@@ruby@decompbar@loopa#1|{% + \expandafter\ltj@@ruby@decompbar@loopb\expandafter{\@gobble#1}% } -\def\pxrr@decompbar@loopb#1{% - \pxrr@decompbar@loopc#1\relax\pxrr@nil{#1}% +\def\ltj@@ruby@decompbar@loopb#1{% + \ltj@@ruby@decompbar@loopc#1\relax\ltj@@ruby@nil{#1}% } -\def\pxrr@decompbar@loopc#1#2\pxrr@nil#3{% - \pxrr@ifx{#1\pxrr@end}{}{% - \ifx\pxrr@res\@empty - \def\pxrr@res{\ltj@@ruby@mark}% +\def\ltj@@ruby@decompbar@loopc#1#2\ltj@@ruby@nil#3{% + \ltj@@ruby@ifx{#1\ltj@@ruby@end}{}{% + \ifx\ltj@@ruby@res\@empty + \def\ltj@@ruby@res{\ltj@@ruby@mark}% \else - \pxrr@appto\pxrr@res{\ltj@@ruby@mark}% + \ltj@@ruby@appto\ltj@@ruby@res{\ltj@@ruby@mark}% \fi - \pxrr@appto\pxrr@res{{#3}}% - \pxrr@decompbar@loopa\pxrr@nil + \ltj@@ruby@appto\ltj@@ruby@res{{#3}}% + \ltj@@ruby@decompbar@loopa\ltj@@ruby@nil }% } %%%%%%%% ここまで @@ -200,8 +202,8 @@ luatexja.ruby.ruby_tmplist_p = \string{\string}}% \leavevmode\dimen0=\f@size pt\dimen1=\ltj@@rubyip@size\dimen0% % 引数展開,テーブルにセット - \pxrr@decompbar{#2}{\let\ltj@@ruby@mark\ltj@@ruby@sp\pxrr@res}% - \pxrr@decompbar{#3}{\let\ltj@@ruby@mark\ltj@@ruby@sr\pxrr@res}% + \ltj@@ruby@decompbar{#2}{\let\ltj@@ruby@mark\ltj@@ruby@sp\ltj@@ruby@res}% + \ltj@@ruby@decompbar{#3}{\let\ltj@@ruby@mark\ltj@@ruby@sr\ltj@@ruby@res}% {\fontsize{\ltj@@rubyip@size\dimen0}\z@\selectfont\ltj@@rubyip@fontcmd \global\dimen1=\zw\global\dimen2=\zh}% \directlua{% |