]> www.fi.muni.cz Git - pan13-paper.git/blob - pan13-paper/aliascnt.sty
Prvnotni zavedeni
[pan13-paper.git] / pan13-paper / aliascnt.sty
1 %%\r
2 %% This is file `aliascnt.sty',\r
3 %% generated with the docstrip utility.\r
4 %%\r
5 %% The original source files were:\r
6 %%\r
7 %% aliascnt.dtx  (with options: `package')\r
8 %% \r
9 %% This is a generated file.\r
10 %% \r
11 %% Project: aliascnt\r
12 %% Version: 2009/09/08 v1.3\r
13 %% \r
14 %% Copyright (C) 2006, 2009 by\r
15 %%    Heiko Oberdiek <heiko.oberdiek at googlemail.com>\r
16 %% \r
17 %% This work may be distributed and/or modified under the\r
18 %% conditions of the LaTeX Project Public License, either\r
19 %% version 1.3c of this license or (at your option) any later\r
20 %% version. This version of this license is in\r
21 %%    http://www.latex-project.org/lppl/lppl-1-3c.txt\r
22 %% and the latest version of this license is in\r
23 %%    http://www.latex-project.org/lppl.txt\r
24 %% and version 1.3 or later is part of all distributions of\r
25 %% LaTeX version 2005/12/01 or later.\r
26 %% \r
27 %% This work has the LPPL maintenance status "maintained".\r
28 %% \r
29 %% This Current Maintainer of this work is Heiko Oberdiek.\r
30 %% \r
31 %% This work consists of the main source file aliascnt.dtx\r
32 %% and the derived files\r
33 %%    aliascnt.sty, aliascnt.pdf, aliascnt.ins, aliascnt.drv.\r
34 %% \r
35 \NeedsTeXFormat{LaTeX2e}\r
36 \ProvidesPackage{aliascnt}%\r
37   [2009/09/08 v1.3 Alias counter (HO)]%\r
38 \newcommand*{\newaliascnt}[2]{%\r
39   \begingroup\r
40     \def\AC@glet##1{%\r
41       \global\expandafter\let\csname##1#1\expandafter\endcsname\r
42         \csname##1#2\endcsname\r
43     }%\r
44     \@ifundefined{c@#2}{%\r
45       \@nocounterr{#2}%\r
46     }{%\r
47       \expandafter\@ifdefinable\csname c@#1\endcsname{%\r
48         \AC@glet{c@}%\r
49         \AC@glet{the}%\r
50         \AC@glet{theH}%\r
51         \AC@glet{p@}%\r
52         \expandafter\gdef\csname AC@cnt@#1\endcsname{#2}%\r
53         \expandafter\gdef\csname cl@#1\expandafter\endcsname\r
54         \expandafter{\csname cl@#2\endcsname}%\r
55       }%\r
56     }%\r
57   \endgroup\r
58 }\r
59 \newcommand*{\aliascntresetthe}[1]{%\r
60   \@ifundefined{AC@cnt@#1}{%\r
61     \PackageError{aliascnt}{%\r
62       `#1' is not an alias counter%\r
63     }\@ehc\r
64   }{%\r
65     \expandafter\let\csname the#1\expandafter\endcsname\r
66       \csname the\csname AC@cnt@#1\endcsname\endcsname\r
67   }%\r
68 }\r
69 \newcommand*{\AC@findrootcnt}[1]{%\r
70   \@ifundefined{AC@cnt@#1}{%\r
71     #1%\r
72   }{%\r
73     \expandafter\AC@findrootcnt\csname AC@cnt@#1\endcsname\r
74   }%\r
75 }\r
76 \def\AC@patch#1{%\r
77   \expandafter\let\csname AC@org@#1reset\expandafter\endcsname\r
78     \csname @#1reset\endcsname\r
79   \expandafter\def\csname @#1reset\endcsname##1##2{%\r
80     \csname AC@org@#1reset\endcsname{##1}{\AC@findrootcnt{##2}}%\r
81   }%\r
82 }\r
83 \RequirePackage{remreset}\r
84 \AC@patch{addto}\r
85 \AC@patch{removefrom}\r
86 \endinput\r
87 %%\r
88 %% End of file `aliascnt.sty'.\r