summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/carlisle/remreset.sty
blob: 0d987ec1850885d0fc607b24cdf4f9e8ab3bc28d (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

% remreset package
%%%%%%%%%%%%%%%%%%

% Copyright 1997, 2018 David carlisle
% This file may be distributed under the terms of the LPPL.
% See README.txt for details.

% 2018/04/01  David Carlisle
% 1997/09/28  David Carlisle

% LaTeX includes a command \@addtoreset that is used to declare that
% a counter should be reset every time a second counter is incremented.

% For example the book class has a line
% \@addtoreset{footnote}{chapter}
% So that the footnote counter is reset each chapter.

% If you wish to base a new class on book, but without this counter
% being reset, then standard LaTeX gives no simple mechanism to do
% this.

% This package defines |\@removefromreset| which just undoes the effect
% of \@addtoreset. So for example a class file may be defined by

% \LoadClass{book}
% \@removefromreset{footnote}{chapter}

% 2018: package obsoleted as the command is defined in the LaTeX format.

\@ifundefined{@removefromreset}{%
\def\@removefromreset#1#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\csname cl@#2\endcsname{%
    \csname cl@#2\endcsname}}}%
}{%
\PackageWarningNoLine{remreset}
    {The remreset package is obsolete:\MessageBreak
     \noexpand\@removefomresset is defined}%
}