%%
%% This is file `floatcount.sty'.
%% 
%% IMPORTANT NOTICE:
%% 
%% This program can be redistributed and/or modified under the terms
%% of the LaTeX Project Public License Distributed from CTAN
%% archives in directory macros/latex/base/lppl.txt; either
%% version 1.2 of the License, or any later version.
%%
%% Ce programme peut être distribué et/ou modifié selon les conditions 
%% de la 'LaTeX Project Public License' (version 1.2 ou ultérieure).
%% La dernière version de cette licence est disponible sur :
%% http://www.latex-project.org/lppl.txt
%%
%% File: floatcount.sty
%%   Copyright (C) 2005 Thomas van Oudenhove de Saint Géry
%%
%% Thomas van Oudenhove de Saint Géry
%% Ecole des Mines d'Albi-Carmaux
%% http://perso.enstimac.fr/~vanouden/
%%
\def\filename{floatcount}
\def\fileversion{v0.2}
\def\filedate{2005/09/06}

%% the numbers of floats :
%% \Fignumber for figures
%% \Tabnumber for tables
\NeedsTeXFormat{LaTeX2e}[2003/12/01]
\ProvidesPackage{floatcount}[\filedate\space\fileversion\space
             LaTeX2e package (number of floats - TvO)]
\RequirePackage{xspace}
\newcounter{fignumber}
\renewenvironment{figure}
     {\@float{figure}}
     {\end@float\addtocounter{fignumber}{1}}
\renewenvironment{figure*}
     {\@dblfloat{figure}}
     {\end@dblfloat\addtocounter{fignumber}{1}}
\newcounter{tabnumber}
\renewenvironment{table}
     {\@float{table}}
     {\end@float\addtocounter{tabnumber}{1}}
\renewenvironment{table*}
     {\@dblfloat{table}}
     {\end@dblfloat\addtocounter{tabnumber}{1}}
\AtEndDocument{\message{End Of Document: setting floats count}%
  \immediate\write\@auxout{\string
    \newlabel{FigureNumber}{{\thefignumber}{}}}%
  \immediate\write\@auxout{\string
    \newlabel{TableNumber}{{\thetabnumber}{}}}}
\newcommand{\Fignumber}{\ref{FigureNumber}\xspace}
\newcommand{\Tabnumber}{\ref{TableNumber}\xspace}
\endinput