summaryrefslogtreecommitdiff
path: root/info/examples/tip/part-lab.tip
blob: 1d8981dcd9849c3cde14a2438e8e44d95e44f4c9 (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
% This macro source file is from the four volume series
% "TeX in Practice" by Stephan von Bechtolsheim, published
% 1993 by Springer-Verlag, New York.
% Copyright 1993 Stephan von Bechtolsheim.
% No warranty or liability is assumed.
% This macro may be copied freely if no fees other than
% media cost or shipping charges are charged and as long
% as this copyright and the following source code itself
% is not changed. Please see the series for further information.
%
% Version: 1.0
% Date: May 1, 1993
%
%
% This source code is documented in 30.8.7, p. III-575.
% Original source in file "pp1.TEX", starting line 2185.
\wlog{L: "part-lab.tip" ["pp1.TEX," l. 2185, p. III-575]}%
% This file DOES NOT belong to format "texip."
\catcode`\@ = 11
\newif\if@LabelNow
\def\@Label #1#2#3{% 
    \ifnum #3 = 0
        \@LabelNowtrue
    \else
        \ifvmode
            \ifinner
                \@LabelNowtrue
            \else
                \@LabelNowfalse
            \fi
        \else
            \@LabelNowtrue
        \fi
    \fi
    \bgroup
        \let\RefCounterTwo = \relax
        \xdef\@LabelTempA{%
            \write\@PartAuxStream{% 
                \string\@NewLabel{#1}{#2}{\RefCounterTwo{PageNo}}}%
        }%
    \egroup
    \if@LabelNow
        \@LabelTempA
    \else
        \bgroup
            \let\RefCounterTwo = \relax
            \xdef\EveryParC{%
                \EveryParC
                \@LabelTempA
            }%
        \egroup
    \fi
    \ignorespaces
}
\def\CheckLabels{% 
    \wlog{\string\CheckLabels: checking labels started.}%
    \global\@LabelsOktrue
    \@IgnoreAuxStuff
    \let\@NewLabel = \@NewLabelCompare
    \@ReadInAuxFiles
    \if@LabelsOk
        \wlog{** All labels are ok **}%
    \else
        \wlog{** LABELS CHANGED, reprocess document **}%
    \fi
    \wlog{\string\CheckLabels: done.}%
}
\def\@NewLabelCompare #1#2#3{% 
    \if\@LabelIsDefined{##1}% 
        \def\@CheckLabelTemp{{##2}{##3}}%
        \edef\@@CheckLabelTemp{% 
            \NameUse{\@LabelRefPrefix ##1}% 
        }% 
        \ifx\@CheckLabelTemp\@@CheckLabelTemp
            \let\@CheckLabelsNext = \relax
        \else
            \let\@CheckLabelsNext = \@StopCheckingLabels
        \fi
    \else
        \let\@CheckLabelsNext = \@StopCheckingLabels
    \fi
    \@CheckLabelsNext
}
\def\@StopCheckingLabels{% 
    \global\@LabelsOkfalse
    \let\@NewLabel = \GobbleThree
}
\catcode`\@ = 12