From 5112bfa157654c21370044635eb59293b8c8d895 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sat, 1 Apr 2017 20:57:19 +0000 Subject: luatexja (1apr17) git-svn-id: svn://tug.org/texlive/trunk@43671 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/tex/luatex/luatexja/lltjext.sty | 123 +++++++++++++++++----- 1 file changed, 95 insertions(+), 28 deletions(-) (limited to 'Master/texmf-dist/tex/luatex/luatexja/lltjext.sty') diff --git a/Master/texmf-dist/tex/luatex/luatexja/lltjext.sty b/Master/texmf-dist/tex/luatex/luatexja/lltjext.sty index 7a445f5d7d5..2e48f319973 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}[2016/12/16 v1.2c-ltj-5 Macros for vertical writing] +\ProvidesPackage{lltjext}[2017/03/28 v1.2f-ltj-5 Macros for vertical writing] \RequirePackage{luatexja} {\catcode`\*=11 @@ -41,7 +41,7 @@ \fi \else \if #1y\relax - \let\box@dir\yoko\@tempcnta=\strutbox + \let\box@dir\yoko\@tempcnta=\ystrutbox \else\if #1t\relax \let\box@dir\tate\@tempcnta=\tstrutbox \else\if #1d\relax @@ -54,7 +54,7 @@ \ifcase\count@ \or \let\box@dir\dtou\@tempcnta=\dstrutbox% dtou \or\or\let\box@dir\tate\@tempcnta=\tstrutbox% tate - \or \let\box@dir\yoko\@tempcnta=\strutbox% yoko + \or \let\box@dir\yoko\@tempcnta=\ystrutbox% yoko \else \let\box@dir\utod\@tempcnta=\zstrutbox% utod \fi \fi @@ -73,6 +73,41 @@ \def\endarray{\crcr\egroup\egroup\@end@alignbox} \def\endtabular{\endarray$\egroup} \expandafter \let \csname endtabular*\endcsname = \endtabular +% コミュニティ版では、アスキー版で不自然だった表組(array環境およびtabular環境)と +% 周囲の本文との揃え位置を修正し、以下のように設計しました。 +% \begin{itemize} +% \item 周囲の組方向が横組かつ組方向が||, ||指定の場合 +% \begin{itemize} +% \item |[t]|指定のとき、\\一行目のベースラインが周囲のそれと一致(罫線の場合は和文ベースラインの位置) +% \item |[c]|指定のとき、\\表組の中心が周囲の数式軸を通る(欧文ベースラインシフトの影響下) +% \item |[b]|指定のとき、\\最終行のベースラインが周囲のそれと一致(罫線の場合は和文ベースラインの位置) +% \end{itemize} +% \item 周囲の組方向が横組かつ組方向が||指定の場合 +% \begin{itemize} +% \item |[t]|指定のとき、\\表組の上端が周囲の和文ベースラインと一致 +% \item |[c]|指定のとき、\\表組の中心が周囲の数式軸を通る(欧文ベースラインシフトの影響下) +% \item |[b]|指定のとき、\\表組の下端が周囲の和文ベースラインと一致 +% \end{itemize} +% \item 周囲の組方向が縦組かつ組方向が||指定の場合 +% \begin{itemize} +% \item |[t]|指定のとき、\\表組の上端が周囲の和文ベースラインと一致 +% \item |[c]|指定のとき、\\表組の中心が周囲の数式軸を通る(欧文ベースラインシフトの影響下) +% \item |[b]|指定のとき、\\表組の下端が周囲の和文ベースラインと一致 +% \end{itemize} +% \item 周囲の組方向が縦組かつ組方向が||指定の場合 +% \begin{itemize} +% \item |[t]|指定のとき、\\一行目のベースラインが周囲のそれと一致(罫線の場合は和文ベースラインの位置) +% \item |[c]|指定のとき、\\表組の中心が周囲の数式軸を通る(欧文ベースラインシフトの影響下) +% \item |[b]|指定のとき、\\最終行のベースラインが周囲のそれと一致(罫線の場合は和文ベースラインの位置) +% \end{itemize} +% \item 周囲の組方向が縦組かつ組方向が||指定の場合 +% [TODO] 未定! +%^^A \begin{itemize} +%^^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 @@ -89,7 +124,7 @@ \else \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 @@ -262,7 +297,7 @@ \csname \@captype @layoutcaption\endcsname \fi \@tempswafalse - % tempswa\hline 基本組の組方向とキャプションの組方向が直交するか? + % \@tempswa: 基本組の組方向とキャプションの組方向が直交するか? \if y\caption@dir \let\captiondir\yoko \ifodd\ltjgetparameter{direction}\relax\@tempswatrue\fi \else\if z\caption@dir \let\captiondir\relax @@ -358,7 +393,7 @@ \color@endgroup \egroup \expandafter\@iiiparbox\@mpargs{\unvbox\@tempboxa}\egroup} -\def\parbox{\@ifnextchar<%> +\DeclareRobustCommand\parbox{\@ifnextchar<%> {\X@parbox}{\X@parbox}} \def\X@parbox<#1>{\@ifnextchar[%] {\@iparbox<#1>}{\@iiiparbox<#1>{c}\relax[s]}} @@ -367,19 +402,19 @@ \def\@iiparbox<#1>#2[#3]{\@ifnextchar[%]% {\@iiiparbox<#1>{#2}{#3}}{\@iiiparbox<#1>{#2}{#3}[#2]}} \long\def\@iiiparbox<#1>#2#3[#4]#5#6{% - \leavevmode\bgroup + \leavevmode \setlength\@tempdima{#5}% \fork@parbox@option<#1>[#2]% \@begin@tempboxa\vbox{\box@dir \hsize\@tempdima\@parboxrestore\adjustbaseline#6\@@par}% - \ifx\relax#3\relax\else + \ifx\relax#3\else \setlength\@tempdimb{#3}% \edef\@parboxto{to\the\@tempdimb}% \fi \@begin@parbox\@parboxto{\box@dir\adjustbaseline \let\hss\vss\let\unhbox\unvbox \csname bm@#4\endcsname}\@end@parbox - \@end@tempboxa\egroup} + \@end@tempboxa} \def\fork@parbox@option<#1>[#2]{% \let\box@dir\relax \if #1z\relax @@ -411,8 +446,12 @@ \let\@begin@parbox\vbox \let\@end@parbox\relax \else - \def\@begin@parbox{$\vcenter}% - \def\@end@parbox{\m@th$}% + \ifmmode + \let\@begin@parbox\vcenter\let\@end@parbox\relax + \else + \def\@begin@parbox{\null$\vcenter}% + \def\@end@parbox{\m@th$\null}% + \fi \fi\fi \else \if #2t\relax @@ -422,8 +461,12 @@ \let\@begin@parbox\vbox \let\@end@parbox\relax \else - \def\@begin@parbox{$\vcenter}% - \def\@end@parbox{\m@th$}% + \ifmmode + \let\@begin@parbox\vcenter\let\@end@parbox\relax + \else + \def\@begin@parbox{\null$\vcenter}% + \def\@end@parbox{\m@th$\null}% + \fi \fi\fi \fi \else\ifnum\ltjgetparameter{direction}=1 % dtou @@ -435,8 +478,12 @@ \let\@begin@parbox\vbox \let\@end@parbox\relax \else - \def\@begin@parbox{$\vcenter}% - \def\@end@parbox{\m@th$}% + \ifmmode + \let\@begin@parbox\vcenter\let\@end@parbox\relax + \else + \def\@begin@parbox{\null$\vcenter}% + \def\@end@parbox{\m@th$\null}% + \fi \fi\fi \else\ifx\box@dir\dtou \if #2t\relax @@ -446,8 +493,12 @@ \let\@begin@parbox\vbox \let\@end@parbox\relax \else - \def\@begin@parbox{$\vcenter}% - \def\@end@parbox{\m@th$}% + \ifmmode + \let\@begin@parbox\vcenter\let\@end@parbox\relax + \else + \def\@begin@parbox{\null$\vcenter}% + \def\@end@parbox{\m@th$\null}% + \fi \fi\fi \else % 180 度回転→vtop, vbox を入れ替える \if #2t\relax @@ -457,8 +508,12 @@ \let\@begin@parbox\vtop %%% !!! \let\@end@parbox\relax \else - \def\@begin@parbox{$\vcenter}% - \def\@end@parbox{\m@th$}% + \ifmmode + \let\@begin@parbox\vcenter\let\@end@parbox\relax + \else + \def\@begin@parbox{\null$\vcenter}% + \def\@end@parbox{\m@th$\null}% + \fi \fi\fi \fi\fi \else % tate, utod @@ -470,8 +525,12 @@ \def\@begin@parbox{\vbox\bgroup\vbox}% \def\@end@parbox{\kern\z@\egroup}% \else - \def\@begin@parbox{$\vcenter}% - \def\@end@parbox{\m@th$}% + \ifmmode + \let\@begin@parbox\vcenter\let\@end@parbox\relax + \else + \def\@begin@parbox{\null$\vcenter}% + \def\@end@parbox{\m@th$\null}% + \fi \fi\fi \else\ifx\box@dir\dtou % 180 度回転→vtop, vbox を入れ替える \if #2t\relax @@ -481,8 +540,12 @@ \let\@begin@parbox\vtop %%% !!! \let\@end@parbox\relax \else - \def\@begin@parbox{$\vcenter}% - \def\@end@parbox{\m@th$}% + \ifmmode + \let\@begin@parbox\vcenter\let\@end@parbox\relax + \else + \def\@begin@parbox{\null$\vcenter}% + \def\@end@parbox{\m@th$\null}% + \fi \fi\fi \else \if #2t\relax @@ -492,8 +555,12 @@ \let\@begin@parbox\vbox \let\@end@parbox\relax \else - \def\@begin@parbox{$\vcenter}% - \def\@end@parbox{\m@th$}% + \ifmmode + \let\@begin@parbox\vcenter\let\@end@parbox\relax + \else + \def\@begin@parbox{\null$\vcenter}% + \def\@end@parbox{\m@th$\null}% + \fi \fi\fi \fi\fi \fi\fi% @@ -714,7 +781,7 @@ \fi \else \if ##1y\relax - \let\box@dir\yoko\@tempcnta=\strutbox + \let\box@dir\yoko\@tempcnta=\ystrutbox \else\if ##1t\relax \let\box@dir\tate\@tempcnta=\tstrutbox \else\if ##1d\relax @@ -725,9 +792,9 @@ \fi \ifx\box@dir\relax \ifcase\count@ - \or \let\box@dir\dtou\@tempcnta=\tabskip \z@\tabskip \z@\dstrutbox% dtou + \or \let\box@dir\dtou\@tempcnta=\dstrutbox% dtou \or\or\let\box@dir\tate\@tempcnta=\tstrutbox% tate - \or \let\box@dir\yoko\@tempcnta=\strutbox% yoko + \or \let\box@dir\yoko\@tempcnta=\ystrutbox% yoko \else \let\box@dir\utod\@tempcnta=\zstrutbox% utod \fi \fi -- cgit v1.2.3