texlive[43396] Master/texmf-dist: xassoccnt (4mar17)

commits+karl at tug.org commits+karl at tug.org
Sun Mar 5 00:13:23 CET 2017


Revision: 43396
          http://tug.org/svn/texlive?view=revision&revision=43396
Author:   karl
Date:     2017-03-05 00:13:23 +0100 (Sun, 05 Mar 2017)
Log Message:
-----------
xassoccnt (4mar17)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/xassoccnt/README
    trunk/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_backupcounters_example.pdf
    trunk/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_backupcounters_example.tex
    trunk/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_coupledcounters_example.pdf
    trunk/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_coupledcounters_example.tex
    trunk/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_doc.pdf
    trunk/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_doc.tex
    trunk/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_example.pdf
    trunk/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_example.tex
    trunk/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_periodiccounters_example.pdf
    trunk/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_periodiccounters_example.tex
    trunk/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_resetlist_example.pdf
    trunk/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_resetlist_example.tex
    trunk/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_suspendedcounters_example.pdf
    trunk/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_suspendedcounters_example.tex
    trunk/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_totalcounters_example.pdf
    trunk/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_totalcounters_example.tex
    trunk/Master/texmf-dist/tex/latex/xassoccnt/xassoccnt.sty

Added Paths:
-----------
    trunk/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_driver_example.pdf
    trunk/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_driver_example.tex
    trunk/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_label_example.pdf
    trunk/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_label_example.tex

Removed Paths:
-------------
    trunk/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_driver.pdf
    trunk/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_driver.tex

Modified: trunk/Master/texmf-dist/doc/latex/xassoccnt/README
===================================================================
--- trunk/Master/texmf-dist/doc/latex/xassoccnt/README	2017-03-04 23:13:06 UTC (rev 43395)
+++ trunk/Master/texmf-dist/doc/latex/xassoccnt/README	2017-03-04 23:13:23 UTC (rev 43396)
@@ -1,9 +1,9 @@
-%% LaTeX package xassoccnt - version 1.1 (2016/10/29 -- 13:34:52)
+%% LaTeX package xassoccnt - version 1.2 (2017/03/04 -- 00:46:43)
 %% README file for xassoccnt.sty
 %%
 %%
 %% -------------------------------------------------------------------------------------------
-%% Copyright (c) 2015 -- 2016 by Dr. Christian Hupfer <typography dot with dot latex at gmail dot com>
+%% Copyright (c) 2015 -- 2017 by Dr. Christian Hupfer <typography dot with dot latex at gmail dot com>
 %% -------------------------------------------------------------------------------------------
 %%
 %% This work may be distributed and/or modified under the
@@ -26,7 +26,7 @@
 to the totcount package by Vasileios Koutavas (http://www.ctan.org/pkg/totcount), but
 can be used without it too.
 
-As of 2016/10/29 xassoccnt does not supersede the package assoccnt by the same author, however, 
-the older package isn't declared obsolete as of 2016/10/29
+As of 2017/03/04 xassoccnt does not supersede the package assoccnt by the same author, however, 
+the older package isn't declared obsolete as of 2017/03/04
 
 

Modified: trunk/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_backupcounters_example.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_backupcounters_example.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_backupcounters_example.tex	2017-03-04 23:13:06 UTC (rev 43395)
+++ trunk/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_backupcounters_example.tex	2017-03-04 23:13:23 UTC (rev 43396)
@@ -1,9 +1,9 @@
-%% LaTeX package xassoccnt - version 1.1 (2016/10/29 -- 13:34:52)
+%% LaTeX package xassoccnt - version 1.2 (2017/03/04 -- 00:46:43)
 %% Example file for backup counters file for xassoccnt.sty
 %%
 %%
 %% -------------------------------------------------------------------------------------------
-%% Copyright (c) 2016 by Dr. Christian Hupfer <typography dot with dot latex at gmail dot com>
+%% Copyright (c) 2016 -- 2017 by Dr. Christian Hupfer <typography dot with dot latex at gmail dot com>
 %% -------------------------------------------------------------------------------------------
 %%
 %% This work may be distributed and/or modified under the

Modified: trunk/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_coupledcounters_example.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_coupledcounters_example.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_coupledcounters_example.tex	2017-03-04 23:13:06 UTC (rev 43395)
+++ trunk/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_coupledcounters_example.tex	2017-03-04 23:13:23 UTC (rev 43396)
@@ -1,9 +1,9 @@
-%% LaTeX package xassoccnt - version 1.1 (2016/10/29 -- 13:34:52)
+%% LaTeX package xassoccnt - version 1.2 (2017/03/04 -- 00:46:43)
 %% Example file for coupled counters file for xassoccnt.sty
 %%
 %%
 %% -------------------------------------------------------------------------------------------
-%% Copyright (c) 2016 by Dr. Christian Hupfer <typography dot with dot latex at gmail dot com>
+%% Copyright (c) 2016 -- 2017 by Dr. Christian Hupfer <typography dot with dot latex at gmail dot com>
 %% -------------------------------------------------------------------------------------------
 %%
 %% This work may be distributed and/or modified under the

Modified: trunk/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_doc.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_doc.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_doc.tex	2017-03-04 23:13:06 UTC (rev 43395)
+++ trunk/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_doc.tex	2017-03-04 23:13:23 UTC (rev 43396)
@@ -1,9 +1,9 @@
-%% LaTeX package xassoccnt - version 1.1 (2016/10/29 -- 13:34:52)
+%% LaTeX package xassoccnt - version 1.2 (2017/03/04 -- 00:46:43)
 %% Documentation file for xassoccnt.sty
 %%
 %%
 %% -------------------------------------------------------------------------------------------
-%% Copyright (c) 2015 -- 2016 by Dr. Christian Hupfer <typography dot with dot latex at gmail dot com>
+%% Copyright (c) 2015 -- 2017 by Dr. Christian Hupfer <typography dot with dot latex at gmail dot com>
 %% -------------------------------------------------------------------------------------------
 %%
 %% This work may be distributed and/or modified under the
@@ -97,7 +97,11 @@
 
 \@namedef{xassoccntversion1.1}{v1.1 2016-10-29}
 
+\@namedef{xassoccntversion1.2}{v1.2 2017-03-03}
 
+\newcommand{\authorname}{Autor}
+
+
 \makeatother
 
 
@@ -147,7 +151,7 @@
           \today \tabularnewline
           \tabularnewline
           \addtocounter{footnote}{2}
-          Author: \KVchdocpackageauthor\(^\mathrm{\fnsymbol{footnote}}\)
+          \authorname: \KVchdocpackageauthor\(^\mathrm{\fnsymbol{footnote}}\)
           \tabularnewline
         \end{tabular}
       \end{center}
@@ -302,6 +306,19 @@
   }%
 }
 
+
+\newcommand{\CHDocExperimentalFeature}[1][Experimental]{%
+  \tcbdocmarginnote[doclang/new={N},
+  colframe=yellow!50!blue,
+  halign=left,
+  colback={blue!10!yellow},
+  fontupper={\tiny}
+  ]{%
+    #1%
+  }%
+}
+
+
 \usepackage{graphicx}%
 \usepackage[autodefinecounters=true]{xassoccnt}
 \usepackage{amsmath}
