summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/luatex/luatexja/lltjext.sty
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2017-05-05 22:50:45 +0000
committerKarl Berry <karl@freefriends.org>2017-05-05 22:50:45 +0000
commita99860c7820133400dc5b3c3e7e165627f2c6298 (patch)
tree2aeec817f4184ab0e11145731771dbff492c89cd /Master/texmf-dist/tex/luatex/luatexja/lltjext.sty
parentaf94f399b2a355396d222eb693423beb6294a683 (diff)
luatexja (5may17)
git-svn-id: svn://tug.org/texlive/trunk@44217 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/luatex/luatexja/lltjext.sty')
-rw-r--r--Master/texmf-dist/tex/luatex/luatexja/lltjext.sty112
1 files changed, 73 insertions, 39 deletions
diff --git a/Master/texmf-dist/tex/luatex/luatexja/lltjext.sty b/Master/texmf-dist/tex/luatex/luatexja/lltjext.sty
index 2e48f319973..cc8f8a4c4c8 100644
--- a/Master/texmf-dist/tex/luatex/luatexja/lltjext.sty
+++ b/Master/texmf-dist/tex/luatex/luatexja/lltjext.sty
@@ -3,7 +3,7 @@
%
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{lltjext}[2017/03/28 v1.2f-ltj-5 Macros for vertical writing]
+\ProvidesPackage{lltjext}[2017/05/05 v1.2g-ltj-5 Macros for vertical writing]
\RequirePackage{luatexja}
{\catcode`\*=11
@@ -78,36 +78,35 @@
% \begin{itemize}
% \item 周囲の組方向が横組かつ組方向が|<y>|, |<z>|指定の場合
% \begin{itemize}
-% \item |[t]|指定のとき、\\一行目のベースラインが周囲のそれと一致(罫線の場合は和文ベースラインの位置)
-% \item |[c]|指定のとき、\\表組の中心が周囲の数式軸を通る(欧文ベースラインシフトの影響下)
-% \item |[b]|指定のとき、\\最終行のベースラインが周囲のそれと一致(罫線の場合は和文ベースラインの位置)
+% \item |[t]|指定のとき\\一行目のベースラインが周囲のそれと一致(罫線の場合は和文ベースラインの位置)
+% \item |[c]|指定のとき\\表組の中心が周囲の数式軸を通る(欧文ベースラインシフトの影響下)
+% \item |[b]|指定のとき\\最終行のベースラインが周囲のそれと一致(罫線の場合は和文ベースラインの位置)
% \end{itemize}
% \item 周囲の組方向が横組かつ組方向が|<t>|指定の場合
% \begin{itemize}
-% \item |[t]|指定のとき、\\表組の上端が周囲の和文ベースラインと一致
-% \item |[c]|指定のとき、\\表組の中心が周囲の数式軸を通る(欧文ベースラインシフトの影響下)
-% \item |[b]|指定のとき、\\表組の下端が周囲の和文ベースラインと一致
+% \item |[t]|指定のとき\\表組の上端が周囲の和文ベースラインと一致
+% \item |[c]|指定のとき\\表組の中心が周囲の数式軸を通る(欧文ベースラインシフトの影響下)
+% \item |[b]|指定のとき\\表組の下端が周囲の和文ベースラインと一致
% \end{itemize}
% \item 周囲の組方向が縦組かつ組方向が|<y>|指定の場合
% \begin{itemize}
-% \item |[t]|指定のとき、\\表組の上端が周囲の和文ベースラインと一致
-% \item |[c]|指定のとき、\\表組の中心が周囲の数式軸を通る(欧文ベースラインシフトの影響下)
-% \item |[b]|指定のとき、\\表組の下端が周囲の和文ベースラインと一致
+% \item |[t]|指定のとき\\表組の上端が周囲の和文ベースラインと一致
+% \item |[c]|指定のとき\\表組の中心が周囲の数式軸を通る(欧文ベースラインシフトの影響下)
+% \item |[b]|指定のとき\\表組の下端が周囲の和文ベースラインと一致
% \end{itemize}
% \item 周囲の組方向が縦組かつ組方向が|<t>|指定の場合
% \begin{itemize}
-% \item |[t]|指定のとき、\\一行目のベースラインが周囲のそれと一致(罫線の場合は和文ベースラインの位置)
-% \item |[c]|指定のとき、\\表組の中心が周囲の数式軸を通る(欧文ベースラインシフトの影響下)
-% \item |[b]|指定のとき、\\最終行のベースラインが周囲のそれと一致(罫線の場合は和文ベースラインの位置)
+% \item |[t]|指定のとき\\一行目のベースラインが周囲のそれと一致(罫線の場合は和文ベースラインの位置)
+% \item |[c]|指定のとき\\表組の中心が周囲の数式軸を通る(欧文ベースラインシフトの影響下)
+% \item |[b]|指定のとき\\最終行のベースラインが周囲のそれと一致(罫線の場合は和文ベースラインの位置)
% \end{itemize}
% \item 周囲の組方向が縦組かつ組方向が|<z>|指定の場合
% [TODO] 未定!
%^^A \begin{itemize}
-%^^A \item |[t]|指定のとき、\\表組の上端が周囲の和文ベースラインと一致
-%^^A \item |[c]|指定のとき、\\表組の中心が周囲の数式軸を通る(欧文ベースラインシフトの影響下)
-%^^A \item |[b]|指定のとき、\\表組の下端が周囲の和文ベースラインと一致
+%^^A \item |[t]|指定のとき\\表組の上端が周囲の和文ベースラインと一致
+%^^A \item |[c]|指定のとき\\表組の中心が周囲の数式軸を通る(欧文ベースラインシフトの影響下)
+%^^A \item |[b]|指定のとき\\表組の下端が周囲の和文ベースラインと一致
%^^A \end{itemize}
-% \end{itemize}
\def\fork@array@option<#1>[#2]{%
\ifnum\ltjgetparameter{direction}=4 % yoko
\ifx\box@dir\yoko
@@ -124,10 +123,10 @@
\else
\if #2t\relax
\def\@begin@alignbox{\vtop\bgroup\kern\z@\vbox}%
- \let\@end@alignbox\egroup%
+ \let\@end@alignbox\egroup
\else\if #2b\relax
- \let\@begin@alignbox\vbox
- \let\@end@alignbox\relax
+ \def\@begin@alignbox{\vbox\bgroup\vbox}%
+ \def\@end@alignbox{\kern\z@\egroup}%
\else
\let\@begin@alignbox\vcenter
\let\@end@alignbox\relax
@@ -137,10 +136,10 @@
\ifx\box@dir\yoko
\if #2t\relax
\def\@begin@alignbox{\vtop\bgroup\kern\z@\vbox}%
- \def\@end@alignbox{\egroup}%
+ \let\@end@alignbox\egroup
\else\if #2b\relax
- \let\@begin@alignbox\vbox
- \let\@end@alignbox\relax
+ \def\@begin@alignbox{\vbox\bgroup\vbox}%
+ \def\@end@alignbox{\kern\z@\egroup}%
\else
\let\@begin@alignbox\vcenter
\let\@end@alignbox\relax
@@ -172,7 +171,7 @@
\ifx\box@dir\yoko
\if #2t\relax
\def\@begin@alignbox{\vtop\bgroup\kern\z@\vbox}%
- \def\@end@alignbox{\egroup}%
+ \let\@end@alignbox\egroup
\else\if #2b\relax
\def\@begin@alignbox{\vbox\bgroup\vbox}%
\def\@end@alignbox{\kern\z@\egroup}%
@@ -415,6 +414,41 @@
\let\hss\vss\let\unhbox\unvbox
\csname bm@#4\endcsname}\@end@parbox
\@end@tempboxa}
+% コミュニティ版では、アスキー版で不自然だった|\parbox|の箱と
+% 周囲の本文との揃え位置を修正し、以下のように設計しました。
+% \begin{itemize}
+% \item 周囲の組方向が横組かつ組方向が|<y>|, |<z>|指定の場合
+% \begin{itemize}
+% \item |[t]|指定のとき\\一行目のベースラインが周囲のそれと一致
+% \item |[c]|指定のとき\\箱の中心が周囲の数式軸を通る(欧文ベースラインシフトの影響下)
+% \item |[b]|指定のとき\\最終行のベースラインが周囲のそれと一致
+% \end{itemize}
+% \item 周囲の組方向が横組かつ組方向が|<t>|指定の場合
+% \begin{itemize}
+% \item |[t]|指定のとき\\箱の上端が周囲の和文文字の高さと一致
+% \item |[c]|指定のとき\\箱の中心が周囲の数式軸を通る(欧文ベースラインシフトの影響下)
+% \item |[b]|指定のとき\\箱の下端が周囲の和文文字の深さと一致
+% \end{itemize}
+% \item 周囲の組方向が縦組かつ組方向が|<y>|指定の場合
+% \begin{itemize}
+% \item |[t]|指定のとき\\箱の上端が周囲の和文文字の高さと一致
+% \item |[c]|指定のとき\\箱の中心が周囲の数式軸を通る(欧文ベースラインシフトの影響下)
+% \item |[b]|指定のとき\\箱の下端が周囲の和文文字の深さと一致
+% \end{itemize}
+% \item 周囲の組方向が縦組かつ組方向が|<t>|指定の場合
+% \begin{itemize}
+% \item |[t]|指定のとき\\一行目のベースラインが周囲のそれと一致
+% \item |[c]|指定のとき\\箱の中心が周囲の数式軸を通る(欧文ベースラインシフトの影響下)
+% \item |[b]|指定のとき\\最終行のベースラインが周囲のそれと一致
+% \end{itemize}
+% \item 周囲の組方向が縦組かつ組方向が|<z>|指定の場合
+% [TODO] 未定!
+%^^A \begin{itemize}
+%^^A \item |[t]|指定のとき\\箱の上端が周囲の和文ベースラインと一致
+%^^A \item |[c]|指定のとき\\箱の中心が周囲の数式軸を通る(欧文ベースラインシフトの影響下)
+%^^A \item |[b]|指定のとき\\箱の下端が周囲の和文ベースラインと一致
+%^^A \end{itemize}
+% \end{itemize}
\def\fork@parbox@option<#1>[#2]{%
\let\box@dir\relax
\if #1z\relax
@@ -436,7 +470,6 @@
\else \let\box@dir\utod
\fi
\fi
-%%% now almost same as \fork@array@option
\ifnum\ltjgetparameter{direction}=4 % yoko
\ifx\box@dir\yoko
\if #2t\relax
@@ -455,11 +488,11 @@
\fi\fi
\else
\if #2t\relax
- \def\@begin@parbox{\vtop\bgroup\kern\z@\vbox}%
- \def\@end@parbox{\egroup}%
+ \def\@begin@parbox{\raise\cht\vtop\bgroup\kern\z@\vbox}%
+ \let\@end@parbox\egroup
\else\if #2b\relax
- \let\@begin@parbox\vbox
- \let\@end@parbox\relax
+ \def\@begin@parbox{\lower\cdp\vbox\bgroup\vbox}%
+ \def\@end@parbox{\kern\z@\egroup}%
\else
\ifmmode
\let\@begin@parbox\vcenter\let\@end@parbox\relax
@@ -472,11 +505,11 @@
\else\ifnum\ltjgetparameter{direction}=1 % dtou
\ifx\box@dir\yoko
\if #2t\relax
- \def\@begin@parbox{\vtop\bgroup\kern\z@\vbox}
- \def\@end@parbox{\egroup}
+ \def\@begin@parbox{\raise\cht\vtop\bgroup\kern\z@\vbox}%
+ \let\@end@parbox\egroup
\else\if #2b\relax
- \let\@begin@parbox\vbox
- \let\@end@parbox\relax
+ \def\@begin@parbox{\lower\cdp\vbox\bgroup\vbox}%
+ \def\@end@parbox{\kern\z@\egroup}%
\else
\ifmmode
\let\@begin@parbox\vcenter\let\@end@parbox\relax
@@ -519,10 +552,10 @@
\else % tate, utod
\ifx\box@dir\yoko
\if #2t\relax
- \def\@begin@parbox{\vtop\bgroup\kern\z@\vbox}%
- \def\@end@parbox{\egroup}%
+ \def\@begin@parbox{\raise\cht\vtop\bgroup\kern\z@\vbox}%
+ \let\@end@parbox\egroup
\else\if #2b\relax
- \def\@begin@parbox{\vbox\bgroup\vbox}%
+ \def\@begin@parbox{\lower\cdp\vbox\bgroup\vbox}%
\def\@end@parbox{\kern\z@\egroup}%
\else
\ifmmode
@@ -567,7 +600,7 @@
}
%%% pbox
-\def\pbox{\leavevmode\@ifnextchar<{\X@makePbox}{\X@makePbox<Z>}}
+\DeclareRobustCommand\pbox{\leavevmode\@ifnextchar<{\X@makePbox}{\X@makePbox<Z>}}
\def\X@makePbox<#1>{%
\@ifnextchar[{\@imakePbox<#1>}{\@imakePbox<#1>[-5\p@]}}
\def\@imakePbox<#1>[#2]{\@ifnextchar[%]
@@ -593,8 +626,9 @@
\else \let\box@dir\utod
\fi
\fi
- \ifdim #2 <\z@ \hbox{\box@dir#4}\else
- \hbox to#2{\box@dir
+ \setlength{\@tempdima}{#2}%
+ \ifdim\@tempdima<\z@ \hbox{\box@dir#4}\else
+ \hb@xt@\@tempdima{\box@dir
\if #3l\relax\else\hss\fi
#4\relax
\if #3r\relax\else\hss\fi}\fi\egroup}