diff options
author | Karl Berry <karl@freefriends.org> | 2017-03-04 23:13:23 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2017-03-04 23:13:23 +0000 |
commit | 7bd517903406aa8d487340f84350c10826ff5e54 (patch) | |
tree | 2a5c6a5c16afd9f96e3b1f6e3f4582255930fcfa | |
parent | e59da762242ab80e65849560ed7777e46ddd77da (diff) |
xassoccnt (4mar17)
git-svn-id: svn://tug.org/texlive/trunk@43396 c570f23f-e606-0410-a88d-b1316a301751
22 files changed, 389 insertions, 61 deletions
diff --git a/Master/texmf-dist/doc/latex/xassoccnt/README b/Master/texmf-dist/doc/latex/xassoccnt/README index 158bd2f9de4..f31c3bbc79c 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 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 @@ 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 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 diff --git a/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_backupcounters_example.pdf b/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_backupcounters_example.pdf Binary files differindex 0c60f6573dd..690761aa73f 100644 --- a/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_backupcounters_example.pdf +++ b/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_backupcounters_example.pdf diff --git a/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_backupcounters_example.tex b/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_backupcounters_example.tex index a2adce4330a..d693a185002 100644 --- a/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_backupcounters_example.tex +++ b/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_backupcounters_example.tex @@ -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 diff --git a/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_coupledcounters_example.pdf b/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_coupledcounters_example.pdf Binary files differindex b5e546ed582..1fb2e41f82e 100644 --- a/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_coupledcounters_example.pdf +++ b/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_coupledcounters_example.pdf diff --git a/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_coupledcounters_example.tex b/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_coupledcounters_example.tex index b6c3679e6f9..825e748f578 100644 --- a/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_coupledcounters_example.tex +++ b/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_coupledcounters_example.tex @@ -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 diff --git a/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_doc.pdf b/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_doc.pdf Binary files differindex 55b204204a2..e921a3a58fc 100644 --- a/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_doc.pdf +++ b/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_doc.pdf diff --git a/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_doc.tex b/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_doc.tex index 60a1a2d8d08..2ecf4cb802c 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 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,6 +97,10 @@ \@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,13 +328,14 @@ \usepackage{bookmark} \usepackage{cleveref} \usetikzlibrary{mindmap} +\usepackage{url} \setcounter{tocdepth}{3} \newcommand{\PackageDocName}{xassoccnt}% \newcommand{\mymailtoaddress}{% - typography.with.latex@gmail.com + typography.with.latex@gmail.com% } \doparttoc @@ -535,6 +553,12 @@ As of version \packageversion\ \CHDocPackage{\PackageDocName} supports the packa 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,17 +584,20 @@ As of \packageversion, there is only one option used: \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} 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,20 +899,20 @@ The package \CHDocPackage{chngcntr} offers the possibility of add or remove coun \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} \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 @@ The 2nd argument value is added (or subtracted) to the counters given in the lis \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 @@ This command will print the value of the counter using uppercase hexadecimal dig \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 @@ The usage of this macro is similar to \refCom{DeclareAssociatedCounters}; if it 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 @@ If the driver counter and all its associated counters should be removed, use \re \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,8 +1495,54 @@ This commands tests, whether a given counter name is a driver counter and expand \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} + +\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} -\section[Counter backup/restoration]{Backup and restore of counter values}\label{section::new_backuprestore}\CHDocNew{1.0} + +\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 @@ This macro tests if the backup-id exists for the given counter group and execute \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 @@ There are \number\totvalue{totalequations}~equations in here! -\section{Total counters}\tcbdocmarginnote{\tcbdocnew{2015-11-27}} +\section{Total counters}\tcbdocmarginnote{\tcbdocnew{2015-11-27}}\label{sec::totalcounters} @@ -2152,19 +2232,22 @@ In addition to the concept of a total counter, there is also the possibility of \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 \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 @@ write this documentation. \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 diff --git a/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_driver.pdf b/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_driver_example.pdf Binary files differindex 362c5dcc4a1..12b008b3ce7 100644 --- a/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_driver.pdf +++ b/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_driver_example.pdf diff --git a/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_driver.tex b/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_driver_example.tex index aed48fa537e..8cd63b0b31c 100644 --- a/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_driver.tex +++ b/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_driver_example.tex @@ -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) %% Driver 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 diff --git a/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_example.pdf b/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_example.pdf Binary files differindex 2b62ede7a5a..173d3bc2dbd 100644 --- a/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_example.pdf +++ b/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_example.pdf diff --git a/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_example.tex b/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_example.tex index b98d7b76894..88a1d1505b2 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 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 diff --git a/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_label_example.pdf b/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_label_example.pdf Binary files differnew file mode 100644 index 00000000000..a729e13d57f --- /dev/null +++ b/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_label_example.pdf diff --git a/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_label_example.tex b/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_label_example.tex new file mode 100644 index 00000000000..01d305561be --- /dev/null +++ b/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_label_example.tex @@ -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} diff --git a/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_periodiccounters_example.pdf b/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_periodiccounters_example.pdf Binary files differindex d7008f5b500..9f2c3354fa2 100644 --- a/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_periodiccounters_example.pdf +++ b/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_periodiccounters_example.pdf diff --git a/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_periodiccounters_example.tex b/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_periodiccounters_example.tex index e6fbff6feca..164ad4f1e7d 100644 --- a/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_periodiccounters_example.tex +++ b/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_periodiccounters_example.tex @@ -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 diff --git a/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_resetlist_example.pdf b/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_resetlist_example.pdf Binary files differindex a0b1d0d43a9..790e2515f55 100644 --- a/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_resetlist_example.pdf +++ b/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_resetlist_example.pdf diff --git a/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_resetlist_example.tex b/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_resetlist_example.tex index 4ec7cc9c88d..b480a43dd12 100644 --- a/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_resetlist_example.tex +++ b/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_resetlist_example.tex @@ -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 diff --git a/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_suspendedcounters_example.pdf b/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_suspendedcounters_example.pdf Binary files differindex 09427de8a2f..f52b8584ce6 100644 --- a/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_suspendedcounters_example.pdf +++ b/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_suspendedcounters_example.pdf diff --git a/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_suspendedcounters_example.tex b/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_suspendedcounters_example.tex index 381669576fc..c36c71f6969 100644 --- a/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_suspendedcounters_example.tex +++ b/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_suspendedcounters_example.tex @@ -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 diff --git a/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_totalcounters_example.pdf b/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_totalcounters_example.pdf Binary files differindex 70a2368b73c..6e8c7a432d0 100644 --- a/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_totalcounters_example.pdf +++ b/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_totalcounters_example.pdf diff --git a/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_totalcounters_example.tex b/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_totalcounters_example.tex index 297e59b6559..9bb7b552ce8 100644 --- a/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_totalcounters_example.tex +++ b/Master/texmf-dist/doc/latex/xassoccnt/xassoccnt_totalcounters_example.tex @@ -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 diff --git a/Master/texmf-dist/tex/latex/xassoccnt/xassoccnt.sty b/Master/texmf-dist/tex/latex/xassoccnt/xassoccnt.sty index 47f1da6ae8c..26f22e893f1 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 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,8 +127,10 @@ \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,6 +758,25 @@ +\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} @@ -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@result{2}% + \protected@edef\cref@currentlabel{% + [\@tempa][\arabic{##1}][\cref@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}% } |