@@ -311,6 +328,7 @@
 \usepackage{bookmark}
 \usepackage{cleveref}
 \usetikzlibrary{mindmap}
+\usepackage{url}
 
 \setcounter{tocdepth}{3}
 \newcommand{\PackageDocName}{xassoccnt}%
@@ -317,7 +335,7 @@
 
 
 \newcommand{\mymailtoaddress}{%
-  typography.with.latex at gmail.com
+  typography.with.latex at gmail.com%
 }
 
 \doparttoc
@@ -535,7 +553,13 @@
   Using this package option the super total counter \CHDocCounter{numberofruns} counter will not be defined. See \cref{subsection:numberofruns} about this feature. 
 \end{docKey}
 
+\begin{docKey}{redefinelabel}{=\meta{true,false}}{initially \meta{true}}\CHDocNew{1.2}
+\CHDocExperimentalFeature This is an experimental feature as of version \packageversion. 
 
+Enables the redefinition of the \refCom{label} command and takes care of the optional argument of \refCom{label} if \CHDocPackage{cleveref} is used. This will provide \refCom{label} with a final optional argument that can be used to allow labels for associated counters (either all or only a specified list of counters), for more on this see \refCom{label} in \namecref{subsec::associated_counters_experimental} \nameref{subsec::associated_counters_experimental}. 
+\end{docKey}
+
+
 \clearpage
 \part{Tools for counters}
 
@@ -560,7 +584,7 @@
 
 \subsection[\LaTeXe\ additions]{Additions to \LaTeXe\ commands}
 
-\begin{docCommand}{NewDocumentCounter}{\oarg{options}\marg{counter}\oarg{resetting counter}}
+\begin{docCommand}{NewDocumentCounter}{\oarg{options}\marg{counter1,counter2,\dots}\oarg{resetting counter}}
   This command is a new interface to \cs{newcounter} and behaves effectively the same. %The first optional argument is reserved for later purposes but not used as of version \packageversion. 
   
     \begin{docKey}{initial}{=\meta{integer value}}{initially 0}
@@ -567,10 +591,13 @@
       This is used for the start value of the new counter. 
     \end{docKey}
 
+\CHDocUpdate{1.2}This command allows multiple counters (specified as a comma separated list) to be defined at once, but all have the same resetting counter then and initial value is the same for all those counters (if those options are given).
+
 \end{docCommand}%
 
 \begin{docCommand}{DeclareDocumentCounter}{\oarg{options}\marg{counter}\oarg{resetting counter}}
   This command is the preamble-only version of \refCom{NewDocumentCounter}. 
+  \CHDocUpdate{1.2}This command allows multiple counters (specified as a comma separated list) to be defined at once, but all have the same resetting counter then and initial value is the same for all those counters (if those options are given), i.e. the behaviour is like in \refCom{NewDocumentCounter}.
 \end{docCommand}%
 
 
@@ -872,7 +899,7 @@
 \begin{docCommand}[before={\CHDocNew{1.0}}\par]{RemoveFromReset}{\marg{counter name}\marg{driver counter name}}
 This macro removes the counter given in the first argument from the reset list of the driver counter given in the 2nd argument.
 
-If the 2nd argument does not point to a LaTeXe\ counter name an error message is shipped and the compilation fails. 
+If the 2nd argument does not point to a \LaTeXe\ counter name an error message is shipped and the compilation fails. 
 \end{docCommand}
 
 
@@ -879,13 +906,13 @@
 \begin{docCommand}[before={\CHDocNew{1.0}}]{RemoveFromFullReset}{\marg{counter name}\marg{driver counter name}}
 This macro removes the counter given in the first argument and all of its own reset list from the reset list of the driver counter given in the 2nd argument.
 
-If the 2nd argument does not point to a LaTeXe\ counter name an error message is shipped and the compilation fails. 
+If the 2nd argument does not point to a \LaTeXe\ counter name an error message is shipped and the compilation fails. 
 \end{docCommand}
 
 \begin{docCommand}[before={\CHDocNew{1.0}}]{AddToReset}{\marg{counter name}\marg{driver counter name}}
 This macro adds the counter given in the first argument to the reset list of the driver counter given in the 2nd argument.
 
-If the 2nd argument does not point to a LaTeXe\ counter name an error message is shipped and the compilation fails. 
+If the 2nd argument does not point to a \LaTeXe\ counter name an error message is shipped and the compilation fails. 
 \end{docCommand}
 
 
@@ -983,9 +1010,9 @@
   \item \marg{counter1, counter2,\dots} 
     Holds the comma separated list of counter names
   \item \marg{counter increment/decrement}
-    Specifies the value to be added or subtracted
+    Specifies the value to be added or subtracted.
 
-    No check is performed whether \textbf{is} or \textbf{expands} to an integer value. 
+    No check is performed whether \#2 \textbf{is} or \textbf{expands} to an integer value. 
   \end{codeoptionsenum}
 %\end{docCommandArgs}
 
@@ -1129,7 +1156,7 @@
 
 \begin{docCommand}{OctalValue}{\marg{counter name}} \CHDocNew{0.7}
 
-This command will print the value of the counter using uppercase hexadecimal digits. 
+This command will print the value of the counter using octal digits. 
 
 \end{docCommand}
 
@@ -1234,7 +1261,6 @@
 
 Using \refCom{AddAssociatedCounters} in the document body automated generation of counters is disabled. 
 
-% You have to use \refCom{DeclareAssociatedCounters} first, to set up the driver counter hook.
 
 
 \begin{docCommandArgs}{AddAssociatedCounters}
@@ -1287,6 +1313,14 @@
 \end{docCommand}
 
 
+\begin{docCommand}[before={\CHDocNew{1.2}}]{DeclareTotalAssociatedCounters}{\oarg{options}\marg{driver counter}\marg{associated counters list}}
+This command combines the features of \CHDocTag{associated counters} and \CHDocTag{total counters}, i.e. the associated counters are defined with \refCom{NewTotalDocumentCounter} and associated to the driver counter.
+
+See \cref{sec::totalcounters} for more information on \CHDocTag{total counters}. 
+\end{docCommand}
+
+
+
 \clearpage
 
 
@@ -1461,9 +1495,55 @@
 \end{docCommand}%
 
 
+\subsection{Associated counters -- Experimental features}\label{subsec::associated_counters_experimental}
+\begin{marker}
+\marginnote{\bcbombe}
+The content here is only of experimental nature and there is no guarantee that the feature will be maintained in future releases. 
+\end{marker}
 
-\section[Counter backup/restoration]{Backup and restore of counter values}\label{section::new_backuprestore}\CHDocNew{1.0}
+\begin{marker}
+To enable the redefined \refCom{label} macro, specify the package option \refKey{redefinelabel}
+\end{marker}
 
