summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/thmtools/aliasctr.sty
blob: 9fc7f33c69a27a7a4e0cef40f805b8f12a67d544 (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
83
%%
%% This is file `aliasctr.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% aliasctr.dtx  (with options: `code')
%% This is a generated file.
%% 
%% This file is part of the `thmtools' package.
%% The `thmtools' package has the LPPL maintenance status: maintained.
%% Current Maintainer is Yukai Chou, muzimuzhi@gmail.com
%% 
%% Copyright (C) 2008-2014 by Ulrich M. Schwarz
%% Copyright (C) 2019      by Frank Mittelbach
%% Copyright (C) 2020-     by Yukai Chou
%% 
%% This file may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, version 1.3c.
%% This version is obtainable at
%% http://www.latex-project.org/lppl/lppl-1-3c.txt
%% 
%% 
\NeedsTeXFormat {LaTeX2e}
\ProvidesPackage {aliasctr}[2022/06/01 v0.73]
\def\aliasctr@f@llow#1#2\@nil#3{%
  \ifx#1\@elt
  \noexpand #3%
  \else
  \expandafter\aliasctr@f@llow#1\@elt\@nil{#1}%
  \fi
}
\newcommand\aliasctr@follow[1]{%
  \expandafter\aliasctr@f@llow
  \csname cl@#1\endcsname\@elt\@nil{\csname cl@#1\endcsname}%
}
\renewcommand*\@addtoreset[2]{\bgroup
   \edef\aliasctr@@truelist{\aliasctr@follow{#2}}%
  \let\@elt\relax
  \expandafter\@cons\aliasctr@@truelist{{#1}}%
\egroup}
\@ifundefined{@removefromreset}{\RequirePackage{remreset}}{}
\renewcommand*\@removefromreset[2]{\bgroup
  \edef\aliasctr@@truelist{\aliasctr@follow{#2}}%
  \expandafter\let\csname c@#1\endcsname\@removefromreset
  \def\@elt##1{%
    \expandafter\ifx\csname c@##1\endcsname\@removefromreset
    \else
      \noexpand\@elt{##1}%
    \fi}%
  \expandafter\xdef\aliasctr@@truelist{%
    \aliasctr@@truelist}
\egroup}
\newcommand\@counteralias[2]{{%
    \def\@@gletover##1##2{%
      \expandafter\global
      \expandafter\let\csname ##1\expandafter\endcsname
      \csname ##2\endcsname
    }%
    \@ifundefined{c@#2}{\@nocounterr{#2}}{%
      \expandafter\@ifdefinable\csname c@#1\endcsname{%
        \@@gletover{c@#1}{c@#2}%
        \@@gletover{the#1}{the#2}%
        \@@gletover{theH#1}{theH#2}%
        \@ifpackageloaded{cleveref}{%
          \edef\aliasctr@temp{%
            \noexpand\cref@resetby{#2}{\noexpand\cref@result}}%
          \aliasctr@temp
          \ifx\cref@result\relax\else%
            \cref@addtoreset{#1}{\cref@result}%
          \fi
        }{}%
        \@@gletover{p@#1}{p@#2}%
        \expandafter\global
        \expandafter\def\csname cl@#1\expandafter\endcsname
        \expandafter{\csname cl@#2\endcsname}%
        %\@addtoreset{#1}{@ckpt}%
      }%
    }%
}}
\endinput
%%
%% End of file `aliasctr.sty'.