diff options
author | Karl Berry <karl@freefriends.org> | 2009-03-02 16:58:41 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2009-03-02 16:58:41 +0000 |
commit | ec105f442ef9d079793cc35460e4c7aa1d905ceb (patch) | |
tree | 83dbcce8dee8d79f39aa282bb4104845186534d8 /Master/texmf-dist/tex/latex/vhistory/sets.sty | |
parent | dbf147af99673cd9a64451b4c90c847514f02405 (diff) |
vhistory update (1mar09)
git-svn-id: svn://tug.org/texlive/trunk@12285 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/vhistory/sets.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/vhistory/sets.sty | 45 |
1 files changed, 24 insertions, 21 deletions
diff --git a/Master/texmf-dist/tex/latex/vhistory/sets.sty b/Master/texmf-dist/tex/latex/vhistory/sets.sty index 8c5de82fa42..4042752545c 100644 --- a/Master/texmf-dist/tex/latex/vhistory/sets.sty +++ b/Master/texmf-dist/tex/latex/vhistory/sets.sty @@ -3,8 +3,8 @@ %% FILE: sets.sty %% %% %% %% AUTHOR: Jochen Wertenauer %% -%% VERSION: 1.1 %% -%% DATE: 2006-01-09 %% +%% VERSION: 1.2 %% +%% DATE: 2009-03-01 %% %% %% %% LICENSE: This program may be distributed and/or modified under the %% %% conditions of the LaTeX Project Public License, either version 1.2 %% @@ -53,16 +53,18 @@ %% Helper Methods ------------------------------------------------------------ -\let \xpa \expandafter -\def \xxpa{\xpa\xpa\xpa} +\let \sets@xpa \expandafter +\def \sets@xxpa{\sets@xpa\sets@xpa\sets@xpa} + +\def \sets@empty{\empty} %% Appends #1 to the definition of macro #2. -\def \sets@append #1\to#2{\xpa \def \xpa #2\xpa{#2#1}} +\def \sets@append #1\to#2{\sets@xpa \def \sets@xpa #2\sets@xpa{#2#1}} %% Removes the first character of the content of #2 and stores the result in -%% #1. Note that \xpa\xpa\xpa cannot be replaced by \xxpa here! +%% #1. Note that \sets@xpa\sets@xpa\sets@xpa cannot be replaced by \sets@xxpa here! \def \sets@gobblefirst #1#2{% - \xxpa \def \xpa\xpa\xpa #1\xpa\xpa\xpa {\xpa\@gobble #2}} + \sets@xxpa \def \sets@xpa\sets@xpa\sets@xpa #1\sets@xpa\sets@xpa\sets@xpa {\sets@xpa\@gobble #2}} %% Deletes everthing to the next occurance of > inludung the >. \def \sets@erasetobrace #1>{} @@ -75,7 +77,7 @@ %% \if ... %% \repeat \def \sets@loop #1\repeat{% - \def \iterate {#1\xpa \iterate\fi}% + \def \iterate {#1\sets@xpa \iterate\fi}% \iterate \let\iterate\relax} \long\def \sets@ReturnFi #1\fi{\fi #1} @@ -97,11 +99,11 @@ %% The macros are based on a sort algorithm by Klaus Lagally. \def \sets@compStrings #1#2{% \def \sets@CSti{#1}% - \edef\sets@ctempi{\xpa\sets@erasetobrace\meaning \sets@CSti}% + \edef\sets@ctempi{\sets@xpa\sets@erasetobrace\meaning \sets@CSti}% \def \sets@CStii{#2}% - \edef\sets@ctempii{\xpa\sets@erasetobrace\meaning \sets@CStii}% + \edef\sets@ctempii{\sets@xpa\sets@erasetobrace\meaning \sets@CStii}% \sets@lessfalse\sets@greaterfalse - \xxpa\sets@compI \xpa\sets@ctempi\xpa|\xpa\\\sets@ctempii|\relax + \sets@xxpa\sets@compI \sets@xpa\sets@ctempi\sets@xpa|\sets@xpa\\\sets@ctempii|\relax } @@ -151,7 +153,7 @@ %% Stores the size of set #1 in the LaTeX counter #2. #2 has to be existing. \def \sizeofset #1\is#2{% \setcounter{#2}{0}% - \xpa\sets@sizeofset #1|\endset{#2}% + \sets@xpa\sets@sizeofset #1|\endset{#2}% } % Helper method for \sizeofset. Recursively calls itself. Implemented straight @@ -173,15 +175,16 @@ %% Printing a set ------------------------------------------------------------ %% The content of this macro will be used to separate the elements of the set. -\def \setseparator{,\ } +\def \setseparator{, } %% Prints the contents of set #1. Elements will be separated by \setseparator. -\def \listset #1{\xpa\sets@listset #1|\empty\endset} +\def \listset #1{\sets@xpa\sets@listset #1|\empty\endset} %% Helper method for \listset. \def \sets@listset #1|#2\endset{% #1% - \ifx #2\empty{}\else + \def\temps@t{#2}% + \ifx \temps@t\sets@empty{}\else \setseparator \sets@ReturnFi{\sets@listset #2\endset}% \fi @@ -208,7 +211,7 @@ \endgroup \sets@Returntrue \fi}% - \xpa\lookup \xpa |#2|#1|\endset% + \sets@xpa\lookup \sets@xpa |#2|#1|\endset% } %----------------------------------------------------------------------------- @@ -218,7 +221,7 @@ %% This macro finds alle duplicate elements in the SORTED set #1 and removes %% them. The result set (still sorted) is stored in #2. -\def \deleteduplicates #1#2{\xpa\sets@duplicates#1|\endset#2} +\def \deleteduplicates #1#2{\sets@xpa\sets@duplicates#1|\endset#2} %% Helper method for \deleteduplicates. Does some preparations and catches the %% special case of an set with size <= 1. Parameter #3 is the result set. @@ -292,7 +295,7 @@ \def \sets@sortset #1#2{% \let \sorttemps@t #1% \sets@loop - \xpa\sets@bubblesortRun \sorttemps@t|\endset\sorttemps@t + \sets@xpa\sets@bubblesortRun \sorttemps@t|\endset\sorttemps@t \addtocounter{s@tlength}{-1}% \ifnum 1<\value{s@tlength}\relax \repeat @@ -355,7 +358,7 @@ \else \let \uniontemps@t=\uniont@mpi \ifx \uniont@mpii\empty \else - \xpa\sets@append\xpa{\xpa|#2}\to\uniontemps@t + \sets@xpa\sets@append\sets@xpa{\sets@xpa|#2}\to\uniontemps@t \fi \fi \sortset{\uniontemps@t}{\uniontemps@t}% @@ -370,7 +373,7 @@ %% sorted, too. If #1 contains duplicates, #3 may also contain duplicates. \def \intersectsets #1#2\to#3{% \def \tempinters@ct{}% - \xpa \sets@intersectsets #1|\endset#2\tempinters@ct + \sets@xpa \sets@intersectsets #1|\endset#2\tempinters@ct \ifx \tempinters@ct\empty \def #3{}% \else @@ -401,7 +404,7 @@ %% will be part if it is in #2. \def \minussets #1\minus#2\to#3{% \def \@tempminus{}% - \xpa \sets@minussets #1|\endset#2\@tempminus + \sets@xpa \sets@minussets #1|\endset#2\@tempminus \ifx \@tempminus\empty \def #3{}% \else |