% DECTAB.STY  (April 27, 1991)
% Allows decimal alignment in tabular environment
% \dec definitions taken from REVTEX.STY
% by Charles Franklin, April 27, 1991
% (C38871CF@WUVMD.WUSTL.EDU or C38871CF@WUVMD.Bitnet)
%
% USAGE:  For decimal alignment in a table, use \dec 3.14 for
%         the cell entry.  The column should be center aligned
%         to achieve the desired effect.
%         For example:
%
%         \begin{tabular}{lcc}
%
%         Constant          & \dec  -1.461    &  \dec  -0.724  \\
%         Standard Error    & \dec  (0.422)   &  \dec  (0.455) \\
%
%         Note that a `.' MUST appear for the alignment to work.
%         Use `\dec 520.' NOT `\dec 520' for integers.
%
%         DECTAB also defines \ra, \la, \ca for easy modification of
%         global alignments. These produce local right, left and center
%         alignments of the cell entry. If there are spaces in the cell
%         entry, enclose the contents in {...}, eg \la {This Column}
%
\typeout{Document Style Option `dectab', version April 27, 1991}

\newdimen\@Ldec \newdimen\@Rdec

\def\dec #1.#2 {\hbox to\@Ldec{\hss#1}\def\test{#2}%
\ifx\test\empty\hbox to\@Rdec{\hfill}\else\hbox to\@Rdec{.#2\hss}\fi
}

\def\setdec #1.#2 {\relax%
  \bgroup
    \setbox0\hbox{\kern1pt\relax#1}\setbox1\hbox{\kern1pt\relax#2}%
    \global\@Ldec\wd0\global\@Rdec\wd1%
  \egroup
}

\setdec 000.000 % default size of 3 digits on each side

% Following defs allow easy modification of global alignment in
% tables. \ra, \la, \ca for right, left and center alignments.

\def\ra #1 {\multicolumn{1}{r}{#1}}
\def\la #1 {\multicolumn{1}{l}{#1}}
\def\ca #1 {\multicolumn{1}{c}{#1}}

% end DECTAB.STY
