summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2015-09-29 22:06:31 +0000
committerKarl Berry <karl@freefriends.org>2015-09-29 22:06:31 +0000
commit982ab23fae158d0e4ca19de74a6fa98928334007 (patch)
treebfd7185e4bea051c581bf2e7d65cba475f86abb8
parentf737ec574c2912930727d94df1184ccfb322d4ec (diff)
assoccnt (29sep15)
git-svn-id: svn://tug.org/texlive/trunk@38497 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r--Master/texmf-dist/doc/latex/assoccnt/README16
-rw-r--r--Master/texmf-dist/doc/latex/assoccnt/assoccnt_doc.pdfbin267586 -> 282166 bytes
-rw-r--r--Master/texmf-dist/doc/latex/assoccnt/assoccnt_doc.tex44
-rw-r--r--Master/texmf-dist/doc/latex/assoccnt/assoccnt_example.pdfbin78981 -> 77422 bytes
-rw-r--r--Master/texmf-dist/tex/latex/assoccnt/assoccnt.sty161
5 files changed, 141 insertions, 80 deletions
diff --git a/Master/texmf-dist/doc/latex/assoccnt/README b/Master/texmf-dist/doc/latex/assoccnt/README
index 8463904d384..97c3cfca7b8 100644
--- a/Master/texmf-dist/doc/latex/assoccnt/README
+++ b/Master/texmf-dist/doc/latex/assoccnt/README
@@ -1,4 +1,4 @@
-%% LaTeX package assoccnt - version 0.6 (2015/09/27)
+%% LaTeX package assoccnt - version 0.8 (2015/09/29)
%%
%% -------------------------------------------------------------------------------------------
%% Copyright (c) 2015 by Dr. Christian Hupfer <christian dot hupfer at yahoo dot de>
@@ -26,16 +26,16 @@ can be used without it too.
This version provides
--- A major bug fix in `assoccnt` since it stepped counters too that are on the reset list (\@addtoreset) and this caused troubles with the package calc.sty too.
-
+-- A third bug fix in `assoccnt` in conjunction with the calc package.
+-- Note: calc and assoccnt might work together but it can't guaranteed this will be the case and correct values are generated!
-- Some improved documentation
Note: This is perhaps the last version before a complete rewrite with `expl3` and LaTeX 3 - features will take place.
Directory listing:
- assoccnt_doc.pdf 267586 09/27/15 17:12:34
- assoccnt_doc.tex 33572 09/27/15 17:10:38
- assoccnt_example.pdf 78981 09/27/15 17:12:29
- assoccnt_example.tex 4589 09/27/15 17:10:38
- assoccnt.sty 16516 09/27/15 17:12:34
+ assoccnt_doc.pdf 282166 09/29/15 16:43:53
+ assoccnt_doc.tex 34395 09/29/15 16:43:12
+ assoccnt_example.pdf 77422 09/29/15 16:43:50
+ assoccnt_example.tex 4589 09/29/15 16:43:12
+ assoccnt.sty 16903 09/29/15 16:43:53
diff --git a/Master/texmf-dist/doc/latex/assoccnt/assoccnt_doc.pdf b/Master/texmf-dist/doc/latex/assoccnt/assoccnt_doc.pdf
index 59a2a2fa2aa..1ebc53c1571 100644
--- a/Master/texmf-dist/doc/latex/assoccnt/assoccnt_doc.pdf
+++ b/Master/texmf-dist/doc/latex/assoccnt/assoccnt_doc.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/assoccnt/assoccnt_doc.tex b/Master/texmf-dist/doc/latex/assoccnt/assoccnt_doc.tex
index f3f0611c7e9..41359cc6b59 100644
--- a/Master/texmf-dist/doc/latex/assoccnt/assoccnt_doc.tex
+++ b/Master/texmf-dist/doc/latex/assoccnt/assoccnt_doc.tex
@@ -1,4 +1,4 @@
-%% LaTeX package assoccnt - version 0.6 (2014/09/27)
+%% LaTeX package assoccnt - version 0.8 (2015/09/29)
%% Documentation for assoccnt.sty
%%
%%
@@ -21,7 +21,8 @@
%%
-\documentclass[12pt,paper=a4]{ltxdoc}
+\documentclass[12pt,paper=a4]{article}
+
\usepackage[lmargin=2cm,rmargin=2cm]{geometry}
\usepackage{savesym}%
@@ -32,12 +33,13 @@
\usepackage{xcolor}
\usepackage{imakeidx}%
\usepackage{tcolorbox}
+\usepackage[tikz]{bclogo}
+\usepackage{marginnote}
\usepackage{datetime}%
-\usepackage{scrpage2}%
+\usepackage{scrlayer-scrpage}%
-\usepackage{enumitem}%
\tcbuselibrary{listings}%
@@ -50,9 +52,14 @@
\usepackage{amsmath}%
\usepackage{amsthm}%
+%\usepackage{calc} % Only for testing
\usepackage{totcount}%
+\usepackage{enumitem}%
+
\usepackage[globalsuspend=true]{assoccnt}%
+
+
\usepackage{bookmark}%
@@ -75,11 +82,11 @@
\newtcolorbox{docCommandArgs}[1]{colbacktitle={blue},coltitle={white},title={Description of arguments of command \cs{#1}}}
-\def\packageversion{0.6}%
+\def\packageversion{\assoccntpackageversion}%
\makeindex
-\newcommand{\PackageDocName}{assoccnt.sty}%
+\newcommand{\PackageDocName}{assoccnt}%
\newtotcounter{totalpages}%
@@ -138,6 +145,10 @@ Author: Christian Hupfer\(^\mathrm{\fnsymbol{footnote}}\)% }{\makeatletter chris
\pagestyle{scrheadings}%
\setheadsepline{2pt}[\color{blue}]
+\setfootsepline{2pt}[\color{brown}]
+\ifoot{\PackageDocName}
+\cfoot{\packageversion}
+\ofoot{\today}
\setcounter{footnote}{0}
@@ -186,14 +197,18 @@ As of version \packageversion~ the package has only one option, regarding the su
\begin{itemize}
\item \packagename{etoolbox}
\item \packagename{xkeyval}
-\item \packagename{xcolor}%
+\item \packagename{xcolor}
+\item \packagename{xstring}
\end{itemize}
\subsection{Incompatibilities}
-This package does not work together when the Package \packagename{xifthen} is included. As of version \packageversion~I could not figure out, where the strange behaviour comes in. It's most likely an incompatibility between \packagename{etoolbox} and \packagename{xifthen}
-
+\begin{itemize}
+\item This package does not work really well with the \packagename{calc} package. Load \packagename{calc} \textbf{before} \packagename{\PackageDocName}! \marginnote{\bcbombe}
+\item This package does not work together when the Package \packagename{xifthen} is included. As of version \packageversion~I could not figure out, where the strange behaviour comes in. It's most likely an incompatibility between \packagename{etoolbox} and \packagename{xifthen}
+\marginnote{\bcbombe}
+\end{itemize}
\section{Documentation of Macros}
\tcbset{color command={blue}}
@@ -267,7 +282,7 @@ This command is the main macro of the package. It declares the counter names bei
\DeclareAssociatedCounters{page}{totalpages,anothertotalpages}%
This document has \number\totvalue{totalpages} (note: \number\totvalue{anothertotalpages}) pages.
\end{dispExample}
-\let\DeclareAssociatedCounters\DeclareAssociatedCountersOrig%
+%\let\DeclareAssociatedCounters\DeclareAssociatedCountersOrig%
\begin{itemize}
\item Current version state:
@@ -821,6 +836,7 @@ This macro generates a list from the driver counter name and the driver counter
\item Improve documentation
\item Allow for specific counter to be resumed from suspension instead of resuming all
\item Allow for an associated counter to have multiple masters
+\item Complete redesign and rewrite with \packagename{expl3} -- this will provide better list features
\end{itemize}
If you
@@ -847,6 +863,8 @@ to the users at tex.stackexchange.com, especially to
\item Joseph Wright
\item David Carlisle
\item Werner
+ \item Gonzalo Medina
+ \item Cosmo Huber (for providing the bug report with the \packagename{calc} package.)
\end{itemize}
for their invaluable help on many questions on macros.
@@ -860,6 +878,8 @@ write this documentation.
\section{Version history}
Note the pre - 0.6 - version history has to be reestablished
\begin{itemize}
+\item 0.8: A second bug fix for usage version 0.7 -- packagename{calc} and this package do not really work together.
+\item 0.7: A second bug fix for usage with \packagename{calc} has been done.
\item 0.6: \begin{itemize}
\item A major bug fixed due to some error in usage together with \packagename{calc} when the driven counters are not stepped any longer.
The culprit was in \PackageDocName that the counter reset list was not really disabled.
@@ -875,12 +895,10 @@ Note the pre - 0.6 - version history has to be reestablished
-
\section[Total number of sections]{Example: Total number of sections}
In this example, all sections of this document are counted, i.e. the current one as well as all following ones.
\begin{dispExample}
-\DeclareAssociatedCounters{section}{totalsections}%
-This document has \number\totvalue{totalsections} section(s)%
+This document has \total{totalsections} section(s)%
\end{dispExample}
diff --git a/Master/texmf-dist/doc/latex/assoccnt/assoccnt_example.pdf b/Master/texmf-dist/doc/latex/assoccnt/assoccnt_example.pdf
index 36d390d99f6..21d58a973db 100644
--- a/Master/texmf-dist/doc/latex/assoccnt/assoccnt_example.pdf
+++ b/Master/texmf-dist/doc/latex/assoccnt/assoccnt_example.pdf
Binary files differ
diff --git a/Master/texmf-dist/tex/latex/assoccnt/assoccnt.sty b/Master/texmf-dist/tex/latex/assoccnt/assoccnt.sty
index 4839a05ef06..c22f0eb4fc9 100644
--- a/Master/texmf-dist/tex/latex/assoccnt/assoccnt.sty
+++ b/Master/texmf-dist/tex/latex/assoccnt/assoccnt.sty
@@ -1,22 +1,37 @@
+
+\def\assoccntpackageversion{0.8}
\NeedsTeXFormat{LaTeX2e}%
-\ProvidesPackage{assoccnt}[2015/09/27 v0.6 -- Associate counters stepping]%
+\ProvidesPackage{assoccnt}[2015/09/29 v\assoccntpackageversion -- Associate counters stepping]%
%%%
%% License: LaTeX Project Public License version 1.3
-%% Copyright (2014) Dr. Christian Hupfer
+%% Copyright (2015) Dr. Christian Hupfer
%% Author: Christian Hupfer christian.hupfer@yahoo.de
%%
%%%%
+
\def\@@assoccnt@@keys{assoccntkeyfamily}%
\def\@@assoccnt@@packagename{assoccnt.sty}%
\def\@@assoccnt@@keyprefix{@@assoccnt@@pkg@@}%
+\typeout{\@@assoccnt@@packagename{} -- version v\assoccntpackageversion}
+
+
\RequirePackage{xcolor}%
\RequirePackage{etoolbox}[2011/01/03 2.2]%
\RequirePackage{xkeyval}[2012/10/14 v2.6b]%
\RequirePackage{xstring}%
+\newif\if@calcpackage
+
+\@ifpackageloaded{calc}{%
+\@calcpackagetrue%
+}{%
+\@calcpackagefalse%
+}
+
+
%%%% Defining package options
\newtoggle{GlobalSuspend}%
@@ -40,6 +55,7 @@
%%%%%
+
\newcounter{@@assoccnt@@internalcounter}%
@@ -49,15 +65,16 @@
\gdef\@@assoccnt@@storagemacro@@lastsetcounter{}%
+\let\@@assoccnt@@standardaddtocounter\addtocounter%
\let\@@assoccnt@@standardstepcounter\stepcounter%
\let\@@assoccnt@@standardrefstepcounter\refstepcounter%
\let\@@assoccnt@@standardsetcounter\setcounter%
-\let\@@assoccnt@@standardaddtocounter\addtocounter%
+
% Unused so far
\newcommand{\IsInResetList}[4]{%
- \IfSubStr{\csname cl@#1\endcsname}{{#2}}{%
+ \IfSubStr{\csname cl@#1\endcsname}{{#2}}{% Mind the {} around the #2 parameter!
#3%
}{%
#4%
@@ -410,47 +427,68 @@ AssociatedCountersList%
}%
}%
-%%% The stepcounter wrapper for the standard stepcounter command
-%%% This is just for convenience, if the command as to be improved/extended later on in future
-\newcommand{\@@assoccnt@@stepcounter}[1]{%
- \@ifundefined{cl@#1}{% There is no reset list for this driver counter
- \@@assoccnt@@standardstepcounter{#1}%
- }{%
- \csletcs{cl@#1}{relax}% Yes, there is reset list, but we drop it in this group, preventing that the counters from `\@addtoreset` are stepped anyway.
- \@@assoccnt@@standardstepcounter{#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}%
-}%
+%\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!!!
+\newcommand{\@@assocccnt@@addtocounter}[2]{%
+ \ifcsdef{@@assoccnt@@suspendedcounterslist}{%
+ % Now, there are suspended counters -- do not update them!
+ \IsSuspendedCounter{#2}{%
+ % Nothing to be done
+ }{%
+ \@@assoccnt@@standardaddtocounter{#2}{#1}%
+ \gdef\@@assoccnt@@storagemacro@@lastaddtocounter{#2}%
+ }%
+ }{%
+ \@@assoccnt@@standardaddtocounter{#2}{#1}%
+ \gdef\@@assoccnt@@storagemacro@@lastaddtocounter{#2}%
+ }%
+}%
+
+
\newcommand{\@@assoccnt@@addtocounter}[2]{%
\ifcsdef{@@assoccnt@@suspendedcounterslist}{%
% Now, there are suspended counters -- do not update them!
\IsSuspendedCounter{#2}{%
% Nothing to be done
}{%
- \csletcs{cl@#2}{relax}%
\@@assoccnt@@standardaddtocounter{#2}{#1}%
\gdef\@@assoccnt@@storagemacro@@lastaddtocounter{#2}%
}%
}{%
- \csletcs{cl@#2}{relax}%
\@@assoccnt@@standardaddtocounter{#2}{#1}%
\gdef\@@assoccnt@@storagemacro@@lastaddtocounter{#2}%
}%
}%
+
+\renewcommand{\addtocounter}[2]{%
+ \iftoggle{GlobalSuspend}{%
+ \IsSuspendedCounter{#1}{%
+ % 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
+ }{%
+ % No list -> do nothing at all
+ }%
+}%
+
+
+
+
%%% addtocounter wrapper -- needs to switch the arguments for the command for the list usage!!!
\newcommand{\@@assoccnt@@setcounter}[3]{%
\IsAssociatedToCounter{#1}{#3}{%
@@ -462,10 +500,31 @@ AssociatedCountersList%
-%%% Not needed so far
-\newcommand{\@@assoccnt@@refstepcounter}[1]{% %
+
+
+
+\newcommand{\@@assoccnt@@stepcounter}[1]{%
+ \@@assoccnt@@standardstepcounter{#1}%
+ \gdef\@@assoccnt@@storagemacro@@laststeppedcounter{#1}%
+}%
+
+
+\newcommand{\@@assoccnt@@stepdrivencounters}[1]{%
+ \ifcsdef{\@@assoccnt@@generatelistname{#1}}{% Check first, whether the list exists at all,
+ \forlistcsloop{\@@assoccnt@@standardrefstepcounter}{\@@assoccnt@@generatelistname{#1}}% March through the list
+ }{%
+ }%
+}%
+
+
+
+\renewcommand{\stepcounter}[1]{%
+ \@@assoccnt@@stepcounter{#1}%
+}%
+
+%%% Wrapper --> use standard ref stepping to prevent labelling system going mental
+\newcommand{\@@assocccnt@@refstepcounter}[1]{% %
\@@assoccnt@@standardrefstepcounter{#1}%
- \gdef\@@assoccnt@@storagemacro@@lastrefsteppedcounter{#1}%
}%
\renewcommand{\refstepcounter}[1]{%
@@ -473,35 +532,21 @@ AssociatedCountersList%
}%
-\renewcommand{\addtocounter}[2]{%
- \iftoggle{GlobalSuspend}{%
- \IsSuspendedCounter{#1}{%
- % No, do nothing at all%
- }{%
- \@@assoccnt@@standardaddtocounter{#1}{#2}%
- \gdef\@@assoccnt@@storagemacro@@lastaddtocounter{#1}%
- }%
- }{%
- \@@assoccnt@@standardaddtocounter{#1}{#2}%
- \gdef\@@assoccnt@@storagemacro@@lastaddtocounter{#1}%
- }%
- \@ifundefined{cl@#1}{%
- \ifcsdef{\@@assoccnt@@generatelistname{#1}}{% Check first, whether the list exists at all,
- \forlistcsloop{\@@assoccnt@@addtocounter{#2}}{\@@assoccnt@@generatelistname{#1}}% March through the list
- }{%
- % No list -> do nothing at all
- }%
- }{%
- %\csletcs{temp@cllist}{cl@#1}
- \csletcs{cl@#1}{relax}%
- \ifcsdef{\@@assoccnt@@generatelistname{#1}}{% Check first, whether the list exists at all,
- \forlistcsloop{\@@assoccnt@@addtocounter{#2}}{\@@assoccnt@@generatelistname{#1}}% March through the list
- }{%
- % No list -> do nothing at all
- }%
- }%
+\newcommand{\@@assoccnt@@refstepcounter}[1]{% %
+ \gdef\@@assoccnt@@storagemacro@@lastrefsteppedcounter{#1}%
+ \if@calcpackage
+ \@@assoccnt@@stepdrivencounters{#1}%
+ \fi
+ \@@assoccnt@@standardrefstepcounter{#1}%
+}%
+
+\renewcommand{\refstepcounter}[1]{%
+ \@@assoccnt@@refstepcounter{#1}%
}%
+
+
+
\listgadd{\@@assoccnt@@tempcounterlist}{}% This should be renamed later one... treated more generally
\newcommand{\@@assoccnt@@setcounterwrapper}[3]{%
@@ -514,8 +559,6 @@ AssociatedCountersList%
\define@boolkey{\@@assoccnt@@keys}{AssociatedToo}[false]{%
}%
-
-
\define@key{\@@assoccnt@@keys}{AssociatedCounters}{%
\undef{\@@assoccnt@@tempcounterlist}%
\def\@@assoccnt@@keymacro@@associatedcounters{#1}%
@@ -528,7 +571,6 @@ 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}}%
@@ -567,4 +609,5 @@ AssociatedCountersList%
}%
+
\endinput% \ No newline at end of file