% Author: Alexey Shipunov, dactylorhiza@gmail.com

\ProvidesPackage{boldline}%
        [2008/02/04 v0.2 Adjust line width in tables]

\RequirePackage{array}

% Vertical lines
\newcolumntype{V}[1]{!{\vrule\@width #1\arrayrulewidth}}

% Horizontal lines
% Addition to \hline
\def\hlineB#1{%
  \noalign{\ifnum0=`}\fi\hrule \@height #1\arrayrulewidth
\futurelet \reserved@a\@xhlineB{#1}}

\def\@xhlineB#1{\ifx\reserved@a\hlineB
               \vskip\doublerulesep
               \vskip-#1\arrayrulewidth
             \fi
      \ifnum0=`{\fi}}

% Addition to \cline
\def\clineB#1#2{\@clineB#1[#2]\@nil}
\def\@clineB#1-#2[#3]\@nil{%
  \omit
  \@multicnt#1%
  \global\def\Mag@B{#3}%
  \advance\@multispan\m@ne
  \ifnum\@multicnt=\@ne\@firstofone{&\omit}\fi
  \@multicnt#2%
  \advance\@multicnt-#1%
  \advance\@multispan\@ne
  \leaders\hrule\@height \Mag@B\arrayrulewidth\hfill
  \cr
  \noalign{\vskip-\Mag@B\arrayrulewidth}}

% For "longtable", input AFTER longtable!
\@ifundefined{longtable}{}{%
\def\LT@hlineB{%
  \noalign{\ifnum0=`}\fi
    \penalty\@M
    \futurelet\@let@token\LT@@hlineB}
\def\LT@@hlineB#1{%
  \ifx\@let@token\hlineB
    \global\let\@gtempa\@gobble
    \gdef\LT@sep{\penalty-\@medpenalty\vskip\doublerulesep}%
  \else
    \global\let\@gtempa\@empty
    \gdef\LT@sep{\penalty-\@lowpenalty\vskip-#1\arrayrulewidth}%
  \fi
  \ifnum0=`{\fi}%
  \multispan\LT@cols
     \unskip\leaders\hrule\@height #1\arrayrulewidth\hfill\cr
  \noalign{\LT@sep}%
  \multispan\LT@cols
     \unskip\leaders\hrule\@height #1\arrayrulewidth\hfill\cr
  \noalign{\penalty\@M}%
  \@gtempa}
\let\longtable@TMP\longtable
\def\longtable{%
\let\hlineB\LT@hlineB
\longtable@TMP}
}

% For "mdwtab", input AFTER mdwtab!
\@ifundefined{hlx}{}{%
\def\hlxB#1{%
  \multispan{\tab@columns}%
  \leaders\hrule\@height #1\arrayrulewidth\hfil%
  \tab@addruleheight\arrayrulewidth%
  \cr%
  \noalign{\ifnum0=`}\fi%
  \tab@penalty%
  \futurelet\@let@token\hline@i}
}

\endinput
