summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Master/texmf-dist/doc/latex/xassoccnt/README8
-rw-r--r--Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_doc.pdfbin223961 -> 271633 bytes
-rw-r--r--Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_doc.tex397
-rw-r--r--Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_driver.pdfbin64941 -> 77784 bytes
-rw-r--r--Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_driver.tex53
-rw-r--r--Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_example.pdfbin68837 -> 68837 bytes
-rw-r--r--Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_example.tex4
-rw-r--r--Master/texmf-dist/tex/latex/xassoccnt/xassoccnt.sty305
8 files changed, 643 insertions, 124 deletions
diff --git a/Master/texmf-dist/doc/latex/xassoccnt/README b/Master/texmf-dist/doc/latex/xassoccnt/README
index 58962724610..ef3c189c836 100644
--- a/Master/texmf-dist/doc/latex/xassoccnt/README
+++ b/Master/texmf-dist/doc/latex/xassoccnt/README
@@ -1,9 +1,9 @@
-%% LaTeX package xassoccnt - version 0.2 (2015/11/14 -- 16/08/33)
+%% LaTeX package xassoccnt - version 0.3 (2016/01/08 -- 10/54/13)
%% README file for xassoccnt.sty
%%
%%
%% -------------------------------------------------------------------------------------------
-%% Copyright (c) 2015 by Dr. Christian Hupfer <christian dot hupfer at yahoo dot de>
+%% Copyright (c) 2016 by Dr. Christian Hupfer <christian dot hupfer at yahoo dot de>
%% -------------------------------------------------------------------------------------------
%%
%% This work may be distributed and/or modified under the
@@ -26,7 +26,7 @@ the associated counters as well. This package can be regarded as a supplement
to the totcount package by Vasileios Koutavas (http://www.ctan.org/pkg/totcount), but
can be used without it too.
-As of 2015/11/14 xassoccnt does not supersede the package assoccnt by the same author, however,
-the older package isn't declared obsolete as of 2015/11/14
+As of 2016/01/08 xassoccnt does not supersede the package assoccnt by the same author, however,
+the older package isn't declared obsolete as of 2016/01/08
diff --git a/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_doc.pdf b/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_doc.pdf
index 7836955581c..5b1de0a2cb8 100644
--- a/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_doc.pdf
+++ b/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_doc.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_doc.tex b/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_doc.tex
index 9e398d173f7..88476486033 100644
--- a/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_doc.tex
+++ b/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_doc.tex
@@ -1,9 +1,9 @@
-%% LaTeX package xassoccnt - version 0.2 (2015/11/14 -- 16/08/33)
+%% LaTeX package xassoccnt - version 0.3 (2016/01/08 -- 10/54/13)
%% Documentation file for xassoccnt.sty
%%
%%
%% -------------------------------------------------------------------------------------------
-%% Copyright (c) 2015 by Dr. Christian Hupfer <christian dot hupfer at yahoo dot de>
+%% Copyright (c) 2016 by Dr. Christian Hupfer <christian dot hupfer at yahoo dot de>
%% -------------------------------------------------------------------------------------------
%%
%% This work may be distributed and/or modified under the
@@ -32,19 +32,15 @@
\usepackage{blindtext}
\usepackage[x11names]{xcolor}
\usepackage{imakeidx}
-
+\usepackage{fontawesome}
\usepackage[most,documentation]{tcolorbox}
-
-
-
\usepackage[tikz]{bclogo}
\usepackage{marginnote}
\usepackage{fancyhdr}
\usepackage{datetime}
\usepackage{array}
-
-
-
+\usepackage{xkeyval}
+\usepackage{xparse}
\usepackage{totcount}
\usepackage{enumitem}%
\usepackage{microtype}
@@ -54,9 +50,23 @@
\setlist[codeoptionsenum,1]{label={\textcolor{blue}{\#\arabic*}}}
-\newcommand{\packagename}[1]{\fbox{\textcolor{blue}{\textbf{\ding{41}~#1}}}\index{Package!#1}}%
-\newcommand{\classname}[1]{\fbox{\textcolor{brown}{\textbf{\Writinghand~#1}}}\index{Class!#1}}%
-\newcommand{\handrightnote}{\tcbdocmarginnote{\ding{43}}}
+\newcolumntype{C}[1]{>{\centering\arraybackslash}p{#1}}
+
+\makeatletter
+\define@key{chdoc}{packageauthor}{%
+ \def\KVchdocpackageauthor{#1}%
+}
+
+\define@key{chdoc}{packageauthormail}{%
+ \def\KVchdocpackageauthormail{#1}%
+}
+
+\define@key{chdoc}{filepurpose}{%
+ \def\KVchdocfilepurpose{#1}%
+}
+
+\makeatother
+
\fancypagestyle{plain}{%
@@ -72,6 +82,44 @@
}
+\newtcolorbox{CHPackageTitleBox}[1][]{%
+ enhanced jigsaw,
+ drop lifted shadow,
+ colback=yellow!30!white,
+ width=0.8\textwidth,
+ #1
+}
+
+
+\presetkeys{chdoc}{packageauthor={Christian Hupfer}}{}%
+\NewDocumentCommand{\CHPackageTitlePage}{O{}mO{}}{%
+ \setkeys{chdoc}{packageauthor={Christian Hupfer},filepurpose={Documentation},#1}%
+ \begin{center}
+ \begin{CHPackageTitleBox}[#3]
+ \large \bfseries%
+ \begin{center}%
+ \begin{tabular}{C{0.9\textwidth}}%
+ \scshape \PackageDocName \tabularnewline
+ \tabularnewline
+ #2 \tabularnewline
+ \tabularnewline
+ \KVchdocfilepurpose \tabularnewline
+ \tabularnewline
+ Version \packageversion \tabularnewline
+ \tabularnewline
+ \today \tabularnewline
+ \tabularnewline
+ \addtocounter{footnote}{2}
+ Author: \KVchdocpackageauthor\(^\mathrm{\fnsymbol{footnote}}\)
+ \tabularnewline
+ \end{tabular}
+ \end{center}
+ \end{CHPackageTitleBox}
+ \renewcommand{\thefootnote}{\fnsymbol{footnote}}%
+ \footnotetext{\mymailtoaddress}%
+ \end{center}
+}
+
\newtcolorbox{docCommandArgs}[1]{colbacktitle={blue},coltitle={white},title={Description of arguments of command \cs{#1}}}
@@ -93,22 +141,104 @@
drop fuzzy shadow,#1}
-\usepackage[autodefinecounters=true]{xassoccnt}
+%%%% Documentation macros
+
+
+\NewDocumentCommand{\packagename}{sm}{%
+ \textcolor{blue}{\textbf{\faEnvelopeO~#2}}%
+ \IfBooleanF{#1}{%
+ \index{Package!#2}
+ }%
+}
+
+\NewDocumentCommand{\classname}{sm}{%
+ \textcolor{brown}{\textbf{\faBriefcase~#2}}%
+ \IfBooleanF{#1}{%
+ \index{Package!#2}%
+ }%
+}
+
+
+\NewDocumentCommand{\CHDocPackage}{sm}{%
+ \textcolor{blue}{\textbf{\faEnvelopeO~#2}}%
+ \IfBooleanF{#1}{%
+ \index{Package!#2}
+ }%
+}
+
+
+
+
+\NewDocumentCommand{\CHDocClass}{sm}{%
+ \textcolor{brown}{\textbf{\faBriefcase~#2}}%
+ \IfBooleanF{#1}{%
+ \index{Package!#2}%
+ }%
+}
+
+\NewDocumentCommand{\CHDocKey}{sm}{%
+ \textcolor{red}{\textbf{\faKey~#2}}%
+ \IfBooleanF{#1}{%
+ \index{Option!#2}%
+ }%
+}
+\newcommand{\handrightnote}{\tcbdocmarginnote{\ding{43}}}
+
+
+\NewDocumentCommand{\CHDocCounter}{sm}{%
+ \textcolor{Green4}{\textbf{\faCalculator~#2}}%
+ \IfBooleanF{#1}{%
+ \index{Counter!#2}%
+ }%
+}
+
+
+\NewDocumentCommand{\CHDocTag}{sm}{%
+ \textcolor{violet}{\faTag~#2}%
+ \IfBooleanF{#1}{%
+ \index{Feature!#2}%
+ }%
+}
+
+
+\NewDocumentCommand{\CHDocFileExt}{sm}{%
+ \faFile~#2%
+}
+
+\NewDocumentCommand{\CHDocFiles}{sm}{%
+ \faFilesO~#2%
+}
+
+
+\NewDocumentCommand{\CHDocConventions}{}{%
+ \section*{\centering Typographical conventions}
+ Throughout this documentation following symbols and conventions are used:
+ \begin{itemize}
+ \item \CHDocClass*{foo} means a the class \texttt{foo}
+ \item \CHDocPackage*{foo} names a package \texttt{foo}
+ \item \CHDocCounter*{foo} indicates a counter named \texttt{foo}
+ \item \CHDocFileExt*{foo} will indicate either a file named \texttt{foo} or a file extension \texttt{foo}
+ \item \CHDocFiles*{foo} will indicate some files
+ \item \CHDocTag*{foo} names a special feature or tag \texttt{foo}
+ \item \CHDocKey*{foo} deals with a command or package option named \texttt{foo}
+ \end{itemize}
+}
+\usepackage[autodefinecounters=true]{xassoccnt}
+\usepackage{amsmath}
+\usepackage{amssymb}
\usepackage{bookmark}
\usepackage{cleveref}
-
\newcommand{\PackageDocName}{xassoccnt}%
\newcommand{\mymailtoaddress}{%
christian.hupfer@yahoo.de
+% christian.hupfer@yahoo.de
}
-
-
\let\DeclareAssociatedCountersOrig\DeclareAssociatedCounters % -> for use in examples only
\def\packageversion{\xassoccntpackageversion}%
@@ -138,10 +268,11 @@
\DeclareAssociatedCounters{proof}{totalproofs}
\DeclareAssociatedCounters{page}{totalpages,anothertotalpages}%
+\NewTotalDocumentCounter{foototal}%
\hypersetup{breaklinks=true,
pdftitle={\jobname.pdf -- version \packageversion},
- pdfauthor={Dr. Christian Hupfer},
+ pdfauthor={PACKAGEAUTHOR},
pdfsubject={Documentation of \PackageDocName\ package},
pdfkeywords={LaTeX, counters},
pdfcreator={LaTeX}
@@ -156,36 +287,13 @@
\setlength{\parindent}{0pt}
\thispagestyle{empty}%
-
-\begin{center}
-\begin{tcolorbox}[enhanced jigsaw,drop lifted shadow,colback=yellow!30!white,width=0.8\textwidth]
-\large \bfseries%
-\begin{center}%
-\begin{tabular}{c}%
-\scshape \PackageDocName \tabularnewline
-\tabularnewline
-Associated counters stepping simultaneously \tabularnewline
-\tabularnewline
-Version \packageversion \tabularnewline
-\tabularnewline
-\today \tabularnewline
-\tabularnewline
-\addtocounter{footnote}{2}
-Author: Christian Hupfer\(^\mathrm{\fnsymbol{footnote}}\)
-\tabularnewline
-\end{tabular}
-\end{center}
-\end{tcolorbox}
-\makeatletter
-\renewcommand{\thefootnote}{\fnsymbol{footnote}}%
-\footnotetext{\mymailtoaddress}%
-\makeatother
-
-\end{center}
-
+\CHPackageTitlePage[packageauthor={Christian Hupfer}]{Associated counters stepping simultaneously}
+\clearpage
\tableofcontents
\clearpage
+\CHDocConventions
+\clearpage
@@ -197,7 +305,7 @@ Author: Christian Hupfer\(^\mathrm{\fnsymbol{footnote}}\)
\section*{Preface}
-This package is the successor and a complete rewrite of \packagename{assoccnt}. Not all features of that package are implemented yet -- if some functionality of your document depends on \packagename{assoccnt}, continue using the older version and shift gradually to \packagename{\PackageDocName} please.
+This package is the successor and a complete rewrite of \CHDocPackage{assoccnt}. Not all features of that package are implemented yet -- if some functionality of your document depends on \CHDocPackage{assoccnt}, continue using the older version and shift gradually to \CHDocPackage{\PackageDocName} please.
\begin{marker}
Most times class and package authors will benefit of this package, but there might be usual documents that need the features of |\PackageDocName||
@@ -205,7 +313,7 @@ Most times class and package authors will benefit of this package, but there mig
\section{Introduction}
-The aim of this package is to provide some additional support for example for a package like \packagename{totcount}.
+The aim of this package is to provide some additional support for example for a package like \CHDocPackage{totcount}.
For example, the total number of pages in a document could be achieved by using
@@ -228,41 +336,70 @@ Please note, that this package does not provide means for simultaneous stepping
-\section{Requirements and incompatibilities}%
+\section{Requirements, loading and incompatibilities}%
+
+
+
+\subsection{Required packages and \TeX\ engine}
-\subsection{Required packages}
+The package does not require features from Xe\LaTeX\ or Lua\LaTeX but can be run with those features as well as with \LaTeX\ or pdf\LaTeX. The compilation documentation requires however pdf\LaTeX as of version \packageversion.
\begin{itemize}
-\item \packagename{xcolor}
-\item \packagename{xparse}
-\item \packagename{l3keys2e}
+\item \CHDocPackage{xcolor}
+\item \CHDocPackage{xparse}
+\item \CHDocPackage{l3keys2e}
\end{itemize}
-\subsection{Incompatibilities}
+The documentation file requires some more packages such as \CHDocPackage{tcolorbox} but those packages are available on CTAN, MikTeX and TeXLive as well and are basically widely available.
+
+\subsection{Loading of the package}
+
+Loading is done with
+
+\begin{tcblisting}{listing only}
+\usepackage[options]{xassoccnt}
+\end{tcblisting}
+
+For the relevant options see \cref{subsection:packageoptions}
+
+Concerning the packages \CHDocPackage{hyperref} and \CHDocPackage{cleveref}: The preferred loading order is the usually recommended on:
+\begin{itemize}
+ \item other packages
+ \item \CHDocPackage{xassoccnt}
+ \item \CHDocPackage{hyperref}
+ \item \CHDocPackage{cleveref}
+\end{itemize}
+
+For potential problems see \cref{subsection:incompatibilities}
+
+\subsection{Incompatibilities}\label{subsection:incompatibilities}
+
\begin{itemize}
-\item This package does not work really well with the \packagename{calc} package if that one is loaded after \packagename{\PackageDocName}. Load \packagename{calc} \textbf{before} \packagename{\PackageDocName}!
+\item This package cannot be used with plain \TeX\ and will not provide support for counters (or better counter registers) that have defined with the \TeX\ primitive \cs{countdef} directly in a \LaTeXe\ document nor will it hook into plain \TeX\ \cs{advance} commands used otherwise than in the usual \LaTeXe\ wrappers \cs{addtocounter} etc.
+
+\item This package does not work really well with the \CHDocPackage{calc} package if that one is loaded after \CHDocPackage{\PackageDocName}. Load \CHDocPackage{calc} \textbf{before} \CHDocPackage{\PackageDocName}!
\begin{marker}
\tcbdocmarginnote{\bcbombe\tcbdocupdated{2015-11-10}}
- As of version \packageversion\ \packagename{\PackageDocName} will abort compilation if \packagename{calc} is loaded after this package, but will issue a warning only if \packagename{calc} is loaded first.
+ As of version \packageversion\ \CHDocPackage{\PackageDocName} will abort compilation if \CHDocPackage{calc} is loaded after this package, but will issue a warning only if \CHDocPackage{calc} is loaded first.
\end{marker}
-\item \packagename{\PackageDocName} and \packagename{perpage} are not compatible completely. As of version \packageversion\ it is not possible to use the command \cs{AddAbsoluteCounter} from \packagename{perpage} -- this feature is provided already by this package.
+\item \CHDocPackage{\PackageDocName} and \CHDocPackage{perpage} are not compatible completely. As of version \packageversion\ it is not possible to use the command \cs{AddAbsoluteCounter} from \CHDocPackage{perpage} -- this feature is provided already by this package.
\tcbdocmarginnote{\tcbdocnew{2015-11-10}}
\begin{marker}
- It is not recommended to use counters under control of \packagename{perpage} with the association method!
+ It is not recommended to use counters under control of \CHDocPackage{perpage} with the association method!
\end{marker}
% is somewhat similar to \refCom{AddAssociatedCounters} from this package but unless changed manually, the values of and \texttt{perpage} - absolute counter and an associated counter by this package differ by one, since \cs{AddAbsoluteCounter} initializes the counter value to the value of 1.
-%\item This package does not work together when the Package \packagename{xifthen} is included. As of version \packageversion~I could not figure out, where the strange behaviour comes in. It's most likely an incompatibility between \packagename{etoolbox} and \packagename{xifthen}
+%\item This package does not work together when the Package \CHDocPackage{xifthen} is included. As of version \packageversion~I could not figure out, where the strange behaviour comes in. It's most likely an incompatibility between \CHDocPackage{etoolbox} and \CHDocPackage{xifthen}
%\marginnote{\bcbombe}
\end{itemize}
-\subsection{Package options}
+\subsection{Package options}\label{subsection:packageoptions}
-As of version \packageversion\ \packagename{\PackageDocName} supports the option
+As of version \packageversion\ \CHDocPackage{\PackageDocName} supports the option
\begin{docKey}{autodefinecounters}{=\meta{true,false}}{initially false}
Setting this package option to \texttt{true}, all counters used with the special package macros will be autodefined, unless disabled locally. See the commands
@@ -617,7 +754,7 @@ This command checks, whether a counter is suspended, i.e. not updated at all and
\subsubsection[\cs{IfIsDocumentCounter}-Queries]{Commands checking whether a name refers to a counter}
-\packagename{\PackageDocName}\ provides three commands that are quite similar -- all check whether \marg{name} is an already defined \LaTeXe\ counter (name), in good tradition with the \packagename{xparse} - syntax:
+\CHDocPackage{\PackageDocName}\ provides three commands that are quite similar -- all check whether \marg{name} is an already defined \LaTeXe\ counter (name), in good tradition with the \CHDocPackage{xparse} - syntax:
\begin{itemize}
\item \begin{docCommand}{IfIsDocumentCounterTF}{\oarg{}\marg{name}\marg{true branch}\marg{false branch}}
@@ -949,6 +1086,121 @@ This document synchronizes the driver counter value to the associated values. It
\end{docCommand}%
+\section{Total counters}\tcbdocmarginnote{\tcbdocnew{2015-11-27}}
+
+Similarly to the package \CHDocPackage{totcount} or the features of \CHDocPackage{totalcount} by Axel Sommerfeldt this package provides the possibility of defining a counter that stores its finally value to the auxiliary file and starts from this value then, if not set otherwise to another value.
+
+%In order to prevent namespace pollution, the counters have a different name internally, it's possible to have a counter of the name \texttt{foo} and a total counter named \texttt{foo} under the control of the total counter macros.
+
+The declaration of a total counter is a preamble - only event and \refCom{NewTotalDocumentCounter} is a preamble-only command in order to prevent counter register confusion.
+
+\begin{marker}
+\tcbdocmarginnote{\bcbombe}The standard \LaTeXe\ commands \cs{stepcounter}, \cs{addtocounter} and \cs{setcounter} support the specification of a total counter, but \cs{refstepcounter} will fail since the usage of a total counter for labelling purposes is most probably of no use (as of version \packageversion)
+\end{marker}
+
+
+
+
+
+\begin{docCommand}{TotalCounterInternalName}{\marg{counter name}}
+This command reports the internal name of a total counter or the usual name if this counter is a total one.
+\end{docCommand}
+
+\begin{dispExample}
+\TotalCounterInternalName{chapter}
+
+\TotalCounterInternalName{foototal}
+\end{dispExample}
+
+
+\stepcounter{foototal}
+\begin{docCommand}{TotalValue}{\marg{counter name}}
+This command prints the value of a total counter or falls back to the value of the counter if this is not a total counter.
+
+\begin{dispExample}
+``Total'' value of the section non-total counter: \TotalValue{section}
+
+Total value of the foototal total counter: \TotalValue{foototal}
+\end{dispExample}
+
+
+\end{docCommand}
+
+\begin{docCommand}{IsTotalCounterTF}{\marg{counter name}\marg{true branch}\marg{false branch}}
+This macro tests if a counter is under the administration of the total counter commands and expands to the relevant branch then. There are two short-circuit commands \refCom{IsTotalCounterT} and \refCom{IsTotalCounterF}.
+\end{docCommand}
+
+
+
+\begin{docCommand}{IsTotalCounterT}{\marg{counter name}\marg{true branch}}
+This macro checks if a counter is under the administration of the total counter commands and expands to the code in the second argument if this is true.
+\end{docCommand}
+
+
+\begin{docCommand}{IsTotalCounterF}{\marg{counter name}\marg{false branch}}
+This macro checks if a counter is under the administration of the total counter commands and expands to the code in the second argument if this is not the case.
+\end{docCommand}
+
+\begin{dispExample}
+ \IsTotalCounterTF{foototal}{Yes, this is a total counter}{No, this is no total counter}
+
+ \IsTotalCounterTF{section}{Yes, this is a total counter}{No, this is no total counter}
+
+ \IsTotalCounterT{foototal}{Yes, this is a total counter}
+
+ \IsTotalCounterF{page}{No, page isn't a total counter}
+
+\end{dispExample}
+
+\begin{marker}
+ The features of using other \CHDocFiles{aux} files or a different external file as provided by \CHDocPackage{totcount} is not (yet) support as of version \packageversion.
+\end{marker}
+
+\section{Super total counters}\label{section:supertotalcounters} \tcbdocmarginnote{\tcbdocnew{2015-11-25}}
+In addition to the concept of a total counter, there is also the possibility of using super total counters -- those counters survive the reset at the beginning of a compilation, i.e. the value of a super total counter might be stepped in each run and as such the number of compilation runs etc. can be tracked. The values of the last run are persistent as long as the \CHDocFileExt{.aux} file isn't deleted.
+
+\begin{docCommand}{NewTotalDocumentCounter}{\oarg{options}\marg{total counter name}}
+\begin{codeoptionsenum}
+ \item \oarg{options}: As of version \packageversion, only this option is used
+ \begin{docKey}{supertotal}{=\meta{true,false}}{false}
+ Set this key to switch the super total counter on or off.
+ \end{docKey}
+ \item \marg{total counter name}: The name of the total counter. This must not be the same like the name of any already existing counter. Internally another counter is defined which has a prefix to prevent name clashes with counter names defined by the package \CHDocPackage{totalcount}.
+\end{codeoptionsenum}
+
+
+\end{docCommand}
+
+
+
+\begin{docCommand}{IsSuperTotalCounterTF}{\marg{counter name}\marg{true branch}\marg{false branch}}
+This macro tests if a counter is under the administration of the super total counter commands and expands to the relevant branch then. There are two short-circuit commands \refCom{IsSuperTotalCounterT} and \refCom{IsSuperTotalCounterF}.
+\end{docCommand}
+
+
+
+\begin{docCommand}{IsSuperTotalCounterT}{\marg{counter name}\marg{true branch}}
+This macro checks if a counter is under the administration of the super total counter commands and expands to the code in the second argument if this is true.
+\end{docCommand}
+
+
+\begin{docCommand}{IsSuperTotalCounterF}{\marg{counter name}\marg{false branch}}
+This macro checks if a counter is under the administration of the super total counter commands and expands to the code in the second argument if this is not the case.
+\end{docCommand}
+
+
+\begin{dispExample}
+ \IsSuperTotalCounterTF{numberofruns}{Yes, this is a super total counter}{No, this is no super total counter}
+
+ \IsSuperTotalCounterT{numberofruns}{Yes, this is a super total counter}
+
+ \IsSuperTotalCounterTF{chapter}{Yes, this is a total counter}{No, this is no super total counter}
+\end{dispExample}
+
+\subsection{The \CHDocCounter{numberofruns} counter}\label{subsection:numberofruns}
+
+This package adds a counter of its own: \CHDocCounter{numberofruns} which is a super total counter and is stepped each compilation run. It's added in \cs{AtBeginDocument} and can be retrieved with \refCom{TotalValue}.
+
\clearpage
@@ -956,14 +1208,13 @@ This document synchronizes the driver counter value to the associated values. It
\begin{itemize}
\item Better counter definition/copy counter routines \(\longrightarrow\) another package perhaps
-\item Check the existence of driver and associated counters
\item More examples
-\item Provide a better internal list organization
\item Some macro names might be non-intuitive
\item Improve documentation
+\item Hooks for conditionals on \CHDocCounter*{numberofruns} (see \cref{subsection:numberofruns})
%\item Allow for specific counter to be resumed from suspension instead of resuming all
%\item Allow for an associated counter to have multiple masters
-%\item Complete redesign and rewrite with \packagename{expl3} -- this will provide better list features
+%\item Complete redesign and rewrite with \CHDocPackage{expl3} -- this will provide better list features
\end{itemize}
If you
@@ -991,14 +1242,14 @@ to the users at tex.stackexchange.com, especially to
\item David Carlisle
\item Werner
\item Gonzalo Medina
- \item Cosmo Huber (for providing the bug report with the \packagename{calc} package.)
+ \item Cosmo Huber (for providing the bug report with the \CHDocPackage{calc} package.)
\end{itemize}
for their invaluable help on many questions on macros.
\vspace{2\baselineskip}
\begin{marker}
-A special gratitude goes to Prof. Dr. Dr. Thomas Sturm for providing the wonderful \packagename{tcolorbox} package which was used to
+A special gratitude goes to Prof. Dr. Dr. Thomas Sturm for providing the wonderful \CHDocPackage{tcolorbox} package which was used to
write this documentation.
\end{marker}
@@ -1007,23 +1258,29 @@ write this documentation.
\section{Version history}
\begin{itemize}
-
+\item
+Version 0.3
+\begin{itemize}[label={$\checkmark$}]
+\item Added the \CHDocTag{totalcounter} features similar to the packages \CHDocPackage{totcount} or \CHDocPackage{totalcount} \tcbdocmarginnote{\tcbdocnew{2015-11-11}}
+\item Added the \CHDocTag{super total counter} features\tcbdocmarginnote{\tcbdocnew{2015-25-11}}
+\item Added the \CHDocCounter*{numberofruns} counter \tcbdocmarginnote{\tcbdocnew{2015-25-11}}
+\end{itemize}
\item
Version 0.2
-Improved \cs{stepcounter} to remove some incompatibilities with the \packagename{perpage}. This is only partially managed so far.
+Improved \cs{stepcounter} to remove some incompatibilities with the \CHDocPackage{perpage}. This is only partially managed so far.
\item
Version: 0.1
- A major bug fixed due to some error in usage together with \packagename{calc} when the driven counters are not stepped any longer.
- The culprit was in \packagename{assoccnt} that the counter reset list was not really disabled.
+ A major bug fixed due to some error in usage together with \CHDocPackage{calc} when the driven counters are not stepped any longer.
+ The culprit was in \CHDocPackage{assoccnt} that the counter reset list was not really disabled.
Thanks to this question \url{http://tex.stackexchange.com/questions/269731/calc-breaks-assoccnt} this bug was detected.
- This however lead to some internal inconsistencies and it was decided to rewrite \packagename{assoccnt} with \packagename{expl3} and the features of the new \LaTeX\ 3 - Syntax.
+ This however lead to some internal inconsistencies and it was decided to rewrite \CHDocPackage{assoccnt} with \CHDocPackage{expl3} and the features of the new \LaTeX\ 3 - Syntax.
\end{itemize}
\clearpage
diff --git a/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_driver.pdf b/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_driver.pdf
index ac6b26ff116..129e063b48f 100644
--- a/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_driver.pdf
+++ b/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_driver.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_driver.tex b/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_driver.tex
index 2d0d8f5fd8b..564d1b569a6 100644
--- a/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_driver.tex
+++ b/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_driver.tex
@@ -1,9 +1,9 @@
-%% LaTeX package xassoccnt - version 0.2 (2015/11/14 -- 16/08/33)
+%% LaTeX package xassoccnt - version 0.3 (2016/01/08 -- 10/54/13)
%% Driver file for xassoccnt.sty
%%
%%
%% -------------------------------------------------------------------------------------------
-%% Copyright (c) 2015 by Dr. Christian Hupfer <christian dot hupfer at yahoo dot de>
+%% Copyright (c) 2016 by Dr. Christian Hupfer <christian dot hupfer at yahoo dot de>
%% -------------------------------------------------------------------------------------------
%%
%% This work may be distributed and/or modified under the
@@ -24,7 +24,7 @@
\usepackage{xcolor}
\usepackage{totcount}
\usepackage{calc}
-\usepackage[autodefinecounters=true]{xassoccnt}
+\usepackage[autodefinecounters=false]{xassoccnt}
\usepackage{hyperref}
@@ -36,8 +36,9 @@
\newcounter{othersections}
\newtotcounter{totaltables}
+\NewTotalDocumentCounter{equations}
-\DeclareAssociatedCounters[autodefine=none]{section}{totalsections,othersections}
+\DeclareAssociatedCounters[autodefine=none]{section}{totalsections,othersections,equations}
\AddAssociatedCounters{section}{totalsections}
@@ -45,10 +46,7 @@
\DeclareAssociatedCounters{table}{totaltables}
-
\begin{document}
-
-
\chapter{First}
In \cref{section::dummylabel} we will see that
@@ -87,6 +85,8 @@ In \cref{section::dummylabel} we will see that
\end{equation}
+\TotalValue{equations}
+
\chapter{Second chapter}
\section{First section of 2nd chapter} \label{section::dummylabel}
@@ -103,7 +103,18 @@ In \cref{section::dummylabel} we will see that
\IsAssociatedCounter{equation}{Yes, it's associated}{Nope, it's not associated}
-\SetDocumentCounter[associatedtoo=true,onlycounters={totalsections,gandalf},associatedtoo=true]{section}{17}
+\TotalValue{equations}
+
+
+%\SetDocumentCounter[associatedtoo=true,onlycounters={totalsections,gandalf},associatedtoo=true]{section}{17}
+
+%\SetDocumentCounter[associatedtoo=true,onlycounters={totalsections,gandalf,equations}]{section}{21}
+
+%\SetDocumentCounter{equations}{17}
+%\setcounter{equations}{17}
+
+\TotalValue{equations}
+
\SetDocumentCounter{section}{28}
@@ -135,6 +146,15 @@ Value of counterother: \thecounterother
}
+\IsSuperTotalCounterT{numberofruns}{%
+ Yes, numberofruns is a super total counter
+}
+
+\IsSuperTotalCounterF{chapter}{%
+ No, chapter is not a super total counter
+}
+
+
\countersresetlistcount{chapter}
\SetDocumentCounter{counterother}{\getresetlistcount}
@@ -145,19 +165,32 @@ Value of counterother: \thecounterother
\item Values: \thesection\ \total{totalsections}\ \theothersections\ \fbox{\color{blue}{\total{totaltables}}}\ \thecounterother.
\end{itemize}
+Total value: \TotalValue{equations} and \TotalValue{chapter}
+
+Internal name: \TotalCounterInternalName{equations}
+
\begin{table}
\caption{table}
\end{table}
-\chapter{First}
+%\stepcounter{equations}
+
+
+\chapter{Another chapter}
+
+\PrettyPrintCounterName{countertype=general}{equation}
+\PrettyPrintCounterName{countertype=driver}{chapter}
+\PrettyPrintCounterName{countertype=associated}{totalsections}
+\PrettyPrintCounterName{countertype=total}{equations}
+
\begin{table}
\caption{table}
\end{table}
-
+%\RemoveSuperTotalCounter{numberofruns}
\end{document} \ No newline at end of file
diff --git a/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_example.pdf b/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_example.pdf
index 696e5c5c432..39b79bfe016 100644
--- a/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_example.pdf
+++ b/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_example.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_example.tex b/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_example.tex
index 6acb4663c00..f89bb7c1967 100644
--- a/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_example.tex
+++ b/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_example.tex
@@ -1,9 +1,9 @@
-%% LaTeX package xassoccnt - version 0.2 (2015/11/14 -- 16/08/33)
+%% LaTeX package xassoccnt - version 0.3 (2016/01/08 -- 10/54/13)
%% Example file for xassoccnt.sty
%%
%%
%% -------------------------------------------------------------------------------------------
-%% Copyright (c) 2015 by Dr. Christian Hupfer <christian dot hupfer at yahoo dot de>
+%% Copyright (c) 2016 by Dr. Christian Hupfer <christian dot hupfer at yahoo dot de>
%% -------------------------------------------------------------------------------------------
%%
%% This work may be distributed and/or modified under the
diff --git a/Master/texmf-dist/tex/latex/xassoccnt/xassoccnt.sty b/Master/texmf-dist/tex/latex/xassoccnt/xassoccnt.sty
index 2ca160fb86d..bcd25c90962 100644
--- a/Master/texmf-dist/tex/latex/xassoccnt/xassoccnt.sty
+++ b/Master/texmf-dist/tex/latex/xassoccnt/xassoccnt.sty
@@ -1,9 +1,9 @@
-%% LaTeX package xassoccnt - version 0.2 (2015/11/14 -- 16/08/33)
+%% LaTeX package xassoccnt - version 0.3 (2016/01/08 -- 10/54/13)
%% Source file for xassoccnt.sty
%%
%%
%% -------------------------------------------------------------------------------------------
-%% Copyright (c) 2015 by Dr. Christian Hupfer <christian dot hupfer at yahoo dot de>
+%% Copyright (c) 2016 by Dr. Christian Hupfer <christian dot hupfer at yahoo dot de>
%% -------------------------------------------------------------------------------------------
%%
%% This work may be distributed and/or modified under the
@@ -19,16 +19,18 @@
%%
%%
-\def\xassoccntpackageversion{0.2}
+\def\xassoccntpackageversion{0.3}
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{xassoccnt}[2015/11/14 - v\xassoccntpackageversion]
+\ProvidesPackage{xassoccnt}[2016/01/08 - v\xassoccntpackageversion]
\RequirePackage{xcolor}
\RequirePackage{xparse}
\RequirePackage{l3keys2e}
+
+
\ExplSyntaxOn
% First some local or global values
@@ -53,7 +55,9 @@
\bool_new:N \l__xassoccnt_countertype_general
\bool_new:N \l__xassoccnt_countertype_driver
\bool_new:N \l__xassoccnt_countertype_associated
+\bool_new:N \l__xassoccnt_countertype_total
+\bool_new:N \l__xassoccnt_is_supertotalcounter_bool
\seq_new:N \l__xassoccnt_counterreset_seq
@@ -111,10 +115,35 @@
%% For later purposes
countertype .choice:,
- countertype / general .code:n= {\bool_set_true:N \l__xassoccnt_countertype_general },
- countertype / driver .code:n= {\bool_set_true:N \l__xassoccnt_countertype_driver },
- countertype / associated .code:n= {\bool_set_true:N \l__xassoccnt_countertype_associated },
- countertype .initial:n={ general }
+ countertype / general .code:n= {\bool_set_true:N \l__xassoccnt_countertype_general
+ \__xassoccnt_set_false:n {l__xassoccnt_countertype_driver,
+ l__xassoccnt_countertype_total,
+ l__xassoccnt_countertype_associated
+ }
+ },
+%\bool_set_false:N \l__xassoccnt_countertype_driver \bool_set_false:N \l__xassoccnt_countertype_associated },
+ countertype / driver .code:n= {\bool_set_true:N \l__xassoccnt_countertype_driver
+ \__xassoccnt_set_false:n {l__xassoccnt_countertype_general,
+ l__xassoccnt_countertype_total,
+ l__xassoccnt_countertype_associated
+ }
+ },
+% \bool_set_false:N \l__xassoccnt_countertype_assocciated \bool_set_false:N \l__xassoccnt_countertype_general },
+ countertype / associated .code:n= {\bool_set_true:N \l__xassoccnt_countertype_associated
+ \__xassoccnt_set_false:n {l__xassoccnt_countertype_general,
+ l__xassoccnt_countertype_total,
+ l__xassoccnt_countertype_driver
+ }
+ },
+ countertype / total .code:n= {\bool_set_true:N \l__xassoccnt_countertype_total
+ \__xassoccnt_set_false:n {l__xassoccnt_countertype_driver,
+ l__xassoccnt_countertype_general,
+ l__xassoccnt_countertype_associated
+ }
+ },
+ countertype .initial:n={ general },
+
+ supertotal .bool_set:N={\l__xassoccnt_is_supertotalcounter_bool }
}
\ProcessKeysOptions{xassoccnt}
@@ -154,12 +183,8 @@
-\cs_new:Nn \__xassoccnt_stpelt:n{\global\csname c@#1\endcsname\c_minus_one\xassoccnt_addtocounter{#1}{\c_one}}%
-
%\cs_new:Nn \__xassoccnt_stpelt:n{\global\csname c@#1\endcsname\c_minus_one\xassoccnt_addtocounter{#1}{\c_one}}%
-
-
\cs_new:Nn \__xassoccnt_intinc:n {\int_gincr:N \l_xassoccnt_resetlist_counter}%
\int_new:N \l_xassoccnt_resetlist_counter
@@ -168,7 +193,6 @@
\begingroup
\int_zero:N \l_xassoccnt_resetlist_counter
\cs_set_eq:NN \@elt \__xassoccnt_intinc:n
-% \def\@elt##1{\int_gincr:N \l_xassoccnt_resetlist_counter}% Increase the 'counter' globally
\use:c{ cl@#1 }
\endgroup
}
@@ -250,6 +274,8 @@
\cs_new_nopar:Nn \__xassoccnt_container_clear:n {\seq_clear:N #1 }
+\seq_new:N \g__xassoccnt_totalcounter_container
+\seq_new:N \g__xassoccnt_supertotalcounter_container
\cs_new_nopar:Nn \__xassoccnt_container_perdriver_new:n {
\seq_if_exist:cF{ \__xassoccnt_drivercontainer:n {#1} }
@@ -321,12 +347,28 @@
}
+\cs_new_nopar:Nn \__xassoccnt_expand_totalcountername:n {%
+ xassoccnt@total@#1%
+}
+
+
+
+\cs_new:Nn \__xassoccnt_translate_counterlist:n {%
+ \clist_clear:N \l_tmpb_clist
+ \clist_set:Nx \l_tmpa_clist {#1}%
+ \clist_map_inline:Nn \l_tmpa_clist {%
+ \__xassoccnt_is_totalcounter:nTF { ##1 }
+ { \clist_gput_right:Nx \l_tmpb_clist { \__xassoccnt_expand_totalcountername:n {##1} } }
+ { \clist_gput_right:Nn \l_tmpb_clist {##1} }
+ }
+ \clist_set_eq:NN \l_tmpa_clist \l_tmpb_clist
+}
\cs_new:Nn \__xassoccnt_addassociatedcounters:nnn {%
\keys_set:nn{xassoccnt}{#1}
- \clist_set:Nx \l_tmpa_clist {#3}%
- \clist_if_in:NnT \l_tmpa_clist{#2}{% Prevent self-association
+ \clist_set:Nx \l_tmpa_clist {#3}
+ \clist_if_in:NnT \l_tmpa_clist {#2} {% Prevent self-association
\msg_warning:nnn{xassoccnt}{selfassociation}{#2}% Warning
\clist_gremove_all:Nn \l_tmpa_clist {#2}%
}%
@@ -495,13 +537,12 @@
\NewDocumentCommand{\SuspendCounters}{O{}m}{%
\keys_set:nn { xassoccnt }{#1}%
-% \clist_if_empty:NF \l__xassoccnt_onlycounters_clist {%
\__xassoccnt_container_putright:nn{\c_xassoccnt_suspendedname_str}{#2}
}
\NewDocumentCommand{\ResumeSuspendedCounters}{O{}m}{%
- \__xassoccnt_container_removecounter:nn{\c_xassoccnt_suspendedname_str}{#2}
+ \__xassoccnt_container_removecounter:nn{\c_xassoccnt_suspendedname_str}{#2}%
}
@@ -648,35 +689,58 @@
+
+
\cs_new:Nn \__xassoccnt_step_associatedcounters:n {%
\seq_if_exist:cT { \__xassoccnt_drivercontainer:n{#1} }
{ \seq_map_inline:cn {\__xassoccnt_drivercontainer:n{#1} }
- { \xassoccnt_addtocounter{##1}{\c_one} }
+ {
+ \xassoccnt_addtocounter{##1}{\c_one}
+ }
}
% End of \seq_if_exist
}
+\prg_new_conditional:Nnn \__xassoccnt_is_totalcounter:n {T,F,TF}
+{%
+ \seq_if_in:NxTF \g__xassoccnt_totalcounter_container { \__xassoccnt_expand_totalcountername:n {#1} }
+ {
+ \prg_return_true:
+ }{%
+ \prg_return_false:
+ }%
+}
+
+
+\cs_new_nopar:Nn \__xassoccnt_translate_countername:cn {%
+ \tl_set:cn {#1}{#2}%
+ \seq_if_in:NxT \g__xassoccnt_supertotalcounter_container {#2} {%
+ \tl_set:cn {#1}{\__xassoccnt_expand_totalcountername:n {#2} }%
+ }
+}
+
\RenewDocumentCommand{\stepcounter}{m}{%
+ \__xassoccnt_translate_countername:cn {l_tmpa_tl} {#1}%
\xassoccnt_is_suspendedcounter:nF{#1}{%
- \cs_gset_nopar:Nn \__xassoccnt_laststeppedcounter: {#1}%
- \xassoccnt_countersinresetlist:n{#1}%
- \__xassoccnt_getresetlist:n {#1}%
+ \cs_gset_nopar:Nn \__xassoccnt_laststeppedcounter: {\l_tmpa_tl}%
+ \xassoccnt_countersinresetlist:n{\l_tmpa_tl}%
+ \__xassoccnt_getresetlist:n {\l_tmpa_tl}%
\seq_if_empty:NTF \l__xassoccnt_counterreset_seq
{%
- \xassoccnt_standardaddtocounter{#1}{\c_one}% Use the original one!
- \int_gset:Nn \g__xassoccnt_lastcountervalue_int {\number\value{#1}}%
- \__xassoccnt_step_associatedcounters:n {#1}
+ \xassoccnt_standardaddtocounter{\l_tmpa_tl}{\c_one}% Use the original one!
+ \int_gset:Nn \g__xassoccnt_lastcountervalue_int {\number\value{\l_tmpa_tl}}%
+ \__xassoccnt_step_associatedcounters:n {\l_tmpa_tl}
}{ % reset list is not empty!
% This is the replacement of \csname cl@#1\endcsname
- \xassoccnt_standardaddtocounter{#1}{\c_one}
+ \xassoccnt_standardaddtocounter{\l_tmpa_tl}{\c_one}
\seq_map_inline:Nn \l__xassoccnt_counterreset_seq {%
\csname c@##1\endcsname\c_minus_one
- \xassoccnt_standardstepcounter{##1}%{\c_one}%
+ \xassoccnt_standardstepcounter{##1}%
}
- \__xassoccnt_step_associatedcounters:n {#1} % step the remaining associated counters
+ \__xassoccnt_step_associatedcounters:n {\l_tmpa_tl} % step the remaining associated counters
}% End of not empty reset list
} % end of not suspended counter
}
@@ -687,20 +751,24 @@
\NewDocumentCommand{\xassoccnt_addtocounter}{mmO{}}{%
% Only add to a counter if this counter isn't on the suspended counters list!
\xassoccnt_is_suspendedcounter:nF{#1}{%
- \xassoccnt_standardaddtocounter{#1}{#2}%
- \cs_gset_nopar:Nn \__xassoccnt_lastaddtocounter: {#1}%
+ \__xassoccnt_translate_countername:cn {l_tmpb_tl} {#1}%
+ \xassoccnt_standardaddtocounter{\l_tmpb_tl}{#2}%
+ \cs_gset_nopar:Nn \__xassoccnt_lastaddtocounter: {\l_tmpb_tl}%
}%
}
-\cs_new:Nn \__xassoccnt_setdocumentcounter:nnn {
- \xassoccnt_standardsetcounter{#2}{#3}%
+\cs_new:Nn \__xassoccnt_setdocumentcounter:nnn {%
+ \__xassoccnt_translate_countername:cn {l_tmpa_tl} {#2}%
+ \xassoccnt_standardsetcounter{\l_tmpa_tl}{#3}%
\clist_clear:N \l__xassoccnt_onlycounters_clist
\keys_set:nn {xassoccnt}{#1}%
\bool_if:nTF {\l__xassoccnt_setcounter_associated } {%
\seq_if_exist:cT { \__xassoccnt_drivercontainer:n{#2} }
{ \seq_map_inline:cn {\__xassoccnt_drivercontainer:n{#2} }
- { \xassoccnt_standardsetcounter{##1}{#3} }
+ {
+ \__xassoccnt_translate_countername:cn {l_tmpb_tl} {##1}%
+ \xassoccnt_standardsetcounter{\l_tmpb_tl}{#3} }
}% End of \seq_if_exist
}{%
% Check whether the `onlycounters` - clist is empty -- if not, loop through the list
@@ -709,13 +777,14 @@
{
\clist_map_inline:Nn \l__xassoccnt_onlycounters_clist
{ % Check first if ##1 is associated to #2 at all
- \xassoccnt_is_associatedtocounter:nnT {#2} {##1} { \xassoccnt_standardsetcounter{##1}{#3} }
+ \__xassoccnt_translate_countername:cn {l_tmpb_tl} {##1}%
+ \xassoccnt_is_associatedtocounter:nnT {#2} {\l_tmpb_tl} { \xassoccnt_standardsetcounter{\l_tmpb_tl}{#3} }
}
}
}
}
\cs_gset_nopar:Nn \__xassoccnt_lastsetdocumentcounter: {#2}%
- \int_gset:Nn \g__xassoccnt_lastcountervalue_int {\number\value{#2}}%
+ \int_gset:Nn \g__xassoccnt_lastcountervalue_int {\number\value{\l_tmpa_tl}}%
}
@@ -764,20 +833,20 @@
\RenewDocumentCommand{\setcounter}{mm}{%
+ \__xassoccnt_translate_countername:cn {l_tmpb_tl}{#1}%
\cs_gset_nopar:Nn \__xassoccnt_lastsetcounter: {#1}
- \xassoccnt_standardsetcounter{#1}{#2}%
- \int_gset:Nn \g__xassoccnt_lastcountervalue_int {\number\value{#1}}%
+ \xassoccnt_standardsetcounter{\tl_use:N \l_tmpb_tl}{#2}%
+ \int_gset:Nn \g__xassoccnt_lastcountervalue_int {\number\value{\l_tmpb_tl}}%
}
\RenewDocumentCommand{\refstepcounter}{m}{%
\cs_gset_nopar:Nn \__xassoccnt_lastrefsteppedcounter: {#1}
-% \stepcounter{#1}%
\xassoccnt_standardrefstepcounter{#1}%
\int_gset:Nn \g__xassoccnt_lastcountervalue_int {\number\value{#1}}%
}
-%%%% Now some wrapper macros for information on the last counter changed
+%%%% Now some expandable wrapper macros for information on the last counter changed
\newcommand{\LastSteppedCounter}{%
\__xassoccnt_laststeppedcounter:
@@ -875,9 +944,157 @@
}
+% Pretty printing counters
+
+\NewDocumentCommand{\PrettyPrintCounterName}{+mm}{%
+ \keys_set:nn {xassoccnt} {countertype=general,#1}%
+ \bool_if:nTF {\l__xassoccnt_countertype_general}
+ {
+ \fbox{\textcolor{\GeneralCounterInfoColor}{\textbf{#2}}}
+ }
+ {
+ \bool_if:nTF {\l__xassoccnt_countertype_driver} {
+ \fbox{\textcolor{\DriverCounterInfoColor}{\textbf{#2}}}%
+ }{
+ \bool_if:nTF {\l__xassoccnt_countertype_associated }
+ {%
+ \fbox{\textcolor{\AssociatedCounterInfoColor}{\textbf{#2}}}%
+ }{%
+ \bool_if:nTF {\l__xassoccnt_countertype_total }
+ {%
+ \fbox{\textcolor{\TotalCounterInfoColor}{\textbf{#2}}}%
+ }{
+ Error}%
+ }
+ }%
+ }%
+}
+
+%%%%%%%%%%% Total counter features
+
+\NewDocumentCommand{\IsTotalCounterTF}{m+m+m}{%
+ \__xassoccnt_is_totalcounter:nTF { #1 }
+ { #2 }
+ { #3 }
+}
+
+\NewDocumentCommand{\IsTotalCounterT}{m+m}{%
+ \__xassoccnt_is_totalcounter:nT { #1 }
+ { #2 }
+}
+
+\NewDocumentCommand{\IsTotalCounterF}{m+m}{%
+ \__xassoccnt_is_totalcounter:nF { #1 }
+ { #2 }
+}
+
+
+\NewDocumentCommand{\NewTotalDocumentCounter}{O{}m}{%
+ \keys_set:nn {xassoccnt} {supertotal=false,#1}
+ \DeclareDocumentCounter[sloppy=false]{#2}%
+ \cs_if_exist:cF { c\__xassoccnt_expand_totalcountername:n{#2} }
+ {
+ \DeclareDocumentCounter[sloppy=false,initial={\c_minus_one}]{\__xassoccnt_expand_totalcountername:n{#2}}
+ }
+ \seq_gput_right:Nx \g__xassoccnt_totalcounter_container {\__xassoccnt_expand_totalcountername:n{#2}}
+ \bool_if:NT \l__xassoccnt_is_supertotalcounter_bool {%
+ \__xassoccnt_add_supertotalcounter:n {#2}
+ }
+ \AtEndDocument{%
+ \__xassoccnt_writetotalcounters:nn {#2}{#2}
+ }%
+}
+
+
+\NewDocumentCommand{\TotalValue}{m}{%
+ \__xassoccnt_translate_countername:cn {l_tmpa_tl} {#1}
+ \number\value{\l_tmpa_tl}%
+}
+
+\cs_new:Nn \__xassoccnt_writetotalcounters:nn {%
+ \immediate\write\@mainaux {%
+ \string\IfIsDocumentCounterF\expandafter{\__xassoccnt_expand_totalcountername:n{#1}}{\string\DeclareDocumentCounter\expandafter{\__xassoccnt_expand_totalcountername:n{#1}}}
+ }
+ \seq_if_in:NnTF \g__xassoccnt_supertotalcounter_container {#1} {%
+ \immediate\write\@mainaux{%
+ \string\setcounter{\__xassoccnt_expand_totalcountername:n{#1}}{\number\value{\__xassoccnt_expand_totalcountername:n{#1}}}%
+ }
+ }{
+ \immediate\write\@mainaux{%
+ \string\setcounter{\__xassoccnt_expand_totalcountername:n{#1}}{\number\value{#2}}%
+ }
+ }
+}
+
+
+
+\NewDocumentCommand{\TotalCounterInternalName}{m}{%
+ \__xassoccnt_is_totalcounter:nTF { #1 }
+ { \__xassoccnt_expand_totalcountername:n {#1} }
+ { #1 } %
+}
+
+%%% Super total counter features
+
+\cs_new:Nn \__xassoccnt_add_supertotalcounter:n {%
+ \cs_if_exist:cTF {c@#1} {%
+ \seq_gput_right:Nx \g__xassoccnt_supertotalcounter_container {#1}
+ }{%
+ % Some warning/error message later on here!
+ }
+}
+
+\cs_new:Nn \__xassoccnt_remove_supertotalcounter:n {%
+ \seq_gremove_all:Nn \g__xassoccnt_supertotalcounter_container {#1}
+}
+
+
+\prg_new_conditional:Nnn \__xassoccnt_is_supertotalcounter:n {T,F,TF}
+{%
+ \seq_if_in:NxTF \g__xassoccnt_supertotalcounter_container { #1 }
+ {
+ \prg_return_true:
+ }{%
+ \prg_return_false:
+ }%
+}
+
+
+\NewDocumentCommand{\IsSuperTotalCounterTF}{m+m+m}{%
+ \__xassoccnt_is_supertotalcounter:nTF { #1 }
+ { #2 }
+ { #3 }
+}
+
+\NewDocumentCommand{\IsSuperTotalCounterT}{m+m}{%
+ \__xassoccnt_is_supertotalcounter:nT { #1 }
+ { #2 }
+}
+
+\NewDocumentCommand{\IsSuperTotalCounterF}{m+m}{%
+ \__xassoccnt_is_supertotalcounter:nF { #1 }
+ { #2 }
+}
+
+%\NewDocumentCommand{\AddSuperTotalCounter}{m}{%
+% \__xassoccnt_add_supertotalcounter:n {#1}%
+%}
+
+%\NewDocumentCommand{\RemoveSuperTotalCounter}{m}{%
+% \__xassoccnt_remove_supertotalcounter:n {#1}%
+%}
+
+
\ExplSyntaxOff
+
+\AtBeginDocument{%
+ \stepcounter{numberofruns}
+}
+
+
+
%%%%%%%%%%%
% Extended interface functions
@@ -891,7 +1108,19 @@
}%
}
+\@onlypreamble{\NewTotalDocumentCounter}
\@onlypreamble{\DeclareAssociatedCounters}
\@onlypreamble{\DeclareDocumentCounter}
+
+\NewTotalDocumentCounter[supertotal=true]{numberofruns}
+
+%%% Colour output routines
+
+\newcommand{\GeneralCounterInfoColor}{orange}
+\newcommand{\DriverCounterInfoColor}{blue}
+\newcommand{\AssociatedCounterInfoColor}{red}
+\newcommand{\TotalCounterInfoColor}{violet}
+
+
\endinput \ No newline at end of file