Skip to content

Commit

Permalink
plextarray.sty: dir option comes first before width argument (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
aminophen committed Sep 20, 2018
1 parent 4b09f2b commit 9fe518b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 9 deletions.
16 changes: 11 additions & 5 deletions plextarray.sty
Expand Up @@ -9,24 +9,30 @@
% * array.sty in latex-tools
% (2016/10/06 v2.4d -- 2018/09/13 v2.4i)
% * plext.sty in platex
% (2001/09/26 v1.2 -- 2018/09/09 v1.2i)
% (2001/09/26 v1.2 -- 2018/09/20 v1.2j)
% Largely based on lltjext.sty from LuaTeX-ja project.
%

\NeedsTeXFormat{pLaTeX2e}
\ProvidesPackage{plextarray}
[2018/09/18 v1.1b Tabular extension package for plext and array]
[2018/09/20 v1.1c Tabular extension package for plext and array]
\RequirePackage{plext}
\RequirePackage{plarray}

%% save definitions from array.sty
% the <dir> option will be handled later in \@tabarray
\def\array{\col@sep\arraycolsep
\def\d@llarbegin{$}\let\d@llarend\d@llarbegin\def\@halignto{}%
\@tabarray}
\def\tabular{\def\@halignto{}\@tabular}
\expandafter\def\csname tabular*\endcsname#1{%
\setlength\dimen@{#1}%
\edef\@halignto{to\the\dimen@}\@tabular}
%% merged definitions from array.sty and plext.sty
% take <dir> option first as in plext.sty,
% which will be passed to \@tabarray
\@namedef{tabular*}{\@ifnextchar<%>
{\p@stabular}{\p@stabular<Z>}}
\def\p@stabular<#1>#2{%
\setlength\dimen@{#2}%
\edef\@halignto{to\the\dimen@}\@tabular<#1>}
%% patching internal code for array.sty and plext.sty
%
Expand Down
9 changes: 5 additions & 4 deletions plextarray.tex
Expand Up @@ -38,6 +38,7 @@ \section*{Brief explanation of ``\textsf{plext}'' package}
writing direction:
\begin{verbatim}
\begin{tabular}<dir>[pos]{table spec} ... \end{tabular}
\begin{tabular*}<dir>{width}[pos]{table spec} ... \end{tabular*}
\begin{array}<dir>[pos]{table spec} ... \end{array}
\end{verbatim}
The option \texttt{<dir>} permits one of the following three values.
Expand Down Expand Up @@ -91,7 +92,7 @@ \section{使いかた}
\begin{tabular}<t>{|>{$}c<{$}|c|}\hline
\exp(x) & 指数関数 \\ \hline
\log(x) & 対数関数 \\ \hline
\end{tabular}
\end{tabular}%
終わり
\end{document}
\end{verbatim}
Expand All @@ -101,7 +102,7 @@ \section{使いかた}
\begin{tabular}<t>{|>{$}c<{$}|c|}\hline
\exp(x) & 指数関数 \\ \hline
\log(x) & 対数関数 \\ \hline
\end{tabular}
\end{tabular}%
終わり
\end{minipage}

Expand All @@ -127,7 +128,7 @@ \section{使いかた}
みかん & 150円 & 和歌山県 \\ \hline
パイナップル & 400円 & 沖縄県 \\ \hline
バナナ & 190円 & フィリピン \\ \hline
\end{tabular}
\end{tabular}%
終わり
\end{document}
\end{verbatim}
Expand All @@ -142,7 +143,7 @@ \section{使いかた}
みかん & 150円 & 和歌山県 \\ \hline
パイナップル & 400円 & 沖縄県 \\ \hline
バナナ & 190円 & フィリピン \\ \hline
\end{tabular}
\end{tabular}%
終わり
\end{minipage}
\bigskip
Expand Down

0 comments on commit 9fe518b

Please sign in to comment.