summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/totalcount
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2020-08-31 03:02:58 +0000
committerNorbert Preining <norbert@preining.info>2020-08-31 03:02:58 +0000
commit568fe838cef40f671837d9348dd73c93d9ea962b (patch)
treeba2b2c6ab585927a89adae8c1cc2a594010ab933 /macros/latex/contrib/totalcount
parentc6a1b1f6422e10f363a9de80c4f103f0c155d8bb (diff)
CTAN sync 202008310302
Diffstat (limited to 'macros/latex/contrib/totalcount')
-rw-r--r--macros/latex/contrib/totalcount/CHANGELOG10
-rw-r--r--macros/latex/contrib/totalcount/README36
-rw-r--r--macros/latex/contrib/totalcount/SUMMARY1
-rw-r--r--macros/latex/contrib/totalcount/totalcount.dtx384
-rw-r--r--macros/latex/contrib/totalcount/totalcount.ins42
-rw-r--r--macros/latex/contrib/totalcount/totalcount.pdfbin0 -> 82731 bytes
6 files changed, 473 insertions, 0 deletions
diff --git a/macros/latex/contrib/totalcount/CHANGELOG b/macros/latex/contrib/totalcount/CHANGELOG
new file mode 100644
index 0000000000..934daeb260
--- /dev/null
+++ b/macros/latex/contrib/totalcount/CHANGELOG
@@ -0,0 +1,10 @@
+Changes made in the totalcount package
+======================================
+
+Please note that this document does not reflect bugfix-releases, and that the dates given are the dates of the release w/o bugfixes.
+
+If you are interested in a complete changelog -- including bugfixes -- process the dtx files with \RecordChanges and \PrintChanges.
+
+v1.0 (2008/03/09)
+- 1st published version
+
diff --git a/macros/latex/contrib/totalcount/README b/macros/latex/contrib/totalcount/README
new file mode 100644
index 0000000000..8833eeb8d5
--- /dev/null
+++ b/macros/latex/contrib/totalcount/README
@@ -0,0 +1,36 @@
+==========================================================================
+
+The `totalcount' package
+Copyright (C) 2010-2018 Axel Sommerfeldt (axel.sommerfeldt@f-m.fm)
+
+License: LPPL = LaTeX Project Public Licence
+Maintenance Status: maintained (by Axel Sommerfeldt)
+
+Home page:
+ https://gitlab.com/axelsommerfeldt/totalcount
+
+If you need help for installation please visit:
+ https://texfaq.org/FAQ-inst-miktexstar
+ https://texfaq.org/FAQ-installthings
+ https://texfaq.org/FAQ-privinst
+
+If you need help using this package please visit:
+ https://latex.org/forum/
+ https://tex.stackexchange.com/
+ https://golatex.de/ (German)
+ https://texwelt.de/ (German)
+
+If you think you may have found a bug in this package,
+or want to report a suggestion for improvement, please either visit
+ https://gitlab.com/axelsommerfeldt/totalcount/issues (preferred)
+or send an e-mail to
+ axel.sommerfeldt@f-m.fm
+
+--------------------------------------------------------------------------
+
+The `totalcount' package v1.0 offers commands for typesetting total values of counters.
+
+User Manual: totalcount.pdf (English)
+
+==========================================================================
+
diff --git a/macros/latex/contrib/totalcount/SUMMARY b/macros/latex/contrib/totalcount/SUMMARY
new file mode 100644
index 0000000000..543fd186a6
--- /dev/null
+++ b/macros/latex/contrib/totalcount/SUMMARY
@@ -0,0 +1 @@
+This LaTeX package offers commands for typesetting total values of counters.
diff --git a/macros/latex/contrib/totalcount/totalcount.dtx b/macros/latex/contrib/totalcount/totalcount.dtx
new file mode 100644
index 0000000000..291484587f
--- /dev/null
+++ b/macros/latex/contrib/totalcount/totalcount.dtx
@@ -0,0 +1,384 @@
+% \iffalse meta-comment
+%
+% This is file `totalcount.dtx'.
+%
+% Copyright (C) 2010-2018 Axel Sommerfeldt (axel.sommerfeldt@f-m.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 Axel Sommerfeldt.
+%
+% This work consists of the files totalcount.ins, totalcount.dtx,
+% and the derived file totalcount.sty.
+%
+% \fi
+% \CheckSum{126}
+%
+% \iffalse
+%<*driver>
+\NeedsTeXFormat{LaTeX2e}[1994/12/01]
+\ProvidesFile{totalcount.drv}[2013/05/12 v1.0 Total values of counters]
+\hbadness=9999 \newcount\hbadness \hfuzz=74pt % Make TeX shut up.
+%\errorcontextlines=3
+%
+\documentclass{ltxdoc}
+\setlength\parindent{0pt}
+\setlength\parskip{\smallskipamount}
+%
+\usepackage{ifpdf}
+\ifpdf
+ \usepackage{mathptmx,courier}
+ \usepackage[scaled=0.90]{helvet}
+% \addtolength\marginparwidth{15pt}
+\fi
+%
+\usepackage[bottom]{footmisc}
+\usepackage{hypdoc}
+\ifpdf\usepackage{hypdestopt}\fi
+\hypersetup{pdfkeywords={LaTeX, package, totalcount},pdfstartpage={},pdfstartview={}}
+%
+\usepackage{totalcount}[2008/02/16]
+%
+\newcommand*\purerm[1]{{\upshape\mdseries\rmfamily #1}}
+\newcommand*\puresf[1]{{\upshape\mdseries\sffamily #1}}
+\newcommand*\purett[1]{{\upshape\mdseries\ttfamily #1}}
+\let\package\puresf
+\let\env\purett \let\opt\purett
+%
+\newcommand*\csmarg[1]{\texttt{\char`\{#1\char`\}}}
+\newcommand*\csoarg[1]{\texttt{\char`\[#1\char`\]}}
+\newcommand*\version[2][]{$v#2$}
+%
+\usepackage{marvosym}
+\makeatletter
+\newcommand*\INFO{\@ifstar{\@INFO{}}{\@INFO{\vbox to \ht\strutbox}}}
+\newcommand*\@INFO[1]{\MARGINSYM{#1{\LARGE\Info}}}
+\makeatother
+%
+\begin{document}
+ \DocInput{totalcount.dtx}
+\end{document}
+%</driver>
+% \fi
+%
+% \def\thispackage{the \package{totalcount} package}
+% \def\Thispackage{The \package{totalcount} package}
+%
+% \GetFileInfo{totalcount.drv}
+% \let\docdate\filedate
+% \let\docversion\fileversion
+% \GetFileInfo{totalcount.sty}
+%
+% \title{\texorpdfstring{\Thispackage\thanks{%^^A
+% This package has version number \docversion.}}%^^A
+% {The totalcount package}}
+% \author{Axel Sommerfeldt\\
+% \url{https://gitlab.com/axelsommerfeldt/totalcount}}
+% \date{\docdate}
+% \maketitle
+%
+% \begin{abstract}
+% This package offers commands for typesetting total values of counters.
+% \end{abstract}
+%
+% \iffalse\clearpage\fi
+% \setcounter{tocdepth}{2}
+% \tableofcontents
+%
+% \iffalse\clearpage\fi
+% \pagebreak[3]
+% \section{Loading the package}
+%
+% Load this package using
+% \begin{quote}
+% |\usepackage|\oarg{options}|{totalcount}|\quad,
+% \end{quote}
+% where \meta{options} is a list of names of \LaTeX\ counters, e.g.:
+% \begin{quote}
+% |\usepackage[figure,table]{totalcount}|\quad.
+% \end{quote}
+% \pagebreak[3]
+% This way the commands |\total|\-|figures| and |\total|\-|tables| will be defined which
+% are typesetting the total number of figures resp.~tables, e.g.:
+% \begin{quote}
+% |This document contains \totalfigures\ figures.|
+% \end{quote}
+% \pagebreak[3]
+% Furthermore the commands |\if|\-|total|\-|figures| and |\if|\-|total|\-|tables| are offered
+% for typesetting text only if the document contains figures resp.~tables at all, e.g.:
+% \begin{quote}
+% |\iftotalfigures|\\
+% | \listoffigures|\\
+% |\fi|
+% \end{quote}
+% \pagebreak[3]
+% This should work with other counters as well (for example |equation|,
+% or |lst|\-|listing| offered by the \package{listings} package~\cite{listings}),
+% but please note that using the |page| counter here is not supported.
+%
+% \pagebreak[3]
+% \section{\cs{DeclareTotalCounter}}
+% \begin{quote}
+% |\DeclareTotalCounter|\marg{counter}
+% \end{quote}
+% actually defines the commands |\total|\meta{counter}|s| and |\if|\-|total|\meta{counter}|s|.
+%
+% \pagebreak[3]
+% So in fact
+% \begin{quote}
+% |\usepackage[figure,table]{totalcount}|
+% \end{quote}
+% is identical to
+% \begin{quote}
+% |\usepackage{totalcount}|\\
+% |\DeclareTotalCounter{figure}|\\
+% |\DeclareTotalCounter{table}|
+% \end{quote}
+%
+% \pagebreak[3]
+% \section{Spacing}
+% The space after all \LaTeX\ commands without (optional or mandatory) arguments
+% like |\total|\-|figures| will not be typeset,
+% so these commands needs to be finished with an additional backslash or an empty
+% pair of curly braces right before the space character,
+% or to be finished with a tilde (swung dash),
+% so \TeX\ will be prevented from omitting the following space character.
+%
+% \pagebreak[3]
+% This could be avoided by defining new commands with the help of
+% the \package{xspace} package~\cite{xspace}.
+% When using \thispackage\ with the package option |xspace| this will be actually done,
+% so after
+% \begin{quote}
+% |\usepackage[figure,table,xspace]{totalcount}|
+% \end{quote}
+% code like
+% \begin{quote}
+% |This document contains \totalfigures figures.|
+% \end{quote}
+% will give correct results without a missing space between the total number of figures
+% and the word ``figures''.
+%
+% \pagebreak[3]
+% \section{Thanks}
+% I would like to thank Herbert Vo\ss\ since the implementation of this package is
+% based on an idea from him which could be found at
+% \url{http://texnik.dante.de/cgi-bin/mainFAQ.cgi?file=counter/counter#number}.
+%
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
+%
+% \StopEventually{%^^A
+% \begin{thebibliography}{9}
+% \bibitem{listings}
+% Carsten Heinz \& Brooks Moses:\\
+% \href{http://www.ctan.org/pkg/listings}%
+% {\emph{The Listings Package}},\\
+% 2007/02/22
+% \bibitem{xspace}
+% David Carlisle and Morten H\o gholm:\\
+% \href{http://www.ctan.org/pkg/xspace}%
+% {\emph{The xspace package}},
+% 2009/10/20
+% \end{thebibliography}
+% }
+%
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
+%
+% \DoNotIndex{\\,\_,\ ,\@@par}
+% \DoNotIndex{\@bsphack}
+% \DoNotIndex{\@car,\@cdr,\@classoptionslist,\@cons,\@currext,\@currname}
+% \DoNotIndex{\@ehc,\@ehd,\@empty,\@esphack,\@expandtwoargs}
+% \DoNotIndex{\@for,\@firstofone,\@firstoftwo}
+% \DoNotIndex{\@gobble,\@gobblefour,\@gobbletwo,\@hangfrom}
+% \DoNotIndex{\@ifnextchar,\@ifpackagelater,\@ifpackageloaded}
+% \DoNotIndex{\@ifstar,\@ifundefined,\@latex@error,\@namedef,\@nameuse}
+% \DoNotIndex{\@onlypreamble,\@parboxrestore,\@plus,\@ptionlist}
+% \DoNotIndex{\@removeelement,\@restorepar,\@secondoftwo,\@setpar}
+% \DoNotIndex{\@tempa,\@tempboxa,\@tempdima,\@tempdimb,\@tempdimc,\@tempb,\@tempc}
+% \DoNotIndex{\@testopt}
+% \DoNotIndex{\@undefined,\@unprocessedoptions,\@unusedoptionlist}
+% \DoNotIndex{\p@,\z@}
+% \DoNotIndex{\active,\addtocounter,\addtolength,\advance,\aftergroup}
+% \DoNotIndex{\baselineskip,\begin,\begingroup,\bfseries,\box}
+% \DoNotIndex{\catcode,\centering,\changes,\csname,\def,\divide,\do,\downarrow}
+% \DoNotIndex{\edef,\else,\empty,\end,\endcsname,\endgraf,\endgroup,\expandafter}
+% \DoNotIndex{\fi,\footnotesize,\global}
+% \DoNotIndex{\hangindent,\hbox,\hfil,\hsize,\hskip,\hspace,\hss}
+% \DoNotIndex{\ifcase,\ifdim,\ifnum,\ifodd,\ifvoid,\ifvmode}
+% \DoNotIndex{\ifx,\ignorespaces,\itshape}
+% \DoNotIndex{\Large,\large,\leavevmode,\leftmargini,\leftskip,\let,\linewidth}
+% \DoNotIndex{\llap,\long,\m@ne,\margin,\mdseries,\message}
+% \DoNotIndex{\newcommand,\newdimen,\newlength,\newline,\newif,\newsavebox}
+% \DoNotIndex{\next,\nobreak,\nobreakspace,\noexpand,\noindent,\numberline}
+% \DoNotIndex{\normalcolor,\normalfont,\normalsize,\or,\par,\parbox,\parfillskip}
+% \DoNotIndex{\parindent,\parskip,\prevdepth,\protect,\protected@edef,\protected@write}
+% \DoNotIndex{\providecommand,\quad}
+% \DoNotIndex{\raggedleft,\raggedright,\relax,\renewcommand,\RequirePackage}
+% \DoNotIndex{\rightskip,\rmfamily}
+% \DoNotIndex{\sbox,\scriptsize,\scshape,\setbox,\setlength,\sffamily,\slshape}
+% \DoNotIndex{\small,\string,\space,\strut}
+% \DoNotIndex{\textheight,\the,\toks@,\typeout,\ttfamily}
+% \DoNotIndex{\unvbox,\uparrow,\upshape,\usebox,\usepackage}
+% \DoNotIndex{\value,\vbox,\vsize,\vskip,\wd,\width,\z@skip}
+% \DoNotIndex{\AtBeginDocument,\AtEndOfPackage,\CurrentOption,\DeclareOption}
+% \DoNotIndex{\ExecuteOptions,\GenericWarning,\IfFileExists,\InputIfFileExists}
+% \DoNotIndex{\NeedsTeXFormat,\MessageBreak}
+% \DoNotIndex{\PackageError,\PackageInfo,\PackageWarning,\PackageWarningNoLine}
+% \DoNotIndex{\PassOptionsToPackage,\ProcessOptions,\ProvidesPackage}
+%
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
+%
+% \setlength{\parskip}{0pt plus 1pt}
+% \changes{v1.0}{2008/02/16}{First version}
+%
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
+%
+% \clearpage
+% \section{The implementation}
+% \iffalse
+%<*package>
+% \fi
+%
+% \subsection{Identification}
+%
+% \begin{macrocode}
+\NeedsTeXFormat{LaTeX2e}[1994/12/01]
+\ProvidesPackage{totalcount}[2018/01/21 v1.0a Total values of counters (AR)]
+% \end{macrocode}
+%
+% \subsection{Initial code}
+%
+% \begin{macro}{\DeclareTotalCounter}
+% \changes{v1.0}{2013/05/12}{Usage of \cs{totalcount@counters} delayed}
+% |\DeclareTotalCounter|\marg{counter name}
+% \begin{macrocode}
+\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}}%
+% \@nameuse{totalcount@set@#1}%
+ \AtBeginDocument{\@ifundefined{c@#1}%
+ {\PackageError{totalcount}{Undefined counter `#1'}\@ehc}%
+ {\@cons\totalcount@counters{{#1}}}}}
+\@onlypreamble\DeclareTotalCounter
+% \end{macrocode}
+% \begin{macrocode}
+\let\totalcount@counters\@empty
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Declaration of options}
+%
+% \begin{macrocode}
+\newcommand*\totalcount@xspace{}
+\DeclareOption{xspace}{\renewcommand*\totalcount@xspace{\xspace}}
+% \end{macrocode}
+% \begin{macrocode}
+\DeclareOption*{\expandafter\DeclareTotalCounter\expandafter{\CurrentOption}}
+% \end{macrocode}
+%
+% \subsection{Execution of options}
+%
+% \begin{macrocode}
+\ProcessOptions\relax
+\ifx\totalcount@xspace\@empty\else
+ \RequirePackage{xspace}
+\fi
+% \end{macrocode}
+%
+% \subsection{Main code}
+%
+% \begin{macro}{\totalcount@addtocounter}
+% |\totalcount@addtocounter|\marg{counter name}
+% \begin{macrocode}
+\newcommand*\totalcount@addtocounter[1]{%
+ \@ifundefined{c@totalcount@#1}{}{%
+ \addtocounter{totalcount@#1}{\value{#1}}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@stpelt}
+% |\@stpelt|\marg{counter name}
+% \begin{macrocode}
+\let\totalcount@stpelt@ORI\@stpelt
+\renewcommand*\@stpelt[1]{%
+ \totalcount@addtocounter{#1}%
+ \totalcount@stpelt@ORI{#1}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\totalcount@set}
+% \changes{v1.0a}{2018/01/21}{A negative counter value will be handled correctly now}
+% |\totalcount@set|\marg{counter name}\marg{value}
+% \begin{macrocode}
+\newcommand*\totalcount@set[2]{%
+ \@ifundefined{c@totalcount@#1}%
+% {\global\@namedef{totalcount@set@#1}{\totalcount@set{#1}{#2}}}%
+ {}%
+ {\global\@namedef{total#1s}{#2\totalcount@xspace}%
+ \ifnum#2<1\relax \else
+ \global\@nameuse{total#1strue}%
+ \fi}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\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}}%
+% \end{macrocode}
+%
+% \iffalse
+%</package>
+% \fi
+%
+% \iffalse
+% --------------------------------------------------------------------------- %
+% \fi
+%
+% \Finale
+%
+\endinput
diff --git a/macros/latex/contrib/totalcount/totalcount.ins b/macros/latex/contrib/totalcount/totalcount.ins
new file mode 100644
index 0000000000..a1e82fb561
--- /dev/null
+++ b/macros/latex/contrib/totalcount/totalcount.ins
@@ -0,0 +1,42 @@
+\def\batchfile{totalcount.ins}
+\input docstrip
+
+\askforoverwritefalse
+\keepsilent
+
+\preamble
+
+Copyright (C) 2010-2018 Axel Sommerfeldt (axel.sommerfeldt@f-m.fm)
+
+https://gitlab.com/axelsommerfeldt/totalcount
+
+--------------------------------------------------------------------------
+
+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, totalcount.dtx,
+and the derived file totalcount.sty.
+
+\endpreamble
+
+\generate{\file{totalcount.sty}{\from{totalcount.dtx}{package}}}
+
+\Msg{***********************************************************}
+\Msg{*}
+\Msg{* To finish the installation you have to move the file}
+\Msg{* `totalcount.sty' into a directory searched by TeX.}
+\Msg{*}
+\Msg{* To produce the documentation run the file}
+\Msg{* `totalcount.dtx' through LaTeX.}
+\Msg{*}
+\Msg{***********************************************************}
diff --git a/macros/latex/contrib/totalcount/totalcount.pdf b/macros/latex/contrib/totalcount/totalcount.pdf
new file mode 100644
index 0000000000..9eb1221308
--- /dev/null
+++ b/macros/latex/contrib/totalcount/totalcount.pdf
Binary files differ