summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/preprint/sublabel.sty
blob: a1d035506a9adbb267eae29d11a356f25feed99a (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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
%%
%% This is file `sublabel.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% sublabel.dtx  (with options: `package')
%% =============================================
%% IMPORTANT NOTICE:
%% 
%% This program can be redistributed and/or modified under the terms
%% of the LaTeX Project Public License Distributed from CTAN
%% archives in directory macros/latex/base/lppl.txt; either
%% version 1 of the License, or any later version.
%% 
%% This is a generated file.
%% It may not be distributed without the original source file sublabel.dtx.
%% 
%% Full documentation can be obtained by LaTeXing that original file.
%% Only a few abbreviated comments remain here to describe the usage.
%% =============================================
%% Copyright 1993-1999 Patrick W Daly
%% Max-Planck-Institut f\"ur Aeronomie
%% Max-Planck-Str. 2
%% D-37191 Katlenburg-Lindau
%% Germany
%% E-mail: daly@linmpi.mpg.de
\NeedsTeXFormat{LaTeX2e}[1995/06/01]
\ProvidesPackage{sublabel}
       [1999/02/23 4.5 (PWD)]
 % To change a counter foo so that it has sublabels (4a 4b 4c ...)
 % give the command \sublabon{foo}... \sublaboff{foo}
 %
 % The style of the sublabel is given by command \substyle, which takes one
 % argument, a counter. It may be redefined in the document to be whatever
 % style is wanted.
 % Default is {\itshape\alph{#1}}, ie italic lowercase numbers.
 %
 % Options for LaTeX2e:
 %   roman   the style of sublabels is small roman letter
 %   italic  the style is small italic letter (default)
 %-----------------------------------------------------------
\@ifundefined{iffigcaps}{}
  {\PackageWarningNoLine{sublabel}
     {***********************************\MessageBreak
      This package read in after `figcaps'\MessageBreak
      There could be problems with sublabelled\MessageBreak
      figure and table numbers.\MessageBreak
      ***********************************}}
\newcommand{\substyle}{}
  \DeclareOption{italic}{\def\substyle#1{\itshape\alph{#1}}}
  \DeclareOption{roman}{\def\substyle#1{\alph{#1}}}
  \ExecuteOptions{italic}
  \ProcessOptions
\newcommand{\sublabon}[1]{\@bsphack
\@ifundefined{c@#1}{%
    \PackageError{sublabel}
  {\protect\sublabon\space called for a non-existent counter}{\@eha}}
 {\@ifundefined{c@sb@#1}{\expandafter\newcount\csname c@sb@#1\endcsname
  \setcounter{sb@#1}{-1}}{}%
\ifnum\@nameuse{c@sb@#1}<0\else\sublaboff{#1}\fi
\stepcounter{#1}%
\setcounter{sb@#1}{0}%
\def\@tempa{eqnarray}\ifx \@tempa\@currenvir
    \addtocounter{equation}{-1}\setcounter{sb@equation}{1}\fi
\global\expandafter\let\csname @ldthe#1\expandafter\endcsname
    \csname the#1\endcsname
\expandafter\gdef\csname the#1\endcsname{%
   \@nameuse{@ldthe#1}{\substyle{sb@#1}}}
}\@esphack}
\newcommand{\sublaboff}[1]{\@bsphack
\@ifundefined{c@#1}{%
    \PackageError{sublabel}
  {\protect\sublaboff\space called for a non-existent counter}{\@eha}}
 {\@ifundefined{c@sb@#1}{%
    \PackageWarning{sublabel}
 {\protect\sublaboff{#1} called without any previous
    \MessageBreak
  \protect\sublabon{#1} command}}
 {\ifnum\@nameuse{c@sb@#1}<0
    \PackageWarning{sublabel}
 {\protect\sublaboff{#1} called without a previous
    \MessageBreak
  \protect\sublabon{#1} command being active}\else
\ifnum\@nameuse{c@sb@#1}=0\addtocounter{#1}{-1}\fi
\setcounter{sb@#1}{-1}%
\global\expandafter\let\csname the#1\expandafter\endcsname
    \csname @ldthe#1\endcsname
\def\@tempa{eqnarray}\ifx \@tempa\@currenvir
    \stepcounter{equation}\fi
\fi}}\@esphack}
\AtBeginDocument{%
\let\@ldstepcounter=\stepcounter
\renewcommand{\stepcounter}[1]
 {\@ifundefined{c@sb@#1}{\@ldstepcounter{#1}}{\ifnum
  \@nameuse{c@sb@#1}<0\relax
  \@ldstepcounter{#1}\else \@ldstepcounter{sb@#1}\fi}%
}
\let\@ldaddtoctr=\addtocounter
\renewcommand{\addtocounter}[2]
 {\@ifundefined{c@sb@#1}{\@ldaddtoctr{#1}{#2}}{\ifnum
  \@nameuse{c@sb@#1}<0\relax
  \@ldaddtoctr{#1}{#2}\else \@ldaddtoctr{sb@#1}{#2}\fi}%
}
\let\@ldendeqnarray=\endeqnarray
\renewcommand{\endeqnarray}{\@ldendeqnarray
  \@ifundefined{c@sb@equation}{}{\ifnum\c@sb@equation<0\else
  \@ldaddtoctr{equation}{1}\@ldaddtoctr{sb@equation}{-1}\fi}}
}
%% 
%% <<<<< End of generated file <<<<<<
%%
%% End of file `sublabel.sty'.