+
+
+\begin{docCommand}[before={\CHDocNew{1.2}}]{label}{\oarg{cleveref-counter-overrule}\marg{label name}\oarg{options for associated counters}}
+  \begin{docKey}{all}{=\meta{true,false}}{initially \meta{false}}\CHDocNew{1.2}
+    This will enable that all associated counters to a driver counter will cause the generation of a label too. By default this option is \meta{false}.
+    This option deliberately overrules \refKey{select}, the value of the option \refKey{prefix} is disregarded.
+  \end{docKey}
+  \begin{docKey}{select}{={counter1, counter2,\dots}}{initially empty}\CHDocNew{1.2}
+    Select only some of the associated counters to be able to be labeled. 
+    As of version \packageversion{} there is no check whether the given names refer to counters at all or are associated counters to the last counter that has been used with \cs{refstepcounter}. 
+  \end{docKey}
+  \begin{docKey}{prefix}{=\meta{text}}{initially empty}\CHDocNew{1.2}
+    This gives the prefix of the label of the associated counter. If the option \refKey{all} is enabled, the label name is generated from the name of the associated counter, the value of \refKey{prefix-sep} and the value of the 2nd argument. 
+    \newcounter{morefoobar}
+    \begin{dispExample*}{listing only}
+      % Assume that some counter has the associated counters foobar, morefoobar and yetanotherfoobar
+      \label{foo}[prefix=assoc,all]
+      \end{dispExample*}
+      will cause a label named \texttt{foobar::foo}, \texttt{morefoobar::foo} and \texttt{yetanotherfoobar::foo}, whereas
+      \begin{dispExample*}{listing only}
+        \label{foo}[prefix=assoc,select=morefoobar]
+      \end{dispExample*}
+      would generate the label \texttt{assocc::foobar} only and will be tied to the value of the counter \texttt{morefoobar}
+  \end{docKey}
+  \begin{docKey}{prefix-sep}{=\meta{text}}{initially ::}\CHDocNew{1.2}
+    Defines the separator between the \refKey{prefix} and the label name for the driver counter, i.e. the  2nd argument of the \refCom{label} command. 
+  \end{docKey}
+\end{docCommand}
+
+
+\begin{marker}
+\marginnote{\bcbombe}
+If the package option \refKey{redefinelabel} is set to \meta{false}, the usage of the third optional argument will leave spurious content at the position \cs{label} was used. The reason is that the content of third optional argument with \texttt{[]} is not recognized as an argument any longer. 
+\end{marker}
+
+
+
+\section[Counter backup/restoration]{Backup and restore of counter values}\CHDocNew{1.0}\label{section::new_backuprestore}
+
 It might be necessary to interrupt the current sectioning, e.g. including another document's structure (an external paper, for example) such that the counting should start again and after finishing of the external structure the old values should be restored. 
 
 
@@ -1698,7 +1778,7 @@
 
 \subsection{Some notes on the backup features} \label{subsec::backup_and_hyperref}
 
-Principally backing up counter values and restoring them later on is not really difficult -- with one exception: If the \CHDocPackage{hyperref} package is used, the counter values form up the hypertarget anchors, for example \texttt{chapter.1} for the first chapter. If the chapter counter is reset, there would be a chapter with number one again and as well an anchor name \texttt{chapter.1} -- \packagename{hyperref} will complain 'only' about this but it will put the wrong hyperlink as well, for example for the table of contents and the bookmarks -- this is an undesirable feature.
+Principally backing up counter values and restoring them later on is not really difficult -- with one exception: If the \CHDocPackage{hyperref} package is used, the counter values form up the hypertarget anchors, for example \texttt{chapter.1} for the first chapter. If the chapter counter is reset, there would be a chapter with number one again and as well an anchor name \texttt{chapter.1} -- \CHDocPackage{hyperref} will complain 'only' about this but it will put the wrong hyperlink as well, for example for the table of contents and the bookmarks -- this is an undesirable feature.
 
 However, there is a solution to this problem: The hypertarget anchors are built up from the specifications of a macro \cs{theH...} where the ellipses stands for the counter name. If for example \cs{theHchapter} is changed after a counter was reset the hypertargets will again be correct, since this will provide a different target name. \refCom{BackupCounterGroup} does this resetting automatically in an unique way and \refCom{RestoreBackupCounterGroup} restores as well the old \cs{theH...} macros of all counters that are in the backup list. It tracks the number of calls to \refCom{BackupCounterGroup} and changes the relevant \cs{theH...} macro definitions to use unique anchor names then -- this way multiple \refCom{BackupCounterGroup} calls are possible without destroying the hyperlink facilities with \CHDocPackage{hyperref}. 
 
@@ -2057,7 +2137,7 @@
 
 
 
-\section{Total counters}\tcbdocmarginnote{\tcbdocnew{2015-11-27}}
+\section{Total counters}\tcbdocmarginnote{\tcbdocnew{2015-11-27}}\label{sec::totalcounters}
 
 
 
@@ -2152,7 +2232,7 @@
 
 \subsection{Defining super total counters}
 
-\begin{docCommand}{NewTotalDocumentCounter}{\oarg{options}\marg{total counter name}}
+\begin{docCommand}{NewTotalDocumentCounter}{\oarg{options}\marg{total counter name1, total counter name2,\dots}}
 This macro defines a new counter (which mustn't exist before of course) and puts it under control of the total counter features. 
 \begin{codeoptionsenum}
   \item \oarg{options}: As of version \packageversion, only this option is used
@@ -2159,12 +2239,15 @@
 
     \refKey{supertotal} -- this has the same meaning as in \refCom{RegisterTotalDocumentCounter} and defaults to \texttt{false}. 
 
-    \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}. 
+    \item \marg{total counter name1, total counter name2,\dots}: The names of the total counter, separated by a comma. 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}
 
+
 If an already existing counter should be tracked with total counter features, 
 use \refCom{RegisterTotalDocumentCounter} instead. 
 
+\CHDocUpdate{1.2}This command allows multiple counters (specified as a comma separated list) to be defined at once.
+
 \end{docCommand}
 
 
@@ -2269,6 +2352,14 @@
 
 \begin{itemize}[itemsep=15pt]
 
+\item   \CHDocFullVersion{1.2}
+\begin{itemize}
+  \item Corrected some typos in the manual. 
+  \item The macros \refCom{NewDocumentCounter}, \refCom{DeclareDocumentCounter} and \refCom{NewTotalDocumentCounter} allow multiple counters to be specified and defined. 
+  \item Added the macro \refCom{DeclareTotalAssociatedCounters} in order to combine total counters and the associated feature, i.e. the counters are total ones and associated to a driver counter. 
+  \item \CHDocExperimentalFeature An extended version of \refCom{label} is provided to allow labels also for associated counters during the stepping process of the driver counter. 
+\end{itemize}
+
 \item   \CHDocFullVersion{1.1}
 \begin{itemize}
   \item Added some missing basic functions needed after the more restrictive \CHDocPackage{expl3} update from 2016/10/19

Deleted: trunk/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_driver.pdf
===================================================================
(Binary files differ)

