summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/oberdiek/aliascnt.sty
blob: eb08b3031b5a53b363d7fa61ce9766854a117309 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
%%
%% This is file `aliascnt.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% aliascnt.dtx  (with options: `package')
%% 
%% This is a generated file.
%% 
%% Copyright (C) 2006, 2009 by Heiko Oberdiek <oberdiek@uni-freiburg.de>
%% 
%% 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 "maintained".
%% 
%% This Current Maintainer of this work is Heiko Oberdiek.
%% 
%% This work consists of the main source file aliascnt.dtx
%% and the derived files
%%    aliascnt.sty, aliascnt.pdf, aliascnt.ins, aliascnt.drv.
%% 
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{aliascnt}%
  [2009/09/08 v1.3 Alias counter (HO)]%
\newcommand*{\newaliascnt}[2]{%
  \begingroup
    \def\AC@glet##1{%
      \global\expandafter\let\csname##1#1\expandafter\endcsname
        \csname##1#2\endcsname
    }%
    \@ifundefined{c@#2}{%
      \@nocounterr{#2}%
    }{%
      \expandafter\@ifdefinable\csname c@#1\endcsname{%
        \AC@glet{c@}%
        \AC@glet{the}%
        \AC@glet{theH}%
        \AC@glet{p@}%
        \expandafter\gdef\csname AC@cnt@#1\endcsname{#2}%
        \expandafter\gdef\csname cl@#1\expandafter\endcsname
        \expandafter{\csname cl@#2\endcsname}%
      }%
    }%
  \endgroup
}
\newcommand*{\aliascntresetthe}[1]{%
  \@ifundefined{AC@cnt@#1}{%
    \PackageError{aliascnt}{%
      `#1' is not an alias counter%
    }\@ehc
  }{%
    \expandafter\let\csname the#1\expandafter\endcsname
      \csname the\csname AC@cnt@#1\endcsname\endcsname
  }%
}
\newcommand*{\AC@findrootcnt}[1]{%
  \@ifundefined{AC@cnt@#1}{%
    #1%
  }{%
    \expandafter\AC@findrootcnt\csname AC@cnt@#1\endcsname
  }%
}
\def\AC@patch#1{%
  \expandafter\let\csname AC@org@#1reset\expandafter\endcsname
    \csname @#1reset\endcsname
  \expandafter\def\csname @#1reset\endcsname##1##2{%
    \csname AC@org@#1reset\endcsname{##1}{\AC@findrootcnt{##2}}%
  }%
}
\RequirePackage{remreset}
\AC@patch{addto}
\AC@patch{removefrom}
\endinput
%%
%% End of file `aliascnt.sty'.