%%
%% Manages the tables.
%%
%% The package is provided to:
%% - fix or workaround some bugs,
%% - define some specific dimensions,
%% - workaround annoying longtable things about table counter.

\usepackage{longtable}
\usepackage{lscape}
\usepackage{colortbl}
\usepackage{calc}
\usepackage{hhline}

% Multirow changed, used by newtbl
\usepackage{multirow2}

% Temporary latex/3797 bug fix (colortbl) by Morten Hoegholm
\expandafter\renewcommand\expandafter\multicolumn
  \expandafter[\expandafter3\expandafter]\expandafter{%
  \multicolumn{#1}{#2}{#3}}

% For the newtbl code
\newdimen\newtblstarfactor%
\newdimen\newtblsparewidth%
\newdimen\newtblcolwidth%
\newdimen\tablewidth%

% Avoid table counter mess with (informal) longtable
% but leave other counters working in longtable like ordered lists
% (thanks to Yung-ching Hsiao patch)
\let\stdrefstepcounter\refstepcounter%
\def\emptyrefstepcounter#1{\begingroup%
  \def\a{table}\def\b{#1}\ifx\a\b\relax\else\stdrefstepcounter{#1}\fi
  \endgroup}
\def\savetablecounter{%
  \let\refstepcounter\emptyrefstepcounter%
}
\def\restoretablecounter{%
  \let\refstepcounter\stdrefstepcounter%
}

