%
\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
\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
\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
\def\endarray{\crcr\egroup\egroup\@end@alignbox}
\def\endtabular{\endarray$\egroup}
\expandafter \let \csname endtabular*\endcsname = \endtabular
+% コミュニティ版では、アスキー版で不自然だった表組(array環境およびtabular環境)と
+% 周囲の本文との揃え位置を修正し、以下のように設計しました。
+% \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@array@option<#1>[#2]{%
\ifnum\ltjgetparameter{direction}=4 % yoko
\ifx\box@dir\yoko
\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
\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
\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
\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