%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Defines thick lines for use in tabular environments
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{shtabularlines}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Add an optional parameter for the line width to the command \hline,
%% \vline, and \cline:
%% 
%% \shhline[width]
%% \shvline[width]
%% \shcline[width]{c1-c2}
%% 
%% The default width is the same as standard lines. This is set by the
%% parameter \sharrayrulewidth. Reset with \renewcommand
%% 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\def\sharrayrulewidth{\arrayrulewidth}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% \hline
\def\shhline{\noalign{\ifnum0=`}\fi%
  \@ifnextchar[{\sh@hline}{\sh@hline[\sharrayrulewidth]}}
\def\sh@hline[#1]{\hrule height #1 \futurelet\reserved@a\@xhline}
%% \vline
\def\shvline{%
  \@ifnextchar[{\sh@vline}{\sh@vline[\sharrayrulewidth]}}
\def\sh@vline[#1]{\vrule \@width #1}
%% \cline
\def\shcline{\omit%
  \@ifnextchar[{\sh@cline}{\sh@cline[\sharrayrulewidth]}}
\def\sh@cline[#1]#2{\sh@@cline[#1]#2\@nil}
\def\sh@@cline[#1]#2-#3\@nil{%
  \@multicnt#2%
  \advance\@multispan\m@ne
  \ifnum\@multicnt=\@ne\@firstofone{&\omit}\fi
  \@multicnt#3%
  \advance\@multicnt-#2%
  \advance\@multispan\@ne
  \leaders\hrule\@height#1\hfill
  \cr
  \noalign{\vskip-#1}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% TODO
%% ----
%% * What does \xhline do? Is that the answer to \shcline strange
%%   behaviour?
%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Backward compatibility
\let\thickhline\shhline
\let\thickvline\shvline
\let\thickcline\shcline
\def\thickarrayrulewidth{1.6pt}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\endinput


