summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/assoccnt/assoccnt.sty
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex/assoccnt/assoccnt.sty')
-rw-r--r--Master/texmf-dist/tex/latex/assoccnt/assoccnt.sty67
1 files changed, 58 insertions, 9 deletions
diff --git a/Master/texmf-dist/tex/latex/assoccnt/assoccnt.sty b/Master/texmf-dist/tex/latex/assoccnt/assoccnt.sty
index 1a08056afd3..3c736ac9288 100644
--- a/Master/texmf-dist/tex/latex/assoccnt/assoccnt.sty
+++ b/Master/texmf-dist/tex/latex/assoccnt/assoccnt.sty
@@ -1,19 +1,18 @@
\NeedsTeXFormat{LaTeX2e}%
-\ProvidesPackage{assoccnt}[2014/09/01 v0.4 -- Associate counters stepping]%
+\ProvidesPackage{assoccnt}[2014/09/22 v0.5a -- Associate counters stepping]%
%%%
-%% License: LaTeX Project Public License
+%% License: LaTeX Project Public License version 1.3
%% Copyright (2014) Dr. Christian Hupfer
%% Author: Christian Hupfer christian.hupfer@yahoo.de
%%
%%%%
-%%% Some options later on
-%%%%
\def\@@assoccnt@@keys{assoccntkeyfamily}%
\def\@@assoccnt@@packagename{assoccnt.sty}%
\def\@@assoccnt@@keyprefix{@@assoccnt@@pkg@@}%
+\RequirePackage{xcolor}%
\RequirePackage{etoolbox}[2011/01/03 2.2]%
\RequirePackage{xkeyval}[2012/10/14 v2.6b]%
\RequirePackage{xstring}%
@@ -43,6 +42,13 @@
\newcounter{@@assoccnt@@internalcounter}%
+
+\gdef\@@assoccnt@@storagemacro@@laststeppedcounter{}%
+\gdef\@@assoccnt@@storagemacro@@lastrefsteppedcounter{}%
+\gdef\@@assoccnt@@storagemacro@@lastaddtocounter{}%
+\gdef\@@assoccnt@@storagemacro@@lastsetcounter{}%
+
+
\let\@@assoccnt@@standardstepcounter\stepcounter%
\let\@@assoccnt@@standardrefstepcounter\refstepcounter%
\let\@@assoccnt@@standardsetcounter\setcounter%
@@ -59,7 +65,7 @@ AssociatedCountersList%
%%% Internal macro to generate the name of the list of associated counters
\newcommand{\@@assoccnt@@generatelistname}[1]{%
% #1 Name of the driver counter
-@@#1@@\@@assoccnt@@associatedcounterslistsuffix
+ @@#1@@\@@assoccnt@@associatedcounterslistsuffix
}%
\newcommand{\@@assoccnt@@drivercounterlist}{%
@@ -398,11 +404,19 @@ AssociatedCountersList%
%%% This is just for convenience, if the command as to be improved/extended later on in future
\newcommand{\@@assoccnt@@stepcounter}[1]{%
\@@assoccnt@@standardstepcounter{#1}%
+ \gdef\@@assoccnt@@storagemacro@@laststeppedcounter{#1}%
+% \gdef\@@assoccnt@@storagemacro@@laststeppedcounter{#1}%
}%
+\renewcommand{\stepcounter}[1]{%
+ \@@assoccnt@@stepcounter{#1}%
+}%
+
+
%%% The setcounter wrapper
\newcommand{\@@assocccnt@@setcounter}[2]{%
\@@assoccnt@@standardsetcounter{#1}{#2}%
+ \gdef\@@assoccnt@@storagemacro@@lastsetcounter{#1}%
}%
%%% addtocounter wrapper -- needs to switch the arguments for the command for the list usage!!!
@@ -411,11 +425,13 @@ AssociatedCountersList%
% Now, there are suspended counters -- do not update them!
\IsSuspendedCounter{#2}{%
% Nothing to be done
- }{%
- \@@assoccnt@@standardaddtocounter{#2}{#1}%
- }%
+ }{%
+ \@@assoccnt@@standardaddtocounter{#2}{#1}%
+ \gdef\@@assoccnt@@storagemacro@@lastaddtocounter{#2}%
+ }%
}{%
\@@assoccnt@@standardaddtocounter{#2}{#1}%
+ \gdef\@@assoccnt@@storagemacro@@lastaddtocounter{#2}%
}%
}%
@@ -431,10 +447,14 @@ AssociatedCountersList%
%%% Not needed so far
-\newcommand{\@@assoccnt@@refstepcounter}[1]{%
+\newcommand{\@@assoccnt@@refstepcounter}[1]{% %
\@@assoccnt@@standardrefstepcounter{#1}%
+ \gdef\@@assoccnt@@storagemacro@@lastrefsteppedcounter{#1}%
}%
+\renewcommand{\refstepcounter}[1]{%
+ \@@assoccnt@@refstepcounter{#1}%
+}%
\renewcommand{\addtocounter}[2]{%
@@ -443,9 +463,11 @@ AssociatedCountersList%
% No, do nothing at all%
}{%
\@@assoccnt@@standardaddtocounter{#1}{#2}%
+ \gdef\@@assoccnt@@storagemacro@@lastaddtocounter{#1}%
}
}{%
\@@assoccnt@@standardaddtocounter{#1}{#2}%
+ \gdef\@@assoccnt@@storagemacro@@lastaddtocounter{#1}%
}%
\ifcsdef{\@@assoccnt@@generatelistname{#1}}{% Check first, whether the list exists at all,
\forlistcsloop{\@@assoccnt@@addtocounter{#2}}{\@@assoccnt@@generatelistname{#1}}% March through the list
@@ -479,6 +501,8 @@ AssociatedCountersList%
\renewcommand{\setcounter}[3][]{%
\@@assoccnt@@standardsetcounter{#2}{#3}%
+ \gdef\@@assoccnt@@storagemacro@@lastsetcounter{#2}%
+ %\gdef\assoccnt@@storagemacro@@lastsetcounter{#2}%
\setkeys{\@@assoccnt@@keys}{AssociatedToo=false,#1}%
\ifKV@assoccntkeyfamily@AssociatedToo
\@@assoccnt@@setcounterwrapper{#2}{#3}{\@@assoccnt@@generatelistname{#2}}%
@@ -492,4 +516,29 @@ AssociatedCountersList%
\fi%
}%
+
+
+\newcommand{\LastSteppedCounter}{%
+ \ifdef{%
+ \@@assoccnt@@storagemacro@@laststeppedcounter%
+ }{%
+ \@@assoccnt@@storagemacro@@laststeppedcounter\typeout{Hello}%
+ }{%
+ Undefined/unknown%
+ }%
+}%
+
+\newcommand{\LastSetCounter}{%
+ \@@assoccnt@@storagemacro@@lastsetcounter%
+}%
+
+\newcommand{\LastRefSteppedCounter}{%
+ \@@assoccnt@@storagemacro@@lastrefsteppedcounter%
+}%
+
+\newcommand{\LastAddedToCounter}{%
+ \@@assoccnt@@storagemacro@@lastaddtocounter%
+}%
+
+
\endinput% \ No newline at end of file