You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
98 lines
3.4 KiB
98 lines
3.4 KiB
%%
|
|
%% This is file `totalcount.sty',
|
|
%% generated with the docstrip utility.
|
|
%%
|
|
%% The original source files were:
|
|
%%
|
|
%% totalcount.dtx (with options: `package')
|
|
%%
|
|
%% Copyright (C) 1994-2020 Axel Sommerfeldt (axel.sommerfeldt@f-m.fm)
|
|
%%
|
|
%% https://gitlab.com/axelsommerfeldt/caption
|
|
%%
|
|
%% --------------------------------------------------------------------------
|
|
%%
|
|
%% 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
|
|
%% caption.ins, caption.dtx, caption2.dtx, caption3.dtx,
|
|
%% bicaption.dtx, ltcaption.dtx, subcaption.dtx, totalcount.dtx,
|
|
%% the derived files
|
|
%% caption.sty, caption2.sty, caption3.sty,
|
|
%% bicaption.sty, ltcaption.sty, subcaption.sty, totalcount.sty,
|
|
%% and the user manuals
|
|
%% caption-deu.tex, caption-eng.tex, caption-rus.tex.
|
|
%%
|
|
\NeedsTeXFormat{LaTeX2e}[1994/12/01]
|
|
\ProvidesPackage{totalcount}[2018/01/21 v1.0a Total values of counters (AR)]
|
|
\newcommand*\DeclareTotalCounter[1]{%
|
|
\newcounter{totalcount@#1}%
|
|
\@namedef{total#1s}{\nfss@text{\reset@font\bfseries ??}}%
|
|
\@namedef{total#1es}{\@nameuse{total#1s}}%
|
|
\expandafter\newif\csname iftotal#1s\endcsname
|
|
\@namedef{iftotal#1es}{\@nameuse{iftotal#1s}}%
|
|
\AtBeginDocument{\@ifundefined{c@#1}%
|
|
{\PackageError{totalcount}{Undefined counter `#1'}\@ehc}%
|
|
{\@cons\totalcount@counters{{#1}}}}}
|
|
\@onlypreamble\DeclareTotalCounter
|
|
\let\totalcount@counters\@empty
|
|
\newcommand*\totalcount@xspace{}
|
|
\DeclareOption{xspace}{\renewcommand*\totalcount@xspace{\xspace}}
|
|
\DeclareOption*{\expandafter\DeclareTotalCounter\expandafter{\CurrentOption}}
|
|
\ProcessOptions\relax
|
|
\ifx\totalcount@xspace\@empty\else
|
|
\RequirePackage{xspace}
|
|
\fi
|
|
\newcommand*\totalcount@addtocounter[1]{%
|
|
\@ifundefined{c@totalcount@#1}{}{%
|
|
\addtocounter{totalcount@#1}{\value{#1}}}}
|
|
\let\totalcount@stpelt@ORI\@stpelt
|
|
\renewcommand*\@stpelt[1]{%
|
|
\totalcount@addtocounter{#1}%
|
|
\totalcount@stpelt@ORI{#1}}
|
|
\newcommand*\totalcount@set[2]{%
|
|
\@ifundefined{c@totalcount@#1}%
|
|
{}%
|
|
{\global\@namedef{total#1s}{#2\totalcount@xspace}%
|
|
\ifnum#2<1\relax \else
|
|
\global\@nameuse{total#1strue}%
|
|
\fi}}
|
|
\AtBeginDocument{\AtEndDocument{%
|
|
\begingroup
|
|
\@tempswafalse
|
|
\if@filesw
|
|
\immediate\write\@mainaux{%
|
|
\string\providecommand\string\totalcount@set[2]{}}%
|
|
\fi
|
|
\def\@elt#1{%
|
|
\totalcount@addtocounter{#1}%
|
|
\edef\totalcount@tempa{\the\value{totalcount@#1}}%
|
|
\expandafter\let\expandafter\totalcount@tempb\csname total#1s\endcsname
|
|
\@expandtwoargs\totalcount@set{#1}{\totalcount@tempa}%
|
|
\expandafter\ifx\csname total#1s\endcsname\totalcount@tempb \else
|
|
\@tempswatrue
|
|
\fi
|
|
\if@filesw
|
|
\immediate\write\@mainaux{%
|
|
\string\totalcount@set{#1}{\totalcount@tempa}}%
|
|
\fi}%
|
|
\totalcount@counters
|
|
\if@tempswa
|
|
\PackageWarningNoLine{totalcount}{%
|
|
Total counter(s) have changed.\MessageBreak
|
|
Rerun to get them right}%
|
|
\fi
|
|
\endgroup}}%
|
|
\endinput
|
|
%%
|
|
%% End of file `totalcount.sty'.
|
|
|