Ich habe mal ein Paket dafür geschrieben, mit \usepackage[figure,table]{totalcount} bekommt man zum Beispiel die Befehle \totalfigures und \totaltables, welche die Gesamtzahl der Abbildungen bzw. Tabellen repräsentiert. Das ganze sollte auch mit anderen Zählern, wie "equation" etc. funktionieren.
Über Rückmeldungen würde ich mich freuen. (Wäre das was für CTAN?)
Gruß,
Axel
Code:
%%
%% This is file `totalcount.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% totalcount.dtx (with options: `package')
%%
%% Copyright (C) 2008 Axel Sommerfeldt (caption@sommerfee.de)
%%
%% --------------------------------------------------------------------------
%%
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either version 1.3
%% of this license or (at your option) any later version.
%% The latest version of this license is in
%% http://www.latex-project.org/lppl.txt
%% and version 1.3 or later is part of all distributions of LaTeX
%% version 2003/12/01 or later.
%%
%% This work has the LPPL maintenance status "maintained".
%%
%% This Current Maintainer of this work is Axel Sommerfeldt.
%%
%% This work consists of the files totalcount.ins and totalcount.dtx,
%% and the derived file totalcount.sty.
%%
\NeedsTeXFormat{LaTeX2e}[1994/12/01]
\ProvidesPackage{totalcount}[2008/02/26 v0.6 Total values of counters (AR)]
\newcommand*\DeclareTotalCounter[1]{%
\@ifundefined{c@#1}%
{\PackageError{totalcount}{Undefined counter `#1'}\@ehc}%
{\newcounter{total@#1}%
\@namedef{total#1s}{\nfss@text{\reset@font\bfseries ??}}%
\@cons\total@counters{{#1}}}}
\@onlypreamble\DeclareTotalCounter
\let\total@counters\@empty
\DeclareOption*{\expandafter\DeclareTotalCounter\expandafter{\CurrentOption}}
\ProcessOptions\relax
\newcommand*\total@addtocounter[1]{%
\@ifundefined{c@total@#1}{}{%
\addtocounter{total@#1}{\value{#1}}}}
\let\total@stpelt@ORI\@stpelt
\renewcommand*\@stpelt[1]{%
\total@addtocounter{#1}\total@stpelt@ORI{#1}}
\AtBeginDocument{\AtEndDocument{%
\begingroup
\@tempswafalse
\def\@elt#1{%
\total@addtocounter{#1}%
\xdef\@tempa{\the\value{total@#1}}%
\expandafter\ifx\csname total#1s\endcsname\@tempa \else
\@tempswatrue
\fi
\if@filesw
\immediate\write\@mainaux{%
\string\gdef\string\total#1s{\@tempa}}%
\fi}%
\total@counters
\if@tempswa
\PackageWarningNoLine{totalcount}{%
Total counter(s) have changed.\MessageBreak
Rerun to get them right}%
\fi
\endgroup}}%
\endinput
%%
%% End of file `totalcount.sty'.
Lesezeichen