Deleted: trunk/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_driver.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_driver.tex	2017-03-04 23:13:06 UTC (rev 43395)
+++ trunk/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_driver.tex	2017-03-04 23:13:23 UTC (rev 43396)
@@ -1,204 +0,0 @@
-%% LaTeX package xassoccnt - version 1.1 (2016/10/29 -- 13:34:52)
-%% Driver file for xassoccnt.sty
-%%
-%%
-%% -------------------------------------------------------------------------------------------
-%% Copyright (c) 2015 -- 2016 by Dr. Christian Hupfer <typography dot with dot latex at gmail dot com>
-%% -------------------------------------------------------------------------------------------
-%%
-%% 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 2005/12/01 or later.
-%%
-%%
-%% This work has the LPPL maintenance status `author-maintained`
-%%
-%%
-
-\documentclass{book}
-
-\usepackage{xcolor}
-\usepackage{totcount}
-\usepackage{calc}
-\usepackage[autodefinecounters=false]{xassoccnt}
-
-
-\usepackage{hyperref}
-\usepackage{cleveref}
-
-
-\newcounter{totalpages}
-\newtotcounter{totalsections}
-\newcounter{othersections}
-\newtotcounter{totaltables}
-
-\NewTotalDocumentCounter{equations}
-
-\DeclareAssociatedCounters[autodefine=none]{section}{totalsections,othersections,equations}
-\AddAssociatedCounters{section}{totalsections}
-
-
-\DeclareAssociatedCounters{page}{totalpages}
-\DeclareAssociatedCounters{table}{totaltables}
-
-
-\begin{document}
-\chapter{First}
-
-In \cref{section::dummylabel} we will see that
-
-\section{First}
-
-\begin{table}
-\caption{table}
-\end{table}
-
-
-\begin{table}
-\caption{table}
-\end{table}
-
-
-\begin{table}
-\caption{table}
-\end{table}
-
-
-
-\section{Other}
-\section{Third}
-
-\begin{table}
-\caption{Other table}
-\end{table}
-
-\begin{equation}
-  E=mc^2
-\end{equation}
-
-\begin{equation}
-  E=mc^2
-\end{equation}
-
-
-\TotalValue{equations}
-
-\chapter{Second chapter}
-
-\section{First section of 2nd chapter} \label{section::dummylabel}
-
-\thesection\ \total{totalsections}\ \theothersections\ \fbox{\color{blue}{\thetotaltables}}
-
-
-\IsSuspendedCounter{totalsections}{Yes, it's suspended}{Nope, it's not suspended}
-
-\IsAssociatedCounter{totalsections}{Yes, it's associated}{Nope, it's not associated}
-
-\IsSuspendedCounter{equation}{Yes, it's suspended}{Nope, it's not suspended}
-
-\IsAssociatedCounter{equation}{Yes, it's associated}{Nope, it's not associated}
-
-
-\TotalValue{equations}
-
-
-
-\TotalValue{equations}
-
-
-\SetDocumentCounter{section}{28}
-
-\SetDocumentCounter{totalsections}{100}
-
-\NewDocumentCounter[initial=151]{counterother}[section]
-
-
-
-Value of counterother: \thecounterother
-
-\section{Another one}
-
-Value of counterother: \thecounterother
-
-
-
-
-
-\thesection\ \thetotalsections\ \theothersections\ \fbox{\color{blue}{\thetotaltables}}\ 
-
-\SyncCounters[onlycounters={totalsections}]{section}
-
-
-\IfIsDocumentCounterTF{section}{%
-  Yes, it's a counter
-}{%
-  No, it's no counter
-}
-
-
-\IsSuperTotalCounterT{numberofruns}{%
-  Yes, numberofruns is a super total counter
-}
-
-\IsSuperTotalCounterF{chapter}{%
-  No, chapter is not a super total counter
-}
-
-
-\countersresetlistcount{chapter}
-\SetDocumentCounter{counterother}{\getresetlistcount}
-
-\begin{itemize}
-  \item There are \getresetlistcount\  counters in the reset list of chapter
-  \item \IfInResetListTF{chapter}{figure}{Yes, figure is in the reset list of chapter}{No, figure is not in the reset list of chapter}
-  \item \IfInResetListTF{chapter}{page}{Yes, page is in the reset list of chapter}{No, page is not in the reset list of chapter}
-  \item Values: \thesection\ \total{totalsections}\ \theothersections\ \fbox{\color{blue}{\total{totaltables}}}\ \thecounterother. 
-\end{itemize}
-
-Total value of equations: \TotalValue{equations}
-
-Internal name: \TotalCounterInternalName{equations}
-
-\begin{table}
-\caption{table}
-\end{table}
-
-
-%\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}
-
-
-
-\chapter{A new chapter}
-
-\begin{equation}
-  E=mc^2
-\end{equation}
-
-\chapter{Another new chapter}
-
-\begin{equation}
-  E=mc^2
-\end{equation}
-
-
-
-
-\end{document}
\ No newline at end of file

Added: trunk/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_driver_example.pdf
===================================================================
(Binary files differ)

Index: trunk/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_driver_example.pdf
===================================================================
--- trunk/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_driver_example.pdf	2017-03-04 23:13:06 UTC (rev 43395)
+++ trunk/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_driver_example.pdf	2017-03-04 23:13:23 UTC (rev 43396)

