summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/luatex/luatexja/addons
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/luatex/luatexja/addons')
-rw-r--r--Master/texmf-dist/tex/luatex/luatexja/addons/luatexja-ruby.sty52
1 files changed, 36 insertions, 16 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 518d6ec8bd8..7c1a939e6d5 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}[2017/09/26 v0.23a]
+\ProvidesPackage{luatexja-ruby}[2020-10-05 v0.3]
\RequirePackage{luatexja}
%%------------------
@@ -67,6 +67,14 @@
\ltj@@rkeydef{fontcmd}%% フォント
\define@boolkey[ltj]{ruby}{rubysmash}[true]{}
+\ltj@@rkeydef{ybaseheight} % 縦組以外 (yoko, utod, dtou)
+\ltj@@rkeydef{tbaseheight} % 縦組
+\define@key[ltj]{ruby}{baseheight}{%
+ \expandafter\def\csname ltj@@rubyip@ybaseheight\endcsname{#1}%
+ \expandafter\def\csname ltj@@rubyip@tbaseheight\endcsname{#1}%
+}
+
+%% これらの値が正のとき,親文字の高さをこの値(\zh 単位)とみなす
%%%%%%%% setkeys の別名
\protected\def\ltjsetruby{\setkeys[ltj]{ruby}}
@@ -89,15 +97,17 @@
maxmargin = \ltj@safe@dimen{\ltj@@rubyip@maxmargin\zw},
pre = \ltj@safe@dimen{\ltj@@rubyip@pre#1},
post = \ltj@safe@dimen{\ltj@@rubyip@post#1},
- intergap = \ltj@safe@dimen{\ltj@@rubyip@intergap\zw},
+ intergap = \ltj@safe@dimen{\ltj@@rubyip@intergap\zh},
stretch
= 262144 * \expandafter\ltj@@ruby@cts\ltj@@rubyip@stretchbol
+ 512 * \expandafter\ltj@@ruby@cts\ltj@@rubyip@stretcheol
+ \expandafter\ltj@@ruby@cts\ltj@@rubyip@stretch,
mode
- = 2097152 * \expandafter\ltj@@ruby@cts\ltj@@rubyip@stretchruby
+ = (2097152 * \expandafter\ltj@@ruby@cts\ltj@@rubyip@stretchruby
+ \ltj@safe@num{\ltj@@rubyip@mode}
- + 1048576 * \ifltj@ruby@rubysmash1\else0\fi
+ + 1048576 * \ifltj@ruby@rubysmash1\else0\fi),
+ baseheight = \ltj@safe@dimen{\ifnum\ltjgetparameter{direction}=3
+ \ltj@@rubyip@tbaseheight\else\ltj@@rubyip@ybaseheight\fi\zh},
\string}
}
%%%
@@ -186,17 +196,27 @@
\ltjsetparameter{rubypreintrusion={\the\count@,1},
rubypostintrusion={\the\count@,1}}
\advance\count@1\repeat
-%% 「」
-\ltjsetparameter{rubypreintrusion={`「,1},
- rubypostintrusion={`」,1}}
-%% ,、
-\ltjsetparameter{rubypreintrusion={`,,1},
- rubypostintrusion={`,,1}}
-\ltjsetparameter{rubypreintrusion={`、,1},
- rubypostintrusion={`、,1}}
-%% ・
-\ltjsetparameter{rubypreintrusion={`・,1},
- rubypostintrusion={`・,1}}
+%% カタカナ
+\count@="30A0\loop\relax\ifnum \count@<"3100
+ \ltjsetparameter{rubypreintrusion={\the\count@,1},
+ rubypostintrusion={\the\count@,1}}
+ \advance\count@1\repeat
+%% Kana Supplement
+\count@="1B000\loop\relax\ifnum \count@<"1B170
+ \ltjsetparameter{rubypreintrusion={\the\count@,1},
+ rubypostintrusion={\the\count@,1}}
+ \advance\count@1\repeat
+%% 開き括弧・閉じ括弧
+\@for\@tmp:=`\‘,`\“,`\〈,`\《,`\「,`\『,`\【,`\〔,`\〖,`\〘,`\〝,`\(,`\[,`\{,`\⦅ \do
+ {\ltjsetparameter{rubypreintrusion={\@tmp,1}}}
+\@for\@tmp:=`\’,`\”,`\〉,`\》,`\」,`\』,`\】,`\〕,`\〗,`\〙,`\〟,`\),`\],`\},`\⦆ \do
+ {\ltjsetparameter{rubypostintrusion={\@tmp,1}}}
+%% 中点類
+\@for\@tmp:=`\・,`\:,`\;,`\―,`\‥,`\…,`〳,`\〴,`\〵,"2014 \do
+ {\ltjsetparameter{rubypreintrusion={\@tmp,1},rubypostintrusion={\@tmp,1}}}
+%% 読点・句点
+\@for\@tmp:=`\、,`\,,`\。,`\. \do
+ {\ltjsetparameter{rubypostintrusion={\@tmp,1}}}
%% 段落インデント部分
\ltjsetparameter{rubypreintrusion={-1,1}}
@@ -205,7 +225,7 @@
stretchruby={1}{2}{1}, stretch = {1}{2}{1},
stretchbol={0}{1}{1}, stretcheol={1}{1}{0},
maxmargin=0.5, size=0.5, intergap=0, rubysmash=false,
- kenten=\ltjalchar`•, fontcmd=\relax
+ kenten=\ltjalchar`•, fontcmd=\relax, ybaseheight=0.88, tbaseheight=0.5
}
\endinput