OSDN Git Service

use \zstrutbox in \utod mode
authorHironori Kitagawa <h_kitagawa2001@yahoo.co.jp>
Wed, 29 Mar 2017 06:39:37 +0000 (15:39 +0900)
committerHironori Kitagawa <h_kitagawa2001@yahoo.co.jp>
Wed, 29 Mar 2017 06:39:37 +0000 (15:39 +0900)
src/lltjext.sty
src/patches/lltjfont.sty

index 75ecb67..2e48f31 100644 (file)
@@ -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
 \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
     \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=\ystrutbox% yoko
          \else \let\box@dir\utod\@tempcnta=\zstrutbox% utod
index 363805e..b15fbc9 100644 (file)
@@ -62,7 +62,7 @@
 \def\strutbox{%
   \ifnum\ltjgetparameter{direction}=1 \dstrutbox       % dtou
   \else\ifnum\ltjgetparameter{direction}=3 \tstrutbox  % tate
-  \else\ifnum\ltjgetparameter{direction}=11 \tstrutbox % utod (tstrutbox)
+  \else\ifnum\ltjgetparameter{direction}=11 \zstrutbox % utod
   \else\ystrutbox % yoko
   \fi\fi\fi
 }
     \ifmmode\copy\dstrutbox\else\unhcopy\dstrutbox\fi
   \else\ifnum\ltjgetparameter{direction}=4 % yoko
     \ifmmode\copy\ystrutbox\else\unhcopy\ystrutbox\fi
-  \else % tate and utod
+  \else\ifnum\ltjgetparameter{direction}=3 % tate
     \ifmmode\copy\tstrutbox\else\unhcopy\tstrutbox\fi
+  \else % utod
+    \ifmmode\copy\zstrutbox\else\unhcopy\zstrutbox\fi
   \fi\fi
 }
 
       \setbox\tstrutbox\hbox{\tate
           \vrule\@width\z@
                 \@height.5\baselineskip \@depth.5\baselineskip}%
-      \setbox\zstrutbox\hbox{\tate
+      \setbox\zstrutbox\hbox{\utod
           \vrule\@width\z@
                 \@height.7\baselineskip \@depth.3\baselineskip}%
      \let\size@update\relax}}