Property changes on: trunk/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_driver_example.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_driver_example.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_driver_example.tex	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_driver_example.tex	2017-03-04 23:13:23 UTC (rev 43396)
@@ -0,0 +1,204 @@
+%% LaTeX package xassoccnt - version 1.2 (2017/03/04 -- 00:46:43)
+%% Driver file for xassoccnt.sty
+%%
+%%
+%% -------------------------------------------------------------------------------------------
+%% Copyright (c) 2015 -- 2017 by Dr. Christian Hupfer <typography dot with dot latex at gmail dot com>
+%% -------------------------------------------------------------------------------------------
+%%
+%% 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 2005/12/01 or later.
+%%
+%%
+%% This work has the LPPL maintenance status `author-maintained`
+%%
+%%
+
+\documentclass{book}
+
+\usepackage{xcolor}
+\usepackage{totcount}
+\usepackage{calc}
+\usepackage[autodefinecounters=false]{xassoccnt}
+
+
+\usepackage{hyperref}
+\usepackage{cleveref}
+
+
+\newcounter{totalpages}
+\newtotcounter{totalsections}
+\newcounter{othersections}
+\newtotcounter{totaltables}
+
+\NewTotalDocumentCounter{equations}
+
+\DeclareAssociatedCounters[autodefine=none]{section}{totalsections,othersections,equations}
+\AddAssociatedCounters{section}{totalsections}
+
+
+\DeclareAssociatedCounters{page}{totalpages}
+\DeclareAssociatedCounters{table}{totaltables}
+
+
+\begin{document}
+\chapter{First}
+
+In \cref{section::dummylabel} we will see that
+
+\section{First}
+
+\begin{table}
+\caption{table}
+\end{table}
+
+
+\begin{table}
+\caption{table}
+\end{table}
+
+
+\begin{table}
+\caption{table}
+\end{table}
+
+
+
+\section{Other}
+\section{Third}
+
+\begin{table}
+\caption{Other table}
+\end{table}
+
+\begin{equation}
+  E=mc^2
+\end{equation}
+
+\begin{equation}
+  E=mc^2
+\end{equation}
+
+
+\TotalValue{equations}
+
+\chapter{Second chapter}
+
+\section{First section of 2nd chapter} \label{section::dummylabel}
+
+\thesection\ \total{totalsections}\ \theothersections\ \fbox{\color{blue}{\thetotaltables}}
+
+
+\IsSuspendedCounter{totalsections}{Yes, it's suspended}{Nope, it's not suspended}
+
+\IsAssociatedCounter{totalsections}{Yes, it's associated}{Nope, it's not associated}
+
+\IsSuspendedCounter{equation}{Yes, it's suspended}{Nope, it's not suspended}
+
+\IsAssociatedCounter{equation}{Yes, it's associated}{Nope, it's not associated}
+
+
+\TotalValue{equations}
+
+
+
+\TotalValue{equations}
+
+
+\SetDocumentCounter{section}{28}
+
+\SetDocumentCounter{totalsections}{100}
+
+\NewDocumentCounter[initial=151]{counterother}[section]
+
+
+
+Value of counterother: \thecounterother
+
+\section{Another one}
+
+Value of counterother: \thecounterother
+
+
+
+
+
+\thesection\ \thetotalsections\ \theothersections\ \fbox{\color{blue}{\thetotaltables}}\ 
+
+\SyncCounters[onlycounters={totalsections}]{section}
+
+
+\IfIsDocumentCounterTF{section}{%
+  Yes, it's a counter
+}{%
+  No, it's no counter
+}
+
+
+\IsSuperTotalCounterT{numberofruns}{%
+  Yes, numberofruns is a super total counter
+}
+
+\IsSuperTotalCounterF{chapter}{%
+  No, chapter is not a super total counter
+}
+
+
+\countersresetlistcount{chapter}
+\SetDocumentCounter{counterother}{\getresetlistcount}
+
+\begin{itemize}
+  \item There are \getresetlistcount\  counters in the reset list of chapter
+  \item \IfInResetListTF{chapter}{figure}{Yes, figure is in the reset list of chapter}{No, figure is not in the reset list of chapter}
+  \item \IfInResetListTF{chapter}{page}{Yes, page is in the reset list of chapter}{No, page is not in the reset list of chapter}
+  \item Values: \thesection\ \total{totalsections}\ \theothersections\ \fbox{\color{blue}{\total{totaltables}}}\ \thecounterother. 
+\end{itemize}
+
+Total value of equations: \TotalValue{equations}
+
+Internal name: \TotalCounterInternalName{equations}
+
+\begin{table}
+\caption{table}
+\end{table}
+
+
+%\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}
+
+
+
+\chapter{A new chapter}
+
+\begin{equation}
+  E=mc^2
+\end{equation}
+
+\chapter{Another new chapter}
+
+\begin{equation}
+  E=mc^2
+\end{equation}
+
+
+
+
+\end{document}
\ No newline at end of file

Modified: trunk/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_example.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_example.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_example.tex	2017-03-04 23:13:06 UTC (rev 43395)
+++ trunk/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_example.tex	2017-03-04 23:13:23 UTC (rev 43396)
@@ -1,9 +1,9 @@
-%% LaTeX package xassoccnt - version 1.1 (2016/10/29 -- 13:34:52)
+%% LaTeX package xassoccnt - version 1.2 (2017/03/04 -- 00:46:43)
 %% Example file for xassoccnt.sty
 %%
 %%
 %% -------------------------------------------------------------------------------------------
-%% Copyright (c) 2015 -- 2016 by Dr. Christian Hupfer <typography dot with dot latex at gmail dot com>
+%% Copyright (c) 2015 -- 2017 by Dr. Christian Hupfer <typography dot with dot latex at gmail dot com>
 %% -------------------------------------------------------------------------------------------
 %%
 %% This work may be distributed and/or modified under the

Added: trunk/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_label_example.pdf
===================================================================
(Binary files differ)

Index: trunk/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_label_example.pdf
===================================================================
--- trunk/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_label_example.pdf	2017-03-04 23:13:06 UTC (rev 43395)
+++ trunk/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_label_example.pdf	2017-03-04 23:13:23 UTC (rev 43396)

