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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
|
%%
%% This is file `volumes.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% volumes.dtx (with options: `volumes')
%%
%% Copyright (C) 2003 Frank Küster.
%%
%% All rights reserved.
\ProvidesPackage{volumes}
[2004/06/02 v1.0 print only parts of a LaTeX document,
with complete indices etc.]
\newif\if@allincludes\@allincludestrue
\newif\if@tocall\@tocallfalse
\newif\if@lofall\@lofallfalse
\newif\if@lotall\@lotallfalse
\DeclareOption{manual}{\@allincludesfalse}
\DeclareOption{tocall}{\@tocalltrue}
\DeclareOption{lofall}{\@lofalltrue}
\DeclareOption{lotall}{\@lotalltrue}
\ProcessOptions%
\RequirePackage{nowtoaux}
\newcommand{\vol@do@addto}[1]{#1}
\let\vol@dont@addto\@gobble
\newcommand{\voladdtotoc}[1]{%
\addtocontents{toc}{\protect\vol@maybe@addto@toc{#1}}%
}%
\let\vol@maybe@addto@toc\vol@do@addto
\newcommand{\voladdtolof}[1]{%
\addtocontents{lof}{\protect\vol@maybe@addto@lof{#1}}%
}%
\let\vol@maybe@addto@lof\vol@do@addto
\newcommand{\voladdtolot}[1]{%
\addtocontents{lot}{\protect\vol@maybe@addto@lot{#1}}%
}%
\let\vol@maybe@addto@lot\vol@do@addto
\let\volumes@orig@contentsline\contentsline \RequirePackage{scrlfile}
\AfterPackage{hyperref}{\let\volumes@orig@contentsline\contentsline}
\@ifpackageloaded{hyperref}{%
\let\volumes@new@contentsline\@gobblefour
}{%
\def\volumes@new@contentsline#1#2#3{}
\AfterPackage{hyperref}{%
\let\volumes@new@contentsline\@gobblefour
}
}
\def\volumes@switch@orig@contentsline@toc{%
\let\contentsline\volumes@orig@contentsline%
\let\vol@maybe@addto@toc\vol@do@addto
}
\def\volumes@switch@new@contentsline@toc{%
\let\contentsline\volumes@new@contentsline%
\let\vol@maybe@addto@toc\vol@dont@addto
}
\def\volumes@switch@orig@contentsline@lof{%
\let\contentsline\volumes@orig@contentsline%
\let\vol@maybe@addto@lof\vol@do@addto
}
\def\volumes@switch@new@contentsline@lof{%
\let\contentsline\volumes@new@contentsline%
\let\vol@maybe@addto@lof\vol@dont@addto
}
\def\volumes@switch@orig@contentsline@lot{%
\let\contentsline\volumes@orig@contentsline%
\let\vol@maybe@addto@lot\vol@do@addto
}
\def\volumes@switch@new@contentsline@lot{%
\let\contentsline\volumes@new@contentsline%
\let\vol@maybe@addto@lot\vol@dont@addto
}
\def\volume@switch@off{%
\if@tocall\else%
\immediateaddtocontents{toc}{\protect\volumes@switch@new@contentsline@toc}%
\fi%
\if@lofall\else%
\immediateaddtocontents{lof}{\protect\volumes@switch@new@contentsline@lof}%
\fi%
\if@lotall\else%
\immediateaddtocontents{lot}{\protect\volumes@switch@new@contentsline@lof}%
\fi%
}
\def\volume@switch@on{%
\immediateaddtocontents{toc}{\protect\volumes@switch@orig@contentsline@toc}%
\immediateaddtocontents{lof}{\protect\volumes@switch@orig@contentsline@lof}%
\immediateaddtocontents{lot}{\protect\volumes@switch@orig@contentsline@lof}%
}
\def\volumecommand#1#2{%
\expandafter\def\csname volume@command@#1\endcsname{%
#2%
}%
}
\def\allvolumescommand#1{%
\def\all@volumes@command{#1}%
}
\let\all@volumes@command\relax
\providecommand\ifnumber[3]{
\begingroup\@tempswafalse\let\scr@next\test@number
\expandafter\scr@next#1\scr@next
\if@tempswa\endgroup#2\else\endgroup#3\fi
}
\providecommand*{\test@number}[1]{
\ifx \scr@next#1
\let\scr@next\relax
\else
\@tempcnta=\expandafter\expandafter\expandafter\number
\expandafter`#1\relax
\ifnum \@tempcnta>47\relax
\ifnum \@tempcnta<58\relax
\@tempswatrue
\else\@tempswafalse\fi
\else\@tempswafalse\fi
\if@tempswa\else\let\scr@next\gobble@till@next\fi\fi
\scr@next}
\providecommand*{\gobble@till@next}{}
\def\gobble@till@next#1\scr@next{}
\newcommand*{\volumename}[1]{%
\def\volume@name{#1}%
}%
\volumename{volume}%
\newcommand*{\alwaysinclude}[1]{%
\if@allincludes
\PackageError{volumes}{%
need option "manual" for \string\alwaysinclude.%
}{%
You must use the option "manual" when you want to use
\string\alwaysinclude, and\MessageBreak specify
the volumes using \string\volumeone\space etc. - see
the package documentation.
}
\else
\def\always@include{,#1}
\fi
}
\def\always@include{}
\newcommand*{\onlyvolume}[1]{}
\def\onlyvolume{%
\@ifnextchar [{\@onlyvolume}{\@@onlyvolume}
}
\def\@onlyvolume[#1]{%
\ifnumber{#1}{%
\def\volume{#1}
}{%
\PackageError{volumes}{%
Argument to \string\onlyvolume\space must be a number%
}{%
The optional argument to \string\onlyvolume\space is used to
tell volumes.sty which volume it should typeset. You should have
specified a number there, but instead, you said: \volume%
}%
}%
\@@onlyvolume
}
\newcounter{volume}%
\newcounter{numberofvolumes}\setcounter{numberofvolumes}{10}%
\def\@@onlyvolume{%
\ifx\volume\undefined%
\PackageWarningNoLine{volumes}{Typesetting complete document.}
\setcounter{volume}{0}%
\@whilenum\c@volume<\c@numberofvolumes\do
{%
\expandafter\let%
\csname volume@switch@\arabic{volume}\endcsname\relax%
\stepcounter{volume}%
}%
\setcounter{volume}{0}%
\AtBeginDocument{\all@volumes@command}%
\else
\ifnumber{\volume}{%
\PackageWarningNoLine{volumes}{Typesetting part \volume.}
}{%
\PackageError{volumes}{\string\volume\space is defined, but not a
number}{%
The macro \string\volume\space is used to tell volumes.sty which
volume it should typeset. You have defined this macro, but it is
not a number. Instead, it is: \volume%
}%
}%
\setcounter{volume}{0}%
\@whilenum\c@volume<\c@numberofvolumes\do {%
\expandafter\let%
\csname volume@switch@\arabic{volume}\endcsname%
\volume@switch@off%
\stepcounter{volume}%
}
\setcounter{volume}{0}%
\AtBeginDocument{\csname volume@command@\volume\endcsname}
\expandafter\let%
\csname volume@switch@\volume\endcsname\volume@switch@on
\includeonly{\volume@name\volume\always@include}%
\fi
\if@allincludes\else%
\@ifundefined{volumelist}{%
\def\volumelist{one,two,three,four,five,six,seven,eight,nine,ten}%
}{}%
\@for\vol@num:=\volumelist\do
{%
\stepcounter{volume}%
\expandafter\let\csname volume\vol@num\expandafter\endcsname%
\csname volume@switch@\arabic{volume}\endcsname%
}%
\setcounter{volume}{0}%
\fi
}
\setcounter{volume}{0}%
\if@allincludes%
\let\volume@orig@include\include%
\def\include{%
\stepcounter{volume}%
\csname volume@switch@\arabic{volume}\endcsname%
\volume@orig@include%
}
\fi
\endinput
%%
%% End of file `volumes.sty'.
|