OSDN Git Service

lltjext.sty: <z> option
[luatex-ja/luatexja.git] / src / lltjext.sty
index b814bbe..40d96e1 100644 (file)
@@ -36,7 +36,7 @@
 \def\p@array<#1>[#2]#3{%
   \let\box@dir\relax
   \if #1z\relax
-    \ifnum\ltjgetparameter{direction}=3\relax
+    \ifnum\count@=3\relax
       \let\box@dir\utod\@tempcnta=\zstrutbox
     \fi
   \else
 
 %%% kanji
 \def\Kanji#1{\expandafter\@Kanji\csname c@#1\endcsname}
-\def\@Kanji#1{\expandafter\kansuji\number #1}
+\def\@Kanji#1{\kansuji #1}
 \def\kanji{\ifnum\ltjgetparameter{direction}=3 \expandafter\kansuji\fi}
 
 %%% bou
 
 %%% references
 \def\@eqnnum{{\reset@font\rmfamily \normalcolor
-  \ifnum\ltjgetparameter{direction}=\raise.25\zh\hbox{\yoko(\theequation)}%
+  \ifnum\ltjgetparameter{direction}=11\raise.25\zh\hbox{\yoko(\theequation)}%
   \else (\theequation)\fi}}
 \def\@thecounter#1{\noexpand\rensuji{\noexpand\arabic{#1}}}
 \def\@thmcounter#1{\noexpand\rensuji{\noexpand\arabic{#1}}}
 %% Compatibility with array package
 
 \def\ltj@lltjext@patch@array{%
+  \patchcmd{\@tabular}{\hbox\bgroup}{%
+       \hbox\bgroup\count@=\ltjgetparameter{direction}}{}{}
   \def\@startpbox##1{\bgroup
    \box@dir\adjustbaseline%%% これを追加
    \hsize=##1\@arrayparboxrestore
   \def\p@array<##1>[##2]##3{%
     \let\box@dir\relax
     \if ##1z\relax
-      \ifnum\ltjgetparameter{direction}=3\relax
+      \ifnum\count@=3\relax
         \let\box@dir\utod\@tempcnta=\zstrutbox
       \fi
     \else
       \fi\fi\fi\fi
     \fi
     \ifx\box@dir\relax
-      \ifcase\ltjgetparameter{direction}
+      \ifcase\count@
          \or   \let\box@dir\dtou\@tempcnta=\tabskip \z@\tabskip \z@\dstrutbox% dtou
          \or\or\let\box@dir\tate\@tempcnta=\tstrutbox% tate
          \or   \let\box@dir\yoko\@tempcnta=\strutbox% yoko
                     \bgroup \tabskip \z@skip \@arstrut \@preamble
                             \tabskip \z@ \cr}%
     \endgroup
-    \@arrayleft
+    \@arrayleft\typeout{\meaning\@begin@alignbox, \meaning\box@dir}
     \@begin@alignbox\bgroup\box@dir\adjustbaseline
       \let\par\@empty
       \let\@sharp####\let\protect\relax
   \let\ltj@lltjext@orig@tabularS\relax
   \let\ltj@lltjext@orig@tabular\relax
   \let\ltj@lltjext@orig@array\relax
-  \RequirePackage{filehook}
+  \RequirePackage{filehook,etoolbox}
   \AtEndOfPackageFile{array}{\ltj@lltjext@patch@array}
 }