Property changes on: trunk/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_label_example.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_label_example.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_label_example.tex	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_label_example.tex	2017-03-04 23:13:23 UTC (rev 43396)
@@ -0,0 +1,90 @@
+%% LaTeX package xassoccnt - version 1.2 (2017/03/04 -- 00:46:43)
+%% Example file the the usage of labels with associated counters file for xassoccnt.sty
+%%
+%%
+%% -------------------------------------------------------------------------------------------
+%% Copyright (c) 2017 by Dr. Christian Hupfer <typography dot with dot latex at gmail dot com>
+%% -------------------------------------------------------------------------------------------
+%%
+%% 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 2005/12/01 or later.
+%%
+%%
+%% This work has the LPPL maintenance status `author-maintained`
+%%
+%%
+
+\documentclass[10pt,a4paper,twoside]{article}
+\usepackage{chngcntr}
+\usepackage{xassoccnt}
+\usepackage{hyperref}
+\NewDocumentCounter{ap, apother}
+\DeclareAssociatedCounters{subsection}{ap, apother}
+
+\counterwithout{ap}{section}
+
+\usepackage{cleveref}
+
+\crefname{ap}{package}{packages}
+\Crefname{ap}{Package}{Packages}
+\creflabelformat{ap}{AP~#2#1#3}
+\crefformat{ap}{AP~#2#1#3}
+
+\begin{document}
+
+See \cref{foosection}
+
+  \section{ some section  } \label{foosection}
+  \section{ special section on packages  }
+  \setcounter{ap}{0}
+
+      Here we describe \cref{ap::ap-one,ap::ap-two,ap::ap-three}  ....
+      this will be presented in \cref{ap::ap-one,ap::ap-two} and 
+      finally in \cref{ap::ap-three} we describe ....
+
+    Preferably this should look like this:
+
+      Here we describe package AP 1 to AP 3  .... 
+      this will be presented in packages AP 1 and AP 2 and 
+      finally in package AP 3 we describe ....
+
+    but currently it looks like this:
+
+      Here we describe package AP 2.1 to AP 2.3  .... 
+      this will be presented in packages AP 2.1 and AP 2.2 and 
+      finally in package AP 2.3 we describe ....
+
+   \subsection{AP~\arabic{ap}: first } \label{ap-one}
+     bla bla bla
+     Here we describe  ... 
+     which will be used in \cref{ap::ap-two,ap::ap-three}  ....
+
+
+   \subsection{AP~\arabic{ap}: second }
+   \label{ap-two}
+     bla bla bla
+     we described in \cref{ap::ap-one}  .... 
+     follow in \cref{ap::ap-three}
+
+     ap counter is \arabic{ap} or \theap.
+
+     subsection counter is \arabic{subsection} 
+     and ``thesection'' is \thesubsection.
+
+
+   \subsection{AP~\arabic{ap}: three }
+   \label{ap-three}
+     bla bla bla
+     we described in \cref{ap::ap-three,ap::ap-two} but look at \ref{ap-three}  
+
+
+  \section*{Appendix}
+     The table of contents is fine as is 
+  \tableofcontents
+
+\end{document}

Modified: trunk/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_periodiccounters_example.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_periodiccounters_example.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_periodiccounters_example.tex	2017-03-04 23:13:06 UTC (rev 43395)
+++ trunk/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_periodiccounters_example.tex	2017-03-04 23:13:23 UTC (rev 43396)
@@ -1,9 +1,9 @@
-%% LaTeX package xassoccnt - version 1.1 (2016/10/29 -- 13:34:52)
+%% LaTeX package xassoccnt - version 1.2 (2017/03/04 -- 00:46:43)
 %% Example file for periodic counters file for xassoccnt.sty
 %%
 %%
 %% -------------------------------------------------------------------------------------------
-%% Copyright (c) 2016 by Dr. Christian Hupfer <typography dot with dot latex at gmail dot com>
+%% Copyright (c) 2016 -- 2017 by Dr. Christian Hupfer <typography dot with dot latex at gmail dot com>
 %% -------------------------------------------------------------------------------------------
 %%
 %% This work may be distributed and/or modified under the

Modified: trunk/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_resetlist_example.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_resetlist_example.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_resetlist_example.tex	2017-03-04 23:13:06 UTC (rev 43395)
+++ trunk/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_resetlist_example.tex	2017-03-04 23:13:23 UTC (rev 43396)
@@ -1,9 +1,9 @@
-%% LaTeX package xassoccnt - version 1.1 (2016/10/29 -- 13:34:52)
+%% LaTeX package xassoccnt - version 1.2 (2017/03/04 -- 00:46:43)
 %% Example file for reset list features file for xassoccnt.sty
 %%
 %%
 %% -------------------------------------------------------------------------------------------
-%% Copyright (c) 2016 by Dr. Christian Hupfer <typography dot with dot latex at gmail dot com>
+%% Copyright (c) 2016 -- 2017 by Dr. Christian Hupfer <typography dot with dot latex at gmail dot com>
 %% -------------------------------------------------------------------------------------------
 %%
 %% This work may be distributed and/or modified under the

Modified: trunk/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_suspendedcounters_example.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_suspendedcounters_example.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_suspendedcounters_example.tex	2017-03-04 23:13:06 UTC (rev 43395)
+++ trunk/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_suspendedcounters_example.tex	2017-03-04 23:13:23 UTC (rev 43396)
@@ -1,9 +1,9 @@
-%% LaTeX package xassoccnt - version 1.1 (2016/10/29 -- 13:34:52)
+%% LaTeX package xassoccnt - version 1.2 (2017/03/04 -- 00:46:43)
 %% Example file for suspended counters file for xassoccnt.sty
 %%
 %%
 %% -------------------------------------------------------------------------------------------
-%% Copyright (c) 2016 by Dr. Christian Hupfer <typography dot with dot latex at gmail dot com>
+%% Copyright (c) 2016 -- 2017 by Dr. Christian Hupfer <typography dot with dot latex at gmail dot com>
 %% -------------------------------------------------------------------------------------------
 %%
 %% This work may be distributed and/or modified under the

Modified: trunk/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_totalcounters_example.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_totalcounters_example.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_totalcounters_example.tex	2017-03-04 23:13:06 UTC (rev 43395)
+++ trunk/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_totalcounters_example.tex	2017-03-04 23:13:23 UTC (rev 43396)
@@ -1,9 +1,9 @@
-%% LaTeX package xassoccnt - version 1.1 (2016/10/29 -- 13:34:52)
+%% LaTeX package xassoccnt - version 1.2 (2017/03/04 -- 00:46:43)
 %% Example file for total counters file for xassoccnt.sty
 %%
 %%
 %% -------------------------------------------------------------------------------------------
-%% Copyright (c) 2015 -- 2016 by Dr. Christian Hupfer <typography dot with dot latex at gmail dot com>
+%% Copyright (c) 2015 -- 2017 by Dr. Christian Hupfer <typography dot with dot latex at gmail dot com>
 %% -------------------------------------------------------------------------------------------
 %%
 %% This work may be distributed and/or modified under the

Modified: trunk/Master/texmf-dist/tex/latex/xassoccnt/xassoccnt.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/xassoccnt/xassoccnt.sty	2017-03-04 23:13:06 UTC (rev 43395)
+++ trunk/Master/texmf-dist/tex/latex/xassoccnt/xassoccnt.sty	2017-03-04 23:13:23 UTC (rev 43396)
@@ -1,9 +1,9 @@
-%% LaTeX package xassoccnt - version 1.1 (2016/10/29 -- 13:34:52)
+%% LaTeX package xassoccnt - version 1.2 (2017/03/04 -- 00:46:43)
 %% Source file for xassoccnt.sty
 %%
 %%
 %% -------------------------------------------------------------------------------------------
-%% Copyright (c) 2015 -- 2016 by Dr. Christian Hupfer <typography dot with dot latex at gmail dot com>
+%% Copyright (c) 2015 -- 2017 by Dr. Christian Hupfer <typography dot with dot latex at gmail dot com>
 %% -------------------------------------------------------------------------------------------
 %%
 %% This work may be distributed and/or modified under the
@@ -19,10 +19,12 @@
 %%
 %%
 
-\def\xassoccntpackageversion{1.1}
+\def\xassoccntpackageversion{1.2}
 \NeedsTeXFormat{LaTeX2e}[1995/12/01]
 
-\ProvidesPackage{xassoccnt}[2016/10/29 - v\xassoccntpackageversion]
+\ProvidesPackage{xassoccnt}[2017/03/04 - v\xassoccntpackageversion]
+\RequirePackage{etoolbox}
+\RequirePackage{letltxmacro}
 \RequirePackage{xcolor}
 \RequirePackage{xparse}
 \RequirePackage{l3keys2e}
@@ -35,6 +37,8 @@
 
 % Some variants of standard expl3 contributions
 
+\cs_generate_variant:Nn \seq_set_from_clist:Nn { Nx, cx }
+
 \cs_generate_variant:Nn \seq_remove_all:Nn { cV, NV }
 \cs_generate_variant:Nn \seq_gremove_all:Nn { cV, NV }
 \cs_generate_variant:Nn \seq_gput_right:cn {cx}
@@ -47,6 +51,7 @@
 % First some local or global values
 
 \bool_new:N \l__xassoccnt_hyperrefpackage_loaded_bool
+\bool_new:N \l__xassoccnt_cleverefpackage_loaded_bool
 
 \ifexplversionnew
 \str_const:Nn \c__xassoccnt_modulename_str {xassoccnt}
@@ -122,9 +127,11 @@
 
 \prop_new:N \g_xassoccnt_module_data_prop 
 
-\prop_put:Nnn \g_xassoccnt_module_data_prop {scratchname} {scratch}
-\prop_put:Nnn \g_xassoccnt_module_data_prop {backupfeaturename} {backupcounters}
+\prop_gput:Nnn \g_xassoccnt_module_data_prop {scratchname} {scratch}
+\prop_gput:Nnn \g_xassoccnt_module_data_prop {backupfeaturename} {backupcounters}
 
+\prop_gput:Nnn \g_xassoccnt_module_data_prop {prefix-sep} {::}
+
 \cs_new:Nn \xassoccnt_extract_moduledata:n {%
   \prop_item:Nn \g_xassoccnt_module_data_prop {#1}
 }
@@ -194,6 +201,7 @@
   supertotal  .bool_set:N={\l__xassoccnt_is_supertotalcounter_bool },
 
   resetbackup .bool_set:N={\l__xassoccnt_resetbackupcounters_bool },
+  redefinelabel .bool_set:N= { \g__xassoccnt_redefinelabel_bool }
 
 }
 
@@ -213,7 +221,7 @@
 }
 
 
-\keys_set:nn{xassoccnt}{nonumberofruns}
+\keys_set:nn{xassoccnt}{nonumberofruns, redefinelabel=true}
 
 \ProcessKeysOptions{xassoccnt}
 
@@ -449,10 +457,14 @@
 
 % Needed for Backup/Restore features 
 
-\AtBeginDocument{%
+%\AtBeginDocument{%
+\AtEndPreamble{
   \@ifpackageloaded{hyperref}{%
-    \bool_set_true:N \l__xassoccnt_hyperrefpackage_loaded_bool%
+    \bool_gset_true:N \l__xassoccnt_hyperrefpackage_loaded_bool%
   }{}%
+  \@ifpackageloaded{cleveref}{%
+    \bool_gset_true:N \l__xassoccnt_cleverefpackage_loaded_bool%
+  }{}
 }
 
 
@@ -465,7 +477,7 @@
 }{}
 
 \AtEndOfPackage{
-  \PackageInfo{xassoccnt}{2016/10/29 - v\xassoccntpackageversion -- stepping counters simultaneously and other features}
+  \PackageInfo{xassoccnt}{2017/03/04 - v\xassoccntpackageversion -- stepping counters simultaneously and other features}
   \@ifpackageloaded{calc}{%
     \msg_warning:nnn{xassoccnt}{incompatiblepackagenonfatal}{calc}% Warning
     \bool_set_true:N \l__xassoccnt_calcpackage_loaded
@@ -724,7 +736,8 @@
 
 
 
-\cs_new:Nn \xassoccnt_declareassociatedcounters:nnn {% 
+
+\cs_new:Nn \xassoccnt_declareassociatedcounters_old:nnn {% 
   \__xassoccnt_container_if_in:cnTF{\__xassoccnt_generate_countercontainername:n{\c_xassoccnt_mastername_str}:}{#2}{%
     % Not contained in the driver counter list
     \__xassoccnt_addassociatedcounters:nnn{#1}{#2}{#3}%
@@ -745,8 +758,27 @@
 
 
 
+\cs_new:Nn \xassoccnt_declareassociatedcounters:nnn {% 
+  \__xassoccnt_container_if_in:cnTF{\__xassoccnt_generate_countercontainername:n{\c_xassoccnt_mastername_str}:}{#2}{%
+    % Not contained in the driver counter list
+    \__xassoccnt_addassociatedcounters:nnn{#1}{#2}{#3}%
+  }{%
+    % Check first if there is a potential cross association
+    \__xassoccnt_adddrivercounter:nn{#1}{#2}%
+    \xassoccnt_is_associatedtocounter:nnTF{#3}{#2}{%
+      \msg_fatal:nnnn{xassoccnt}{crossassociation}{#2}{#3}% Fatal message
+      % Not necessary unless the fatal message above is removed 
+      \__xassoccnt_container_removecounter:cn{\__xassoccnt_generate_countercontainername:n{\c_xassoccnt_mastername_str}:}{#2}
+    }{% No, we don't try to cross-associate two counters
+      \__xassoccnt_addassociatedcounters:nnn{#1}{#2}{#3}%
+    }%
+  }%
+  \__xassoccnt_container_removeduplicates:n{\__xassoccnt_drivercontainer:n{#2}}
+  \__xassoccnt_autodefine_drivercounter:nn { }{#2}
+}
 
 
+
 \prg_new_conditional:Nnn \xassoccnt_is_drivercounter:n {T,F,TF}
 {
   \seq_if_in:cnTF{\__xassoccnt_mastercontainer:}{#1}{%
@@ -823,6 +855,13 @@
   \seq_map_inline:cn {\__xassoccnt_drivercontainer:n{#2}} { \__xassoccnt_container_removecounter:nn{\c_xassoccnt_associatedname_str}{##1} }% Remove from associated list container
   \__xassoccnt_container_gclear:c {\__xassoccnt_drivercontainer:n{#2} }
 }
+
+
+
+
+
+
+
 %%%%%%%%%%%%%%%%%%%%% User interface routines 
 
 
@@ -2299,7 +2338,7 @@
 
 \RenewDocumentCommand{\refstepcounter}{m}{%
   \seq_if_in:NxF \g_xassoccnt_suspendedcnt_seq {#1} {%
-    \cs_gset_nopar:Nn \__xassoccnt_lastrefsteppedcounter: {#1}
+    \cs_gset_nopar:Nx \__xassoccnt_lastrefsteppedcounter: {#1}
     \xassoccnt_standardrefstepcounter{#1}%
     \int_gset:Nn \g__xassoccnt_lastcountervalue_int {\number\value{#1}}%
   }
@@ -2339,13 +2378,27 @@
 
 
 \NewDocumentCommand{\NewDocumentCounter}{O{initial=\c_zero}mo}{%
-  \IfValueTF{#3}{%
-    \__xassoccnt_newcounter_ltx:nnn{#1}{#2}{#3}
-  }{%
-    \__xassoccnt_newcounter_ltx:nnn{#1}{#2}{}
+  \seq_set_from_clist:Nx \l_tmpa_seq {#2} 
+  \seq_map_inline:Nn \l_tmpa_seq {%
+    \IfValueTF{#3}{%
+      \__xassoccnt_newcounter_ltx:nnn{#1}{##1}{#3}
+    }{%
+      \__xassoccnt_newcounter_ltx:nnn{#1}{##1}{}
+    }
   }
 }
 
+%\NewDocumentCommand{\NewDocumentCounters}{O{initial=\c_zero}mo}{%
+%  \seq_map_inline:Nn \l_tmpa_seq {%
+%    \IfValueTF{#3}{%
+%      \NewDocumentCounter[#1]{##1}[#3]%
+%    }{%
+%      \NewDocumentCounter[#1]{##1}%
+%    }%	
+%  }%
+%}
+
+
 \NewDocumentCommand{\CopyDocumentCounters}{O{}mm}{% 
   \__xassoccnt_copycounters:nnn{#1}{#2}{#3}%
 }
@@ -2371,12 +2424,12 @@
 \prg_new_conditional:Nnn \__xassoccnt_ifinresetlist:nn {T,F,TF}
 {%
   \bool_set_false:N \l__xassoccnt_isinresetlist_bool
-  \cs_set:Nn \l__tmpa_cs: {#2}
+  \cs_set:Nx \l__tmpa_cs: {#2}
   \def\@elt##1{% Can't use \cs_new:Nn here :-(
     \cs_set:Nn \l__tmpb_cs: {##1}
     % Check if \l__tmpa_cs: and \l__tmpb_cs: are equal
     \cs_if_eq:NNT \l__tmpa_cs: \l__tmpb_cs: {
-    \bool_set_true:N \l__xassoccnt_isinresetlist_bool
+    \bool_gset_true:N \l__xassoccnt_isinresetlist_bool
     }
   }
   \use:c{ cl@#1 }
@@ -2447,12 +2500,18 @@
 
 \NewDocumentCommand{\NewTotalDocumentCounter}{O{}m}{%
   \keys_set:nn {xassoccnt} {supertotal=false,#1}
-  \__xassoccnt_ifis_latexcounter:nF {#2} {% Define the counter
-    \xassoccnt_declaredocumentcounter:nn{sloppy=false}{#2}%
-  }%
-  \__xassoccnt_registertotaldocumentcounter:nn{#1}{#2}
+  \seq_set_from_clist:Nn \l_tmpa_seq {#2}
+  \seq_map_inline:Nn \l_tmpa_seq {
+    \__xassoccnt_ifis_latexcounter:nF {##1} {% Define the counter
+      \xassoccnt_declaredocumentcounter:nn{sloppy=false}{##1}%
+    }%
+    \__xassoccnt_registertotaldocumentcounter:nn{#1}{##1}
+  }
 }
 
+
+
+
 \cs_new:Nn \__xassoccnt_store_totalcounter_value:n {%
   \prop_put:Nnn \g_xassoccnt_totalcounter_prop {#1} {\number\value{\__xassoccnt_expand_totalcountername:n{#1}}}
   \prop_put:Nnn \g_xassoccnt_totalcounter_prop {#1name} {\__xassoccnt_expand_totalcountername:n{#1}}
@@ -2557,6 +2616,13 @@
   { #2 }
 }
 
+\NewDocumentCommand{\DeclareTotalAssociatedCounters}{omm}{%
+  \NewTotalDocumentCounter{#3}%
+  \DeclareAssociatedCounters{#2}{#3}%
+}
+
+
+
 %%% Counter backup list features
 
 % Those macros all deal with the global reset list%
@@ -2828,11 +2894,17 @@
 %%%%%%%%%%%%%%%%%%%%
 
 \cs_new:Nn \xassoccnt_declaredocumentcounteropt:nnn{%
-  \__xassoccnt_newcounter_ltx:nnn{#1}{#2}{#3}%
+  \seq_set_from_clist:Nx \l_tmpa_seq {#2}
+  \seq_map_inline:Nn \l_tmpa_seq {
+    \__xassoccnt_newcounter_ltx:nnn{#1}{##1}{#3}%
+  }
 }
 
 \cs_new:Nn \xassoccnt_declaredocumentcounter:nn{%
-  \__xassoccnt_newcounter_ltx:nn{#1}{#2}{}%
+  \seq_set_from_clist:Nx \l_tmpa_seq {#2}
+  \seq_map_inline:Nn \l_tmpa_seq {
+    \__xassoccnt_newcounter_ltx:nn{#1}{##1}{}%
+  }
 }
 
 
@@ -2853,6 +2925,73 @@
   }%	
 }
 
+
+\cs_new:Nn \__xassoccnt_generate_associated_counters_labels:Nn {%
+  \seq_map_inline:Nn #1 {%
+    \prop_set_eq:NN \l_tmpb_prop \l_tmpa_prop
+    \prop_if_in:NnF \l_tmpb_prop {prefix } { \prop_put:Nnn \l_tmpb_prop  {prefix} {##1} }
+    \def\@tempa{##1}%
+    \def\cref at result{2}%
+    \protected at edef\cref at currentlabel{%
+      [\@tempa][\arabic{##1}][\cref at result]%
+      \csname p@##1\endcsname\csname the##1\endcsname}%
+    \__xassoccnt_internal_label:nn {##1} {\prop_item:Nn \l_tmpb_prop {prefix}\prop_item:Nn\l_tmpb_prop {prefix-sep}#2}
+  }% End of \seq_map_inline
+}
+
+
+%%%%
+
+%%% Label features --- Experimental --- from 2017/03/03
+
+\NewDocumentCommand{\RedefineLabelCommand}{}{%
+  \bool_if:NT \g__xassoccnt_redefinelabel_bool {
+  
+  \cs_new:Nn \__xassoccnt_internal_label:n {%
+    \latex@@label{##1}%
+  }
+
+  \cs_new:Nn \__xassoccnt_internal_label:nn {%
+    \bool_if:NTF \l__xassoccnt_cleverefpackage_loaded_bool {%
+      \latex@@label[##1]{##2}%
+    }{
+      \latex@@label{##2}%
+    }
+  }
+
+  \keys_define:nn {xassoccntlabel} {%
+    all .bool_set:N  = \l_xassoccnt_allassociatedcounters_labeled_bool,
+    select .code:n= { \seq_set_from_clist:Nx  \l_tmpa_seq { ##1 }\bool_set_false:N  \l_xassoccnt_allassociatedcounters_labeled_bool },
+    prefix .code:n={ \prop_put:Nnx \l_tmpa_prop {prefix} {##1} },
+    prefix-sep .code:n={ \prop_put:Nnx \l_tmpa_prop {prefix-sep} {##1} }
+  }
+  \RenewDocumentCommand{\label}{omO{}}{%
+    \group_begin:
+    \prop_clear:N \l_tmpa_prop
+    \seq_clear:N \l_tmpa_seq
+    \keys_set:nn {xassoccntlabel} {all=true,prefix-sep={\xassoccnt_extract_moduledata:n{prefix-sep}},##3}%
+    % 
+    \IfValueTF{##1}{%
+      % Generate the regular label 
+      \__xassoccnt_internal_label:nn {##1} {##2}
+    }{%
+      \__xassoccnt_internal_label:n {##2}
+    }
+    \bool_if:NT \l_xassoccnt_allassociatedcounters_labeled_bool  {%
+      % The prefix is made from the associated counter
+      \prop_remove:Nn \l_tmpa_prop {prefix}
+      \seq_set_eq:Nc \l_tmpa_seq {\__xassoccnt_drivercontainer:n{\LastRefSteppedCounter}}
+    }
+    \seq_if_empty:NF \l_tmpa_seq {% Check whether either the only - list or the driver container list is empty (i.e. it was no driver container at all
+      % If non-empty -> generate the labels with the given naming scheme 
+      \__xassoccnt_generate_associated_counters_labels:Nn \l_tmpa_seq {##2}
+    }% End of \seq_if_empty
+    \group_end:
+  }% End of \RenewDocumentCommand{\label}
+  }
+}
+
+
 \ExplSyntaxOff
 
 \EnableNumberofrunsTF{%
@@ -2875,9 +3014,17 @@
 \@onlypreamble{\NewTotalDocumentCounter}
 \@onlypreamble{\RegisterTotalDocumentCounter}
 \@onlypreamble{\DeclareAssociatedCounters}
+\@onlypreamble{\DeclareTotalAssociatedCounters}
 \@onlypreamble{\DeclareDocumentCounter}
 \@onlypreamble{\DeclareCoupledCounters}
 
+\AtEndPreamble{%
+  \AtBeginDocument{%
+    \LetLtxMacro\latex@@label\label
+    \RedefineLabelCommand%
+  }
+}
+
 \AtBeginDocument{%
   \DeclareBackupCountersGroupName{scratch}%
 }



More information about the tex-live-commits mailing list