summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/eskdx/source/eskdtotal.sty.in
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/doc/latex/eskdx/source/eskdtotal.sty.in')
-rw-r--r--Master/texmf-dist/doc/latex/eskdx/source/eskdtotal.sty.in58
1 files changed, 58 insertions, 0 deletions
diff --git a/Master/texmf-dist/doc/latex/eskdx/source/eskdtotal.sty.in b/Master/texmf-dist/doc/latex/eskdx/source/eskdtotal.sty.in
new file mode 100644
index 00000000000..dfaee588b00
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/eskdx/source/eskdtotal.sty.in
@@ -0,0 +1,58 @@
+% Copyright 2006 Konstantin Korikov <lostclus@ua.fm>
+%
+% 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 Konstantin Korikov.
+%
+% This work consists of all files listed in manifest.txt.
+%
+m4_ESKDX_INIT
+m4_FILE_INIT
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{eskdtotal}[m4_dnl
+m4_FILE_ID([[$Date: 2006-12-17 06:01:41 +0200 (Вск, 17 Дек 2006) $]]) Total number of tables, figures, etc]
+
+\RequirePackage{eskdsect}
+
+\let\ESKD@old@caption\@caption
+\let\ESKD@old@bibitem\bibitem
+
+\newcounter{ESKD@figure}
+\newcounter{ESKD@table}
+\newcounter{ESKD@bibitem}
+
+\long\def\@caption#1[#2]#3{%
+ \stepcounter{ESKD@#1}%
+ \ESKD@old@caption{#1}[#2]{#3}}
+
+\long\def\bibitem{%
+ \stepcounter{ESKD@bibitem}%
+ \ESKD@old@bibitem}
+
+\def\ESKD@total@save#1#2{%
+ \immediate\write\@auxout{%
+ \string\gdef\string\ESKD@total@saved@\string#1{\arabic{#2}}}}
+
+\AtEndDocument{%
+ \ESKD@total@save{figure}{ESKD@figure}
+ \ESKD@total@save{table}{ESKD@table}
+ \ESKD@total@save{bibitem}{ESKD@bibitem}
+ \ESKD@total@save{appendix}{appendix}
+ \clearpage
+ \addtocounter{page}{-1}
+ \ESKD@total@save{page}{page}
+ \addtocounter{page}{1}}
+
+\newcommand{\ESKDtotal}[1]{%
+ \@ifundefined{ESKD@total@saved@#1}{?}{%
+ \@nameuse{ESKD@total@saved@#1}}}
+
+m4_dnl vim:ft=tex:sw=2:ai