Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download

📚 The CoCalc Library - books, templates and other resources

132932 views
License: OTHER
1
%%
2
%% This is file `natbib.sty',
3
%% generated with the docstrip utility.
4
%%
5
%% The original source files were:
6
%%
7
%% natbib.dtx (with options: `package,all')
8
%% =============================================
9
%% IMPORTANT NOTICE:
10
%%
11
%% This program can be redistributed and/or modified under the terms
12
%% of the LaTeX Project Public License Distributed from CTAN
13
%% archives in directory macros/latex/base/lppl.txt; either
14
%% version 1 of the License, or any later version.
15
%%
16
%% This is a generated file.
17
%% It may not be distributed without the original source file natbib.dtx.
18
%%
19
%% Full documentation can be obtained by LaTeXing that original file.
20
%% Only a few abbreviated comments remain here to describe the usage.
21
%% =============================================
22
%% Copyright 1993-2009 Patrick W Daly
23
%% Max-Planck-Institut f\"ur Sonnensystemforschung
24
%% Max-Planck-Str. 2
25
%% D-37191 Katlenburg-Lindau
26
%% Germany
27
%% E-mail: [email protected]
28
\NeedsTeXFormat{LaTeX2e}[1995/06/01]
29
\ProvidesPackage{natbib}
30
[2009/07/16 8.31 (PWD, AO)]
31
32
% This package reimplements the LaTeX \cite command to be used for various
33
% citation styles, both author-year and numerical. It accepts BibTeX
34
% output intended for many other packages, and therefore acts as a
35
% general, all-purpose citation-style interface.
36
%
37
% With standard numerical .bst files, only numerical citations are
38
% possible. With an author-year .bst file, both numerical and
39
% author-year citations are possible.
40
%
41
% If author-year citations are selected, \bibitem must have one of the
42
% following forms:
43
% \bibitem[Jones et al.(1990)]{key}...
44
% \bibitem[Jones et al.(1990)Jones, Baker, and Williams]{key}...
45
% \bibitem[Jones et al., 1990]{key}...
46
% \bibitem[\protect\citeauthoryear{Jones, Baker, and Williams}{Jones
47
% et al.}{1990}]{key}...
48
% \bibitem[\protect\citeauthoryear{Jones et al.}{1990}]{key}...
49
% \bibitem[\protect\astroncite{Jones et al.}{1990}]{key}...
50
% \bibitem[\protect\citename{Jones et al., }1990]{key}...
51
% \harvarditem[Jones et al.]{Jones, Baker, and Williams}{1990}{key}...
52
%
53
% This is either to be made up manually, or to be generated by an
54
% appropriate .bst file with BibTeX.
55
% Author-year mode || Numerical mode
56
% Then, \citet{key} ==>> Jones et al. (1990) || Jones et al. [21]
57
% \citep{key} ==>> (Jones et al., 1990) || [21]
58
% Multiple citations as normal:
59
% \citep{key1,key2} ==>> (Jones et al., 1990; Smith, 1989) || [21,24]
60
% or (Jones et al., 1990, 1991) || [21,24]
61
% or (Jones et al., 1990a,b) || [21,24]
62
% \cite{key} is the equivalent of \citet{key} in author-year mode
63
% and of \citep{key} in numerical mode
64
% Full author lists may be forced with \citet* or \citep*, e.g.
65
% \citep*{key} ==>> (Jones, Baker, and Williams, 1990)
66
% Optional notes as:
67
% \citep[chap. 2]{key} ==>> (Jones et al., 1990, chap. 2)
68
% \citep[e.g.,][]{key} ==>> (e.g., Jones et al., 1990)
69
% \citep[see][pg. 34]{key}==>> (see Jones et al., 1990, pg. 34)
70
% (Note: in standard LaTeX, only one note is allowed, after the ref.
71
% Here, one note is like the standard, two make pre- and post-notes.)
72
% \citealt{key} ==>> Jones et al. 1990
73
% \citealt*{key} ==>> Jones, Baker, and Williams 1990
74
% \citealp{key} ==>> Jones et al., 1990
75
% \citealp*{key} ==>> Jones, Baker, and Williams, 1990
76
% Additional citation possibilities (both author-year and numerical modes)
77
% \citeauthor{key} ==>> Jones et al.
78
% \citeauthor*{key} ==>> Jones, Baker, and Williams
79
% \citeyear{key} ==>> 1990
80
% \citeyearpar{key} ==>> (1990)
81
% \citetext{priv. comm.} ==>> (priv. comm.)
82
% \citenum{key} ==>> 11 [non-superscripted]
83
% Note: full author lists depends on whether the bib style supports them;
84
% if not, the abbreviated list is printed even when full requested.
85
%
86
% For names like della Robbia at the start of a sentence, use
87
% \Citet{dRob98} ==>> Della Robbia (1998)
88
% \Citep{dRob98} ==>> (Della Robbia, 1998)
89
% \Citeauthor{dRob98} ==>> Della Robbia
90
%
91
%
92
% Citation aliasing is achieved with
93
% \defcitealias{key}{text}
94
% \citetalias{key} ==>> text
95
% \citepalias{key} ==>> (text)
96
%
97
% Defining the citation mode and punctual (citation style)
98
% \setcitestyle{<comma-separated list of keywords, same
99
% as the package options>}
100
% Example: \setcitestyle{square,semicolon}
101
% Alternatively:
102
% Use \bibpunct with 6 mandatory arguments:
103
% 1. opening bracket for citation
104
% 2. closing bracket
105
% 3. citation separator (for multiple citations in one \cite)
106
% 4. the letter n for numerical styles, s for superscripts
107
% else anything for author-year
108
% 5. punctuation between authors and date
109
% 6. punctuation between years (or numbers) when common authors missing
110
% One optional argument is the character coming before post-notes. It
111
% appears in square braces before all other arguments. May be left off.
112
% Example (and default) \bibpunct[, ]{(}{)}{;}{a}{,}{,}
113
%
114
% To make this automatic for a given bib style, named newbib, say, make
115
% a local configuration file, natbib.cfg, with the definition
116
% \newcommand{\bibstyle@newbib}{\bibpunct...}
117
% Then the \bibliographystyle{newbib} will cause \bibstyle@newbib to
118
% be called on THE NEXT LATEX RUN (via the aux file).
119
%
120
% Such preprogrammed definitions may be invoked anywhere in the text
121
% by calling \citestyle{newbib}. This is only useful if the style specified
122
% differs from that in \bibliographystyle.
123
%
124
% With \citeindextrue and \citeindexfalse, one can control whether the
125
% \cite commands make an automatic entry of the citation in the .idx
126
% indexing file. For this, \makeindex must also be given in the preamble.
127
%
128
% Package Options: (for selecting punctuation)
129
% round - round parentheses are used (default)
130
% square - square brackets are used [option]
131
% curly - curly braces are used {option}
132
% angle - angle brackets are used <option>
133
% semicolon - multiple citations separated by semi-colon (default)
134
% colon - same as semicolon, an earlier confusion
135
% comma - separated by comma
136
% authoryear - selects author-year citations (default)
137
% numbers- selects numerical citations
138
% super - numerical citations as superscripts
139
% sort - sorts multiple citations according to order in ref. list
140
% sort&compress - like sort, but also compresses numerical citations
141
% compress - compresses without sorting
142
% longnamesfirst - makes first citation full author list
143
% sectionbib - puts bibliography in a \section* instead of \chapter*
144
% merge - allows the citation key to have a * prefix,
145
% signifying to merge its reference with that of the previous citation.
146
% elide - if references are merged, repeated portions of later ones may be removed.
147
% mcite - recognizes and ignores the * prefix for merging.
148
% Punctuation so selected dominates over any predefined ones.
149
% Package options are called as, e.g.
150
% \usepackage[square,comma]{natbib}
151
% LaTeX the source file natbib.dtx to obtain more details
152
% or the file natnotes.tex for a brief reference sheet.
153
%-----------------------------------------------------------
154
\providecommand\@ifxundefined[1]{%
155
\ifx#1\@undefined\expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi
156
}%
157
\providecommand\@ifnum[1]{%
158
\ifnum#1\expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi
159
}%
160
\providecommand\@ifx[1]{%
161
\ifx#1\expandafter\@firstoftwo\else\expandafter\@secondoftwo\fi
162
}%
163
\providecommand\appdef[2]{%
164
\toks@\expandafter{#1}\@temptokena{#2}%
165
\edef#1{\the\toks@\the\@temptokena}%
166
}%
167
\@ifclassloaded{agu2001}{\PackageError{natbib}
168
{The agu2001 class already includes natbib coding,\MessageBreak
169
so you should not add it explicitly}
170
{Type <Return> for now, but then later remove\MessageBreak
171
the command \protect\usepackage{natbib} from the document}
172
\endinput}{}
173
\@ifclassloaded{agutex}{\PackageError{natbib}
174
{The AGUTeX class already includes natbib coding,\MessageBreak
175
so you should not add it explicitly}
176
{Type <Return> for now, but then later remove\MessageBreak
177
the command \protect\usepackage{natbib} from the document}
178
\endinput}{}
179
\@ifclassloaded{aguplus}{\PackageError{natbib}
180
{The aguplus class already includes natbib coding,\MessageBreak
181
so you should not add it explicitly}
182
{Type <Return> for now, but then later remove\MessageBreak
183
the command \protect\usepackage{natbib} from the document}
184
\endinput}{}
185
\@ifclassloaded{nlinproc}{\PackageError{natbib}
186
{The nlinproc class already includes natbib coding,\MessageBreak
187
so you should not add it explicitly}
188
{Type <Return> for now, but then later remove\MessageBreak
189
the command \protect\usepackage{natbib} from the document}
190
\endinput}{}
191
\@ifclassloaded{egs}{\PackageError{natbib}
192
{The egs class already includes natbib coding,\MessageBreak
193
so you should not add it explicitly}
194
{Type <Return> for now, but then later remove\MessageBreak
195
the command \protect\usepackage{natbib} from the document}
196
\endinput}{}
197
\@ifclassloaded{egu}{\PackageError{natbib}
198
{The egu class already includes natbib coding,\MessageBreak
199
so you should not add it explicitly}
200
{Type <Return> for now, but then later remove\MessageBreak
201
the command \protect\usepackage{natbib} from the document}
202
\endinput}{}
203
% Define citation punctuation for some author-year styles
204
% One may add and delete at this point
205
% Or put additions into local configuration file natbib.cfg
206
\newcommand\bibstyle@chicago{\bibpunct{(}{)}{;}{a}{,}{,}}
207
\newcommand\bibstyle@named{\bibpunct{[}{]}{;}{a}{,}{,}}
208
\newcommand\bibstyle@agu{\bibpunct{[}{]}{;}{a}{,}{,~}}%Amer. Geophys. Union
209
\newcommand\bibstyle@copernicus{\bibpunct{(}{)}{;}{a}{,}{,}}%Copernicus Publications
210
\let\bibstyle@egu=\bibstyle@copernicus
211
\let\bibstyle@egs=\bibstyle@copernicus
212
\newcommand\bibstyle@agsm{\bibpunct{(}{)}{,}{a}{}{,}\gdef\harvardand{\&}}
213
\newcommand\bibstyle@kluwer{\bibpunct{(}{)}{,}{a}{}{,}\gdef\harvardand{\&}}
214
\newcommand\bibstyle@dcu{\bibpunct{(}{)}{;}{a}{;}{,}\gdef\harvardand{and}}
215
\newcommand\bibstyle@aa{\bibpunct{(}{)}{;}{a}{}{,}} %Astronomy & Astrophysics
216
\newcommand\bibstyle@pass{\bibpunct{(}{)}{;}{a}{,}{,}}%Planet. & Space Sci
217
\newcommand\bibstyle@anngeo{\bibpunct{(}{)}{;}{a}{,}{,}}%Annales Geophysicae
218
\newcommand\bibstyle@nlinproc{\bibpunct{(}{)}{;}{a}{,}{,}}%Nonlin.Proc.Geophys.
219
% Define citation punctuation for some numerical styles
220
\newcommand\bibstyle@cospar{\bibpunct{/}{/}{,}{n}{}{}%
221
\gdef\bibnumfmt##1{##1.}}
222
\newcommand\bibstyle@esa{\bibpunct{(Ref.~}{)}{,}{n}{}{}%
223
\gdef\bibnumfmt##1{##1.\hspace{1em}}}
224
\newcommand\bibstyle@nature{\bibpunct{}{}{,}{s}{}{\textsuperscript{,}}%
225
\gdef\bibnumfmt##1{##1.}}
226
% The standard LaTeX styles
227
\newcommand\bibstyle@plain{\bibpunct{[}{]}{,}{n}{}{,}}
228
\let\bibstyle@alpha=\bibstyle@plain
229
\let\bibstyle@abbrv=\bibstyle@plain
230
\let\bibstyle@unsrt=\bibstyle@plain
231
% The author-year modifications of the standard styles
232
\newcommand\bibstyle@plainnat{\bibpunct{[}{]}{,}{a}{,}{,}}
233
\let\bibstyle@abbrvnat=\bibstyle@plainnat
234
\let\bibstyle@unsrtnat=\bibstyle@plainnat
235
\newif\ifNAT@numbers \NAT@numbersfalse
236
\newif\ifNAT@super \NAT@superfalse
237
\let\NAT@merge\z@
238
\DeclareOption{numbers}{\NAT@numberstrue
239
\ExecuteOptions{square,comma,nobibstyle}}
240
\DeclareOption{super}{\NAT@supertrue\NAT@numberstrue
241
\renewcommand\NAT@open{}\renewcommand\NAT@close{}
242
\ExecuteOptions{nobibstyle}}
243
\DeclareOption{authoryear}{\NAT@numbersfalse
244
\ExecuteOptions{round,semicolon,bibstyle}}
245
\DeclareOption{round}{%
246
\renewcommand\NAT@open{(} \renewcommand\NAT@close{)}
247
\ExecuteOptions{nobibstyle}}
248
\DeclareOption{square}{%
249
\renewcommand\NAT@open{[} \renewcommand\NAT@close{]}
250
\ExecuteOptions{nobibstyle}}
251
\DeclareOption{angle}{%
252
\renewcommand\NAT@open{$<$} \renewcommand\NAT@close{$>$}
253
\ExecuteOptions{nobibstyle}}
254
\DeclareOption{curly}{%
255
\renewcommand\NAT@open{\{} \renewcommand\NAT@close{\}}
256
\ExecuteOptions{nobibstyle}}
257
\DeclareOption{comma}{\renewcommand\NAT@sep{,}
258
\ExecuteOptions{nobibstyle}}
259
\DeclareOption{semicolon}{\renewcommand\NAT@sep{;}
260
\ExecuteOptions{nobibstyle}}
261
\DeclareOption{colon}{\ExecuteOptions{semicolon}}
262
\DeclareOption{nobibstyle}{\let\bibstyle=\@gobble}
263
\DeclareOption{bibstyle}{\let\bibstyle=\@citestyle}
264
\newif\ifNAT@openbib \NAT@openbibfalse
265
\DeclareOption{openbib}{\NAT@openbibtrue}
266
\DeclareOption{sectionbib}{\def\NAT@sectionbib{on}}
267
\def\NAT@sort{\z@}
268
\def\NAT@cmprs{\z@}
269
\DeclareOption{sort}{\def\NAT@sort{\@ne}}
270
\DeclareOption{compress}{\def\NAT@cmprs{\@ne}}
271
\DeclareOption{sort&compress}{\def\NAT@sort{\@ne}\def\NAT@cmprs{\@ne}}
272
\DeclareOption{mcite}{\let\NAT@merge\@ne}
273
\DeclareOption{merge}{\@ifnum{\NAT@merge<\tw@}{\let\NAT@merge\tw@}{}}
274
\DeclareOption{elide}{\@ifnum{\NAT@merge<\thr@@}{\let\NAT@merge\thr@@}{}}
275
\@ifpackageloaded{cite}{\PackageWarningNoLine{natbib}
276
{The `cite' package should not be used\MessageBreak
277
with natbib. Use option `sort' instead}\ExecuteOptions{sort}}{}
278
\@ifpackageloaded{mcite}{\PackageWarningNoLine{natbib}
279
{The `mcite' package should not be used\MessageBreak
280
with natbib. Use option `merge' instead}\ExecuteOptions{merge}}{}
281
\@ifpackageloaded{citeref}{\PackageError{natbib}
282
{The `citeref' package must be loaded after natbib}%
283
{Move \protect\usepackage{citeref} to after \string\usepackage{natbib}}}{}
284
\newif\ifNAT@longnames\NAT@longnamesfalse
285
\DeclareOption{longnamesfirst}{\NAT@longnamestrue}
286
\DeclareOption{nonamebreak}{\def\NAT@nmfmt#1{\mbox{\NAT@up#1}}}
287
\def\NAT@nmfmt#1{{\NAT@up#1}}
288
\renewcommand\bibstyle[1]{\csname bibstyle@#1\endcsname}
289
\AtBeginDocument{\global\let\bibstyle=\@gobble}
290
\let\@citestyle\bibstyle
291
\newcommand\citestyle[1]{\@citestyle{#1}\let\bibstyle\@gobble}
292
\newcommand\bibpunct[7][, ]%
293
{\gdef\NAT@open{#2}\gdef\NAT@close{#3}\gdef
294
\NAT@sep{#4}\global\NAT@numbersfalse
295
\ifx #5n\global\NAT@numberstrue\global\NAT@superfalse
296
\else
297
\ifx #5s\global\NAT@numberstrue\global\NAT@supertrue
298
\fi\fi
299
\gdef\NAT@aysep{#6}\gdef\NAT@yrsep{#7}%
300
\gdef\NAT@cmt{#1}%
301
\NAT@@setcites
302
}
303
\newcommand\setcitestyle[1]{
304
\@for\@tempa:=#1\do
305
{\def\@tempb{round}\ifx\@tempa\@tempb
306
\renewcommand\NAT@open{(}\renewcommand\NAT@close{)}\fi
307
\def\@tempb{square}\ifx\@tempa\@tempb
308
\renewcommand\NAT@open{[}\renewcommand\NAT@close{]}\fi
309
\def\@tempb{angle}\ifx\@tempa\@tempb
310
\renewcommand\NAT@open{$<$}\renewcommand\NAT@close{$>$}\fi
311
\def\@tempb{curly}\ifx\@tempa\@tempb
312
\renewcommand\NAT@open{\{}\renewcommand\NAT@close{\}}\fi
313
\def\@tempb{semicolon}\ifx\@tempa\@tempb
314
\renewcommand\NAT@sep{;}\fi
315
\def\@tempb{colon}\ifx\@tempa\@tempb
316
\renewcommand\NAT@sep{;}\fi
317
\def\@tempb{comma}\ifx\@tempa\@tempb
318
\renewcommand\NAT@sep{,}\fi
319
\def\@tempb{authoryear}\ifx\@tempa\@tempb
320
\NAT@numbersfalse\fi
321
\def\@tempb{numbers}\ifx\@tempa\@tempb
322
\NAT@numberstrue\NAT@superfalse\fi
323
\def\@tempb{super}\ifx\@tempa\@tempb
324
\NAT@numberstrue\NAT@supertrue\fi
325
\expandafter\NAT@find@eq\@tempa=\relax\@nil
326
\if\@tempc\relax\else
327
\expandafter\NAT@rem@eq\@tempc
328
\def\@tempb{open}\ifx\@tempa\@tempb
329
\xdef\NAT@open{\@tempc}\fi
330
\def\@tempb{close}\ifx\@tempa\@tempb
331
\xdef\NAT@close{\@tempc}\fi
332
\def\@tempb{aysep}\ifx\@tempa\@tempb
333
\xdef\NAT@aysep{\@tempc}\fi
334
\def\@tempb{yysep}\ifx\@tempa\@tempb
335
\xdef\NAT@yrsep{\@tempc}\fi
336
\def\@tempb{notesep}\ifx\@tempa\@tempb
337
\xdef\NAT@cmt{\@tempc}\fi
338
\def\@tempb{citesep}\ifx\@tempa\@tempb
339
\xdef\NAT@sep{\@tempc}\fi
340
\fi
341
}%
342
\NAT@@setcites
343
}
344
\def\NAT@find@eq#1=#2\@nil{\def\@tempa{#1}\def\@tempc{#2}}
345
\def\NAT@rem@eq#1={\def\@tempc{#1}}
346
\def\NAT@@setcites{\global\let\bibstyle\@gobble}
347
\AtBeginDocument{\let\NAT@@setcites\NAT@set@cites}
348
\newcommand\NAT@open{(} \newcommand\NAT@close{)}
349
\newcommand\NAT@sep{;}
350
\ProcessOptions
351
\newcommand\NAT@aysep{,} \newcommand\NAT@yrsep{,}
352
\newcommand\NAT@cmt{, }
353
\newcommand\NAT@cite%
354
[3]{\ifNAT@swa\NAT@@open\if*#2*\else#2\NAT@spacechar\fi
355
#1\if*#3*\else\NAT@cmt#3\fi\NAT@@close\else#1\fi\endgroup}
356
\newcommand\NAT@citenum%
357
[3]{\ifNAT@swa\NAT@@open\if*#2*\else#2\NAT@spacechar\fi
358
#1\if*#3*\else\NAT@cmt#3\fi\NAT@@close\else#1\fi\endgroup}
359
\newcommand\NAT@citesuper[3]{\ifNAT@swa
360
\if*#2*\else#2\NAT@spacechar\fi
361
\unskip\kern\p@\textsuperscript{\NAT@@open#1\NAT@@close}%
362
\if*#3*\else\NAT@spacechar#3\fi\else #1\fi\endgroup}
363
\providecommand\textsuperscript[1]{\mbox{$^{\mbox{\scriptsize#1}}$}}
364
\begingroup \catcode`\_=8
365
\gdef\NAT@ifcat@num#1{%
366
\ifcat_\ifnum\z@<0#1_\else A\fi
367
\expandafter\@firstoftwo
368
\else
369
\expandafter\@secondoftwo
370
\fi
371
}%
372
\endgroup
373
\providecommand\@firstofone[1]{#1}
374
\newcommand\NAT@citexnum{}
375
\def\NAT@citexnum[#1][#2]#3{%
376
\NAT@reset@parser
377
\NAT@sort@cites{#3}%
378
\NAT@reset@citea
379
\@cite{\def\NAT@num{-1}\let\NAT@last@yr\relax\let\NAT@nm\@empty
380
\@for\@citeb:=\NAT@cite@list\do
381
{\@safe@activestrue
382
\edef\@citeb{\expandafter\@firstofone\@citeb\@empty}%
383
\@safe@activesfalse
384
\@ifundefined{b@\@citeb\@extra@b@citeb}{%
385
{\reset@font\bfseries?}
386
\NAT@citeundefined\PackageWarning{natbib}%
387
{Citation `\@citeb' on page \thepage \space undefined}}%
388
{\let\NAT@last@num\NAT@num\let\NAT@last@nm\NAT@nm
389
\NAT@parse{\@citeb}%
390
\ifNAT@longnames\@ifundefined{bv@\@citeb\@extra@b@citeb}{%
391
\let\NAT@name=\NAT@all@names
392
\global\@namedef{bv@\@citeb\@extra@b@citeb}{}}{}%
393
\fi
394
\ifNAT@full\let\NAT@nm\NAT@all@names\else
395
\let\NAT@nm\NAT@name\fi
396
\ifNAT@swa
397
\@ifnum{\NAT@ctype>\@ne}{%
398
\@citea
399
\NAT@hyper@{\@ifnum{\NAT@ctype=\tw@}{\NAT@test{\NAT@ctype}}{\NAT@alias}}%
400
}{%
401
\@ifnum{\NAT@cmprs>\z@}{%
402
\NAT@ifcat@num\NAT@num
403
{\let\NAT@nm=\NAT@num}%
404
{\def\NAT@nm{-2}}%
405
\NAT@ifcat@num\NAT@last@num
406
{\@tempcnta=\NAT@last@num\relax}%
407
{\@tempcnta\m@ne}%
408
\@ifnum{\NAT@nm=\@tempcnta}{%
409
\@ifnum{\NAT@merge>\@ne}{}{\NAT@last@yr@mbox}%
410
}{%
411
\advance\@tempcnta by\@ne
412
\@ifnum{\NAT@nm=\@tempcnta}{%
413
\ifx\NAT@last@yr\relax
414
\def@NAT@last@yr{\@citea}%
415
\else
416
\def@NAT@last@yr{--\NAT@penalty}%
417
\fi
418
}{%
419
\NAT@last@yr@mbox
420
}%
421
}%
422
}{%
423
\@tempswatrue
424
\@ifnum{\NAT@merge>\@ne}{\@ifnum{\NAT@last@num=\NAT@num\relax}{\@tempswafalse}{}}{}%
425
\if@tempswa\NAT@citea@mbox\fi
426
}%
427
}%
428
\NAT@def@citea
429
\else
430
\ifcase\NAT@ctype
431
\ifx\NAT@last@nm\NAT@nm \NAT@yrsep\NAT@penalty\NAT@space\else
432
\@citea \NAT@test{\@ne}\NAT@spacechar\NAT@mbox{\NAT@super@kern\NAT@@open}%
433
\fi
434
\if*#1*\else#1\NAT@spacechar\fi
435
\NAT@mbox{\NAT@hyper@{{\citenumfont{\NAT@num}}}}%
436
\NAT@def@citea@box
437
\or
438
\NAT@hyper@citea@space{\NAT@test{\NAT@ctype}}%
439
\or
440
\NAT@hyper@citea@space{\NAT@test{\NAT@ctype}}%
441
\or
442
\NAT@hyper@citea@space\NAT@alias
443
\fi
444
\fi
445
}%
446
}%
447
\@ifnum{\NAT@cmprs>\z@}{\NAT@last@yr}{}%
448
\ifNAT@swa\else
449
\@ifnum{\NAT@ctype=\z@}{%
450
\if*#2*\else\NAT@cmt#2\fi
451
}{}%
452
\NAT@mbox{\NAT@@close}%
453
\fi
454
}{#1}{#2}%
455
}%
456
\def\NAT@citea@mbox{%
457
\@citea\mbox{\NAT@hyper@{{\citenumfont{\NAT@num}}}}%
458
}%
459
\def\NAT@hyper@#1{%
460
\hyper@natlinkstart{\@citeb\@extra@b@citeb}#1\hyper@natlinkend
461
}%
462
\def\NAT@hyper@citea#1{%
463
\@citea
464
\NAT@hyper@{#1}%
465
\NAT@def@citea
466
}%
467
\def\NAT@hyper@citea@space#1{%
468
\@citea
469
\NAT@hyper@{#1}%
470
\NAT@def@citea@space
471
}%
472
\def\def@NAT@last@yr#1{%
473
\protected@edef\NAT@last@yr{%
474
#1%
475
\noexpand\mbox{%
476
\noexpand\hyper@natlinkstart{\@citeb\@extra@b@citeb}%
477
{\noexpand\citenumfont{\NAT@num}}%
478
\noexpand\hyper@natlinkend
479
}%
480
}%
481
}%
482
\def\NAT@last@yr@mbox{%
483
\NAT@last@yr\let\NAT@last@yr\relax
484
\NAT@citea@mbox
485
}%
486
\newcommand\NAT@test[1]{%
487
\@ifnum{#1=\@ne}{%
488
\ifx\NAT@nm\NAT@noname
489
\begingroup\reset@font\bfseries(author?)\endgroup
490
\PackageWarning{natbib}{%
491
Author undefined for citation`\@citeb' \MessageBreak on page \thepage%
492
}%
493
\else \NAT@nm
494
\fi
495
}{%
496
\if\relax\NAT@date\relax
497
\begingroup\reset@font\bfseries(year?)\endgroup
498
\PackageWarning{natbib}{%
499
Year undefined for citation`\@citeb' \MessageBreak on page \thepage%
500
}%
501
\else \NAT@date
502
\fi
503
}%
504
}%
505
\let\citenumfont=\@empty
506
\newcommand\NAT@citex{}
507
\def\NAT@citex%
508
[#1][#2]#3{%
509
\NAT@reset@parser
510
\NAT@sort@cites{#3}%
511
\NAT@reset@citea
512
\@cite{\let\NAT@nm\@empty\let\NAT@year\@empty
513
\@for\@citeb:=\NAT@cite@list\do
514
{\@safe@activestrue
515
\edef\@citeb{\expandafter\@firstofone\@citeb\@empty}%
516
\@safe@activesfalse
517
\@ifundefined{b@\@citeb\@extra@b@citeb}{\@citea%
518
{\reset@font\bfseries ?}\NAT@citeundefined
519
\PackageWarning{natbib}%
520
{Citation `\@citeb' on page \thepage \space undefined}\def\NAT@date{}}%
521
{\let\NAT@last@nm=\NAT@nm\let\NAT@last@yr=\NAT@year
522
\NAT@parse{\@citeb}%
523
\ifNAT@longnames\@ifundefined{bv@\@citeb\@extra@b@citeb}{%
524
\let\NAT@name=\NAT@all@names
525
\global\@namedef{bv@\@citeb\@extra@b@citeb}{}}{}%
526
\fi
527
\ifNAT@full\let\NAT@nm\NAT@all@names\else
528
\let\NAT@nm\NAT@name\fi
529
\ifNAT@swa\ifcase\NAT@ctype
530
\if\relax\NAT@date\relax
531
\@citea\NAT@hyper@{\NAT@nmfmt{\NAT@nm}\NAT@date}%
532
\else
533
\ifx\NAT@last@nm\NAT@nm\NAT@yrsep
534
\ifx\NAT@last@yr\NAT@year
535
\def\NAT@temp{{?}}%
536
\ifx\NAT@temp\NAT@exlab\PackageWarningNoLine{natbib}%
537
{Multiple citation on page \thepage: same authors and
538
year\MessageBreak without distinguishing extra
539
letter,\MessageBreak appears as question mark}\fi
540
\NAT@hyper@{\NAT@exlab}%
541
\else\unskip\NAT@spacechar
542
\NAT@hyper@{\NAT@date}%
543
\fi
544
\else
545
\@citea\NAT@hyper@{%
546
\NAT@nmfmt{\NAT@nm}%
547
\hyper@natlinkbreak{%
548
\NAT@aysep\NAT@spacechar}{\@citeb\@extra@b@citeb
549
}%
550
\NAT@date
551
}%
552
\fi
553
\fi
554
\or\@citea\NAT@hyper@{\NAT@nmfmt{\NAT@nm}}%
555
\or\@citea\NAT@hyper@{\NAT@date}%
556
\or\@citea\NAT@hyper@{\NAT@alias}%
557
\fi \NAT@def@citea
558
\else
559
\ifcase\NAT@ctype
560
\if\relax\NAT@date\relax
561
\@citea\NAT@hyper@{\NAT@nmfmt{\NAT@nm}}%
562
\else
563
\ifx\NAT@last@nm\NAT@nm\NAT@yrsep
564
\ifx\NAT@last@yr\NAT@year
565
\def\NAT@temp{{?}}%
566
\ifx\NAT@temp\NAT@exlab\PackageWarningNoLine{natbib}%
567
{Multiple citation on page \thepage: same authors and
568
year\MessageBreak without distinguishing extra
569
letter,\MessageBreak appears as question mark}\fi
570
\NAT@hyper@{\NAT@exlab}%
571
\else
572
\unskip\NAT@spacechar
573
\NAT@hyper@{\NAT@date}%
574
\fi
575
\else
576
\@citea\NAT@hyper@{%
577
\NAT@nmfmt{\NAT@nm}%
578
\hyper@natlinkbreak{\NAT@spacechar\NAT@@open\if*#1*\else#1\NAT@spacechar\fi}%
579
{\@citeb\@extra@b@citeb}%
580
\NAT@date
581
}%
582
\fi
583
\fi
584
\or\@citea\NAT@hyper@{\NAT@nmfmt{\NAT@nm}}%
585
\or\@citea\NAT@hyper@{\NAT@date}%
586
\or\@citea\NAT@hyper@{\NAT@alias}%
587
\fi
588
\if\relax\NAT@date\relax
589
\NAT@def@citea
590
\else
591
\NAT@def@citea@close
592
\fi
593
\fi
594
}}\ifNAT@swa\else\if*#2*\else\NAT@cmt#2\fi
595
\if\relax\NAT@date\relax\else\NAT@@close\fi\fi}{#1}{#2}}
596
\def\NAT@spacechar{\ }%
597
\def\NAT@separator{\NAT@sep\NAT@penalty}%
598
\def\NAT@reset@citea{\c@NAT@ctr\@ne\let\@citea\@empty}%
599
\def\NAT@def@citea{\def\@citea{\NAT@separator\NAT@space}}%
600
\def\NAT@def@citea@space{\def\@citea{\NAT@separator\NAT@spacechar}}%
601
\def\NAT@def@citea@close{\def\@citea{\NAT@@close\NAT@separator\NAT@space}}%
602
\def\NAT@def@citea@box{\def\@citea{\NAT@mbox{\NAT@@close}\NAT@separator\NAT@spacechar}}%
603
\newif\ifNAT@par \NAT@partrue
604
\newcommand\NAT@@open{\ifNAT@par\NAT@open\fi}
605
\newcommand\NAT@@close{\ifNAT@par\NAT@close\fi}
606
\newcommand\NAT@alias{\@ifundefined{al@\@citeb\@extra@b@citeb}{%
607
{\reset@font\bfseries(alias?)}\PackageWarning{natbib}
608
{Alias undefined for citation `\@citeb'
609
\MessageBreak on page \thepage}}{\@nameuse{al@\@citeb\@extra@b@citeb}}}
610
\let\NAT@up\relax
611
\newcommand\NAT@Up[1]{{\let\protect\@unexpandable@protect\let~\relax
612
\expandafter\NAT@deftemp#1}\expandafter\NAT@UP\NAT@temp}
613
\newcommand\NAT@deftemp[1]{\xdef\NAT@temp{#1}}
614
\newcommand\NAT@UP[1]{\let\@tempa\NAT@UP\ifcat a#1\MakeUppercase{#1}%
615
\let\@tempa\relax\else#1\fi\@tempa}
616
\newcommand\shortcites[1]{%
617
\@bsphack\@for\@citeb:=#1\do
618
{\@safe@activestrue
619
\edef\@citeb{\expandafter\@firstofone\@citeb\@empty}%
620
\@safe@activesfalse
621
\global\@namedef{bv@\@citeb\@extra@b@citeb}{}}\@esphack}
622
\newcommand\NAT@biblabel[1]{\hfill}
623
\newcommand\NAT@biblabelnum[1]{\bibnumfmt{#1}}
624
\let\bibnumfmt\@empty
625
\providecommand\@biblabel[1]{[#1]}
626
\AtBeginDocument{\ifx\bibnumfmt\@empty\let\bibnumfmt\@biblabel\fi}
627
\newcommand\NAT@bibsetnum[1]{\settowidth\labelwidth{\@biblabel{#1}}%
628
\setlength{\leftmargin}{\labelwidth}\addtolength{\leftmargin}{\labelsep}%
629
\setlength{\itemsep}{\bibsep}\setlength{\parsep}{\z@}%
630
\ifNAT@openbib
631
\addtolength{\leftmargin}{\bibindent}%
632
\setlength{\itemindent}{-\bibindent}%
633
\setlength{\listparindent}{\itemindent}%
634
\setlength{\parsep}{0pt}%
635
\fi
636
}
637
\newlength{\bibhang}
638
\setlength{\bibhang}{1em}
639
\newlength{\bibsep}
640
{\@listi \global\bibsep\itemsep \global\advance\bibsep by\parsep}
641
642
\newcommand\NAT@bibsetup%
643
[1]{\setlength{\leftmargin}{\bibhang}\setlength{\itemindent}{-\leftmargin}%
644
\setlength{\itemsep}{\bibsep}\setlength{\parsep}{\z@}}
645
\newcommand\NAT@set@cites{%
646
\ifNAT@numbers
647
\ifNAT@super \let\@cite\NAT@citesuper
648
\def\NAT@mbox##1{\unskip\nobreak\textsuperscript{##1}}%
649
\let\citeyearpar=\citeyear
650
\let\NAT@space\relax
651
\def\NAT@super@kern{\kern\p@}%
652
\else
653
\let\NAT@mbox=\mbox
654
\let\@cite\NAT@citenum
655
\let\NAT@space\NAT@spacechar
656
\let\NAT@super@kern\relax
657
\fi
658
\let\@citex\NAT@citexnum
659
\let\@biblabel\NAT@biblabelnum
660
\let\@bibsetup\NAT@bibsetnum
661
\renewcommand\NAT@idxtxt{\NAT@name\NAT@spacechar\NAT@open\NAT@num\NAT@close}%
662
\def\natexlab##1{}%
663
\def\NAT@penalty{\penalty\@m}%
664
\else
665
\let\@cite\NAT@cite
666
\let\@citex\NAT@citex
667
\let\@biblabel\NAT@biblabel
668
\let\@bibsetup\NAT@bibsetup
669
\let\NAT@space\NAT@spacechar
670
\let\NAT@penalty\@empty
671
\renewcommand\NAT@idxtxt{\NAT@name\NAT@spacechar\NAT@open\NAT@date\NAT@close}%
672
\def\natexlab##1{##1}%
673
\fi}
674
\AtBeginDocument{\NAT@set@cites}
675
\AtBeginDocument{\ifx\SK@def\@undefined\else
676
\ifx\SK@cite\@empty\else
677
\SK@def\@citex[#1][#2]#3{\SK@\SK@@ref{#3}\SK@@citex[#1][#2]{#3}}\fi
678
\ifx\SK@citeauthor\@undefined\def\HAR@checkdef{}\else
679
\let\citeauthor\SK@citeauthor
680
\let\citefullauthor\SK@citefullauthor
681
\let\citeyear\SK@citeyear\fi
682
\fi}
683
\newif\ifNAT@full\NAT@fullfalse
684
\newif\ifNAT@swa
685
\DeclareRobustCommand\citet
686
{\begingroup\NAT@swafalse\let\NAT@ctype\z@\NAT@partrue
687
\@ifstar{\NAT@fulltrue\NAT@citetp}{\NAT@fullfalse\NAT@citetp}}
688
\newcommand\NAT@citetp{\@ifnextchar[{\NAT@@citetp}{\NAT@@citetp[]}}
689
\newcommand\NAT@@citetp{}
690
\def\NAT@@citetp[#1]{\@ifnextchar[{\@citex[#1]}{\@citex[][#1]}}
691
\DeclareRobustCommand\citep
692
{\begingroup\NAT@swatrue\let\NAT@ctype\z@\NAT@partrue
693
\@ifstar{\NAT@fulltrue\NAT@citetp}{\NAT@fullfalse\NAT@citetp}}
694
\DeclareRobustCommand\cite
695
{\begingroup\let\NAT@ctype\z@\NAT@partrue\NAT@swatrue
696
\@ifstar{\NAT@fulltrue\NAT@cites}{\NAT@fullfalse\NAT@cites}}
697
\newcommand\NAT@cites{\@ifnextchar [{\NAT@@citetp}{%
698
\ifNAT@numbers\else
699
\NAT@swafalse
700
\fi
701
\NAT@@citetp[]}}
702
\DeclareRobustCommand\citealt
703
{\begingroup\NAT@swafalse\let\NAT@ctype\z@\NAT@parfalse
704
\@ifstar{\NAT@fulltrue\NAT@citetp}{\NAT@fullfalse\NAT@citetp}}
705
\DeclareRobustCommand\citealp
706
{\begingroup\NAT@swatrue\let\NAT@ctype\z@\NAT@parfalse
707
\@ifstar{\NAT@fulltrue\NAT@citetp}{\NAT@fullfalse\NAT@citetp}}
708
\DeclareRobustCommand\citenum
709
{\begingroup
710
\NAT@swatrue\let\NAT@ctype\z@\NAT@parfalse\let\textsuperscript\NAT@spacechar
711
\NAT@citexnum[][]}
712
\DeclareRobustCommand\citeauthor
713
{\begingroup\NAT@swafalse\let\NAT@ctype\@ne\NAT@parfalse
714
\@ifstar{\NAT@fulltrue\NAT@citetp}{\NAT@fullfalse\NAT@citetp}}
715
\DeclareRobustCommand\Citet
716
{\begingroup\NAT@swafalse\let\NAT@ctype\z@\NAT@partrue
717
\let\NAT@up\NAT@Up
718
\@ifstar{\NAT@fulltrue\NAT@citetp}{\NAT@fullfalse\NAT@citetp}}
719
\DeclareRobustCommand\Citep
720
{\begingroup\NAT@swatrue\let\NAT@ctype\z@\NAT@partrue
721
\let\NAT@up\NAT@Up
722
\@ifstar{\NAT@fulltrue\NAT@citetp}{\NAT@fullfalse\NAT@citetp}}
723
\DeclareRobustCommand\Citealt
724
{\begingroup\NAT@swafalse\let\NAT@ctype\z@\NAT@parfalse
725
\let\NAT@up\NAT@Up
726
\@ifstar{\NAT@fulltrue\NAT@citetp}{\NAT@fullfalse\NAT@citetp}}
727
\DeclareRobustCommand\Citealp
728
{\begingroup\NAT@swatrue\let\NAT@ctype\z@\NAT@parfalse
729
\let\NAT@up\NAT@Up
730
\@ifstar{\NAT@fulltrue\NAT@citetp}{\NAT@fullfalse\NAT@citetp}}
731
\DeclareRobustCommand\Citeauthor
732
{\begingroup\NAT@swafalse\let\NAT@ctype\@ne\NAT@parfalse
733
\let\NAT@up\NAT@Up
734
\@ifstar{\NAT@fulltrue\NAT@citetp}{\NAT@fullfalse\NAT@citetp}}
735
\DeclareRobustCommand\citeyear
736
{\begingroup\NAT@swafalse\let\NAT@ctype\tw@\NAT@parfalse\NAT@citetp}
737
\DeclareRobustCommand\citeyearpar
738
{\begingroup\NAT@swatrue\let\NAT@ctype\tw@\NAT@partrue\NAT@citetp}
739
\newcommand\citetext[1]{\NAT@open#1\NAT@close}
740
\DeclareRobustCommand\citefullauthor
741
{\citeauthor*}
742
\newcommand\defcitealias[2]{%
743
\@ifundefined{al@#1\@extra@b@citeb}{}
744
{\PackageWarning{natbib}{Overwriting existing alias for citation #1}}
745
\@namedef{al@#1\@extra@b@citeb}{#2}}
746
\DeclareRobustCommand\citetalias{\begingroup
747
\NAT@swafalse\let\NAT@ctype\thr@@\NAT@parfalse\NAT@citetp}
748
\DeclareRobustCommand\citepalias{\begingroup
749
\NAT@swatrue\let\NAT@ctype\thr@@\NAT@partrue\NAT@citetp}
750
\renewcommand\nocite[1]{\@bsphack
751
\@for\@citeb:=#1\do{%
752
\@safe@activestrue
753
\edef\@citeb{\expandafter\@firstofone\@citeb\@empty}%
754
\@safe@activesfalse
755
\if@filesw\immediate\write\@auxout{\string\citation{\@citeb}}\fi
756
\if*\@citeb\else
757
\@ifundefined{b@\@citeb\@extra@b@citeb}{%
758
\NAT@citeundefined \PackageWarning{natbib}%
759
{Citation `\@citeb' undefined}}{}\fi}%
760
\@esphack}
761
\newcommand\NAT@parse[1]{%
762
\begingroup
763
\let\protect=\@unexpandable@protect
764
\let~\relax
765
\let\active@prefix=\@gobble
766
\edef\NAT@temp{\csname b@#1\@extra@b@citeb\endcsname}%
767
\aftergroup\NAT@split
768
\expandafter
769
\endgroup
770
\NAT@temp{}{}{}{}{}@@%
771
\expandafter\NAT@parse@date\NAT@date??????@@%
772
\ifciteindex\NAT@index\fi
773
}%
774
\def\NAT@split#1#2#3#4#5@@{%
775
\gdef\NAT@num{#1}\gdef\NAT@name{#3}\gdef\NAT@date{#2}%
776
\gdef\NAT@all@names{#4}%
777
\ifx\NAT@num\@empty\gdef\NAT@num{0}\fi
778
\ifx\NAT@noname\NAT@all@names \gdef\NAT@all@names{#3}\fi
779
}%
780
\def\NAT@reset@parser{%
781
\global\let\NAT@num\@empty
782
\global\let\NAT@name\@empty
783
\global\let\NAT@date\@empty
784
\global\let\NAT@all@names\@empty
785
}%
786
\newcommand\NAT@parse@date{}
787
\def\NAT@parse@date#1#2#3#4#5#6@@{%
788
\ifnum\the\catcode`#1=11\def\NAT@year{}\def\NAT@exlab{#1}\else
789
\ifnum\the\catcode`#2=11\def\NAT@year{#1}\def\NAT@exlab{#2}\else
790
\ifnum\the\catcode`#3=11\def\NAT@year{#1#2}\def\NAT@exlab{#3}\else
791
\ifnum\the\catcode`#4=11\def\NAT@year{#1#2#3}\def\NAT@exlab{#4}\else
792
\def\NAT@year{#1#2#3#4}\def\NAT@exlab{{#5}}\fi\fi\fi\fi}
793
\newcommand\NAT@index{}
794
\let\NAT@makeindex=\makeindex
795
\renewcommand\makeindex{\NAT@makeindex
796
\renewcommand\NAT@index{\@bsphack\begingroup
797
\def~{\string~}\@wrindex{\NAT@idxtxt}}}
798
\newcommand\NAT@idxtxt{\NAT@name\NAT@spacechar\NAT@open\NAT@date\NAT@close}
799
\@ifxundefined\@indexfile{}{\let\NAT@makeindex\relax\makeindex}
800
\newif\ifciteindex \citeindexfalse
801
\newcommand\citeindextype{default}
802
\newcommand\NAT@index@alt{{\let\protect=\noexpand\let~\relax
803
\xdef\NAT@temp{\NAT@idxtxt}}\expandafter\NAT@exp\NAT@temp\@nil}
804
\newcommand\NAT@exp{}
805
\def\NAT@exp#1\@nil{\index[\citeindextype]{#1}}
806
807
\AtBeginDocument{%
808
\@ifpackageloaded{index}{\let\NAT@index=\NAT@index@alt}{}}
809
\newcommand\NAT@ifcmd{\futurelet\NAT@temp\NAT@ifxcmd}
810
\newcommand\NAT@ifxcmd{\ifx\NAT@temp\relax\else\expandafter\NAT@bare\fi}
811
\def\NAT@bare#1(#2)#3(@)#4\@nil#5{%
812
\if @#2
813
\expandafter\NAT@apalk#1, , \@nil{#5}%
814
\else
815
\NAT@wrout{\the\c@NAT@ctr}{#2}{#1}{#3}{#5}%
816
\fi
817
}
818
\newcommand\NAT@wrout[5]{%
819
\if@filesw
820
{\let\protect\noexpand\let~\relax
821
\immediate
822
\write\@auxout{\string\bibcite{#5}{{#1}{#2}{{#3}}{{#4}}}}}\fi
823
\ignorespaces}
824
\def\NAT@noname{{}}
825
\renewcommand\bibitem{\@ifnextchar[{\@lbibitem}{\@lbibitem[]}}%
826
\let\NAT@bibitem@first@sw\@secondoftwo
827
\def\@lbibitem[#1]#2{%
828
\if\relax\@extra@b@citeb\relax\else
829
\@ifundefined{br@#2\@extra@b@citeb}{}{%
830
\@namedef{br@#2}{\@nameuse{br@#2\@extra@b@citeb}}%
831
}%
832
\fi
833
\@ifundefined{b@#2\@extra@b@citeb}{%
834
\def\NAT@num{}%
835
}{%
836
\NAT@parse{#2}%
837
}%
838
\def\NAT@tmp{#1}%
839
\expandafter\let\expandafter\bibitemOpen\csname NAT@b@open@#2\endcsname
840
\expandafter\let\expandafter\bibitemShut\csname NAT@b@shut@#2\endcsname
841
\@ifnum{\NAT@merge>\@ne}{%
842
\NAT@bibitem@first@sw{%
843
\@firstoftwo
844
}{%
845
\@ifundefined{NAT@b*@#2}{%
846
\@firstoftwo
847
}{%
848
\expandafter\def\expandafter\NAT@num\expandafter{\the\c@NAT@ctr}%
849
\@secondoftwo
850
}%
851
}%
852
}{%
853
\@firstoftwo
854
}%
855
{%
856
\global\advance\c@NAT@ctr\@ne
857
\@ifx{\NAT@tmp\@empty}{\@firstoftwo}{%
858
\@secondoftwo
859
}%
860
{%
861
\expandafter\def\expandafter\NAT@num\expandafter{\the\c@NAT@ctr}%
862
\global\NAT@stdbsttrue
863
}{}%
864
\bibitem@fin
865
\item[\hfil\NAT@anchor{#2}{\NAT@num}]%
866
\global\let\NAT@bibitem@first@sw\@secondoftwo
867
\NAT@bibitem@init
868
}%
869
{%
870
\NAT@anchor{#2}{}%
871
\NAT@bibitem@cont
872
\bibitem@fin
873
}%
874
\@ifx{\NAT@tmp\@empty}{%
875
\NAT@wrout{\the\c@NAT@ctr}{}{}{}{#2}%
876
}{%
877
\expandafter\NAT@ifcmd\NAT@tmp(@)(@)\@nil{#2}%
878
}%
879
}%
880
\def\bibitem@fin{%
881
\@ifxundefined\@bibstop{}{\csname bibitem@\@bibstop\endcsname}%
882
}%
883
\def\NAT@bibitem@init{%
884
\let\@bibstop\@undefined
885
}%
886
\def\NAT@bibitem@cont{%
887
\let\bibitem@Stop\bibitemStop
888
\let\bibitem@NoStop\bibitemContinue
889
}%
890
\def\BibitemOpen{%
891
\bibitemOpen
892
}%
893
\def\BibitemShut#1{%
894
\bibitemShut
895
\def\@bibstop{#1}%
896
\let\bibitem@Stop\bibitemStop
897
\let\bibitem@NoStop\bibitemNoStop
898
}%
899
\def\bibitemStop{}%
900
\def\bibitemNoStop{.\spacefactor\@mmm\space}%
901
\def\bibitemContinue{\spacefactor\@mmm\space}%
902
\mathchardef\@mmm=3000 %
903
\providecommand{\bibAnnote}[3]{%
904
\BibitemShut{#1}%
905
\def\@tempa{#3}\@ifx{\@tempa\@empty}{}{%
906
\begin{quotation}\noindent
907
\textsc{Key:}\ #2\\\textsc{Annotation:}\ \@tempa
908
\end{quotation}%
909
}%
910
}%
911
\providecommand{\bibAnnoteFile}[2]{%
912
\IfFileExists{#2}{%
913
\bibAnnote{#1}{#2}{\input{#2}}%
914
}{%
915
\bibAnnote{#1}{#2}{}%
916
}%
917
}%
918
\let\bibitemOpen\relax
919
\let\bibitemShut\relax
920
\def\bibfield{\@ifnum{\NAT@merge>\tw@}{\@bibfield}{\@secondoftwo}}%
921
\def\@bibfield#1#2{%
922
\begingroup
923
\let\Doi\@gobble
924
\let\bibinfo\relax
925
\let\restore@protect\@empty
926
\protected@edef\@tempa{#2}%
927
\aftergroup\def\aftergroup\@tempa
928
\expandafter\endgroup\expandafter{\@tempa}%
929
\expandafter\@ifx\expandafter{\csname @bib#1\endcsname\@tempa}{%
930
\expandafter\let\expandafter\@tempa\csname @bib@X#1\endcsname
931
}{%
932
\expandafter\let\csname @bib#1\endcsname\@tempa
933
\expandafter\let\expandafter\@tempa\csname @bib@Y#1\endcsname
934
}%
935
\@ifx{\@tempa\relax}{\let\@tempa\@firstofone}{}%
936
\@tempa{#2}%
937
}%
938
\def\bibinfo#1{%
939
\expandafter\let\expandafter\@tempa\csname bibinfo@X@#1\endcsname
940
\@ifx{\@tempa\relax}{\@firstofone}{\@tempa}%
941
}%
942
\def\@bib@Xauthor#1{\let\@bib@Xjournal\@gobble}%
943
\def\@bib@Xjournal#1{\begingroup\let\bibinfo@X@journal\@bib@Z@journal#1\endgroup}%
944
\def\@bibibid@#1{\textit{ibid}.}%
945
\appdef\NAT@bibitem@init{%
946
\let\@bibauthor \@empty
947
\let\@bibjournal \@empty
948
\let\@bib@Z@journal\@bibibid@
949
}%
950
\ifx\SK@lbibitem\@undefined\else
951
\let\SK@lbibitem\@lbibitem
952
\def\@lbibitem[#1]#2{%
953
\SK@lbibitem[#1]{#2}\SK@\SK@@label{#2}\ignorespaces}\fi
954
\newif\ifNAT@stdbst \NAT@stdbstfalse
955
956
\AtEndDocument{%
957
\ifNAT@stdbst\if@filesw
958
\immediate\write\@auxout{%
959
\string\providecommand\string\NAT@force@numbers{}%
960
\string\NAT@force@numbers
961
}%
962
\fi\fi
963
}
964
\newcommand\NAT@force@numbers{%
965
\ifNAT@numbers\else
966
\PackageError{natbib}{Bibliography not compatible with author-year
967
citations.\MessageBreak
968
Press <return> to continue in numerical citation style}
969
{Check the bibliography entries for non-compliant syntax,\MessageBreak
970
or select author-year BibTeX style, e.g. plainnat}%
971
\global\NAT@numberstrue\fi}
972
973
\providecommand\bibcite{}
974
\renewcommand\bibcite[2]{%
975
\@ifundefined{b@#1\@extra@binfo}{\relax}{%
976
\NAT@citemultiple
977
\PackageWarningNoLine{natbib}{Citation `#1' multiply defined}%
978
}%
979
\global\@namedef{b@#1\@extra@binfo}{#2}%
980
}%
981
\AtEndDocument{\NAT@swatrue\let\bibcite\NAT@testdef}
982
\newcommand\NAT@testdef[2]{%
983
\def\NAT@temp{#2}%
984
\expandafter \ifx \csname b@#1\@extra@binfo\endcsname\NAT@temp
985
\else
986
\ifNAT@swa \NAT@swafalse
987
\PackageWarningNoLine{natbib}{%
988
Citation(s) may have changed.\MessageBreak
989
Rerun to get citations correct%
990
}%
991
\fi
992
\fi
993
}%
994
\newcommand\NAT@apalk{}
995
\def\NAT@apalk#1, #2, #3\@nil#4{%
996
\if\relax#2\relax
997
\global\NAT@stdbsttrue
998
\NAT@wrout{#1}{}{}{}{#4}%
999
\else
1000
\NAT@wrout{\the\c@NAT@ctr}{#2}{#1}{}{#4}%
1001
\fi
1002
}%
1003
\newcommand\citeauthoryear{}
1004
\def\citeauthoryear#1#2#3(@)(@)\@nil#4{%
1005
\if\relax#3\relax
1006
\NAT@wrout{\the\c@NAT@ctr}{#2}{#1}{}{#4}%
1007
\else
1008
\NAT@wrout{\the\c@NAT@ctr}{#3}{#2}{#1}{#4}%
1009
\fi
1010
}%
1011
\newcommand\citestarts{\NAT@open}%
1012
\newcommand\citeends{\NAT@close}%
1013
\newcommand\betweenauthors{and}%
1014
\newcommand\astroncite{}
1015
\def\astroncite#1#2(@)(@)\@nil#3{%
1016
\NAT@wrout{\the\c@NAT@ctr}{#2}{#1}{}{#3}%
1017
}%
1018
\newcommand\citename{}
1019
\def\citename#1#2(@)(@)\@nil#3{\expandafter\NAT@apalk#1#2, \@nil{#3}}
1020
\newcommand\harvarditem[4][]{%
1021
\if\relax#1\relax
1022
\bibitem[#2(#3)]{#4}%
1023
\else
1024
\bibitem[#1(#3)#2]{#4}%
1025
\fi
1026
}%
1027
\newcommand\harvardleft{\NAT@open}
1028
\newcommand\harvardright{\NAT@close}
1029
\newcommand\harvardyearleft{\NAT@open}
1030
\newcommand\harvardyearright{\NAT@close}
1031
\AtBeginDocument{\providecommand{\harvardand}{and}}
1032
\newcommand\harvardurl[1]{\textbf{URL:} \textit{#1}}
1033
\providecommand\bibsection{}
1034
\@ifundefined{chapter}{%
1035
\renewcommand\bibsection{%
1036
\section*{\refname\@mkboth{\MakeUppercase{\refname}}{\MakeUppercase{\refname}}}%
1037
}%
1038
}{%
1039
\@ifxundefined\NAT@sectionbib{%
1040
\renewcommand\bibsection{%
1041
\chapter*{\bibname\@mkboth{\MakeUppercase{\bibname}}{\MakeUppercase{\bibname}}}%
1042
}%
1043
}{%
1044
\renewcommand\bibsection{%
1045
\section*{\bibname\ifx\@mkboth\@gobbletwo\else\markright{\MakeUppercase{\bibname}}\fi}%
1046
}%
1047
}%
1048
}%
1049
\@ifclassloaded{amsart}{\renewcommand\bibsection{\section*{\refname}}}{}%
1050
\@ifclassloaded{amsbook}{\renewcommand\bibsection{\chapter*{\bibname}}}{}%
1051
\@ifxundefined\bib@heading{}{\let\bibsection\bib@heading}%
1052
\newcounter{NAT@ctr}
1053
\renewenvironment{thebibliography}[1]{%
1054
\bibsection
1055
\parindent\z@
1056
\bibpreamble
1057
\bibfont
1058
\list{\@biblabel{\the\c@NAT@ctr}}{\@bibsetup{#1}\global\c@NAT@ctr\z@}%
1059
\ifNAT@openbib
1060
\renewcommand\newblock{\par}%
1061
\else
1062
\renewcommand\newblock{\hskip .11em \@plus.33em \@minus.07em}%
1063
\fi
1064
\sloppy\clubpenalty4000\widowpenalty4000
1065
\sfcode`\.\@m
1066
\let\NAT@bibitem@first@sw\@firstoftwo
1067
\let\citeN\cite \let\shortcite\cite
1068
\let\citeasnoun\cite
1069
}{%
1070
\bibitem@fin
1071
\bibpostamble
1072
\def\@noitemerr{%
1073
\PackageWarning{natbib}{Empty `thebibliography' environment}%
1074
}%
1075
\endlist
1076
\bibcleanup
1077
}%
1078
\let\bibfont\@empty
1079
\let\bibpreamble\@empty
1080
\let\bibpostamble\@empty
1081
\def\bibcleanup{\vskip-\lastskip}%
1082
\providecommand\reset@font{\relax}
1083
\providecommand\bibname{Bibliography}
1084
\providecommand\refname{References}
1085
\newcommand\NAT@citeundefined{\gdef \NAT@undefined {%
1086
\PackageWarningNoLine{natbib}{There were undefined citations}}}
1087
\let \NAT@undefined \relax
1088
\newcommand\NAT@citemultiple{\gdef \NAT@multiple {%
1089
\PackageWarningNoLine{natbib}{There were multiply defined citations}}}
1090
\let \NAT@multiple \relax
1091
\AtEndDocument{\NAT@undefined\NAT@multiple}
1092
\providecommand\@mkboth[2]{}
1093
\providecommand\MakeUppercase{\uppercase}
1094
\providecommand{\@extra@b@citeb}{}
1095
\gdef\@extra@binfo{}
1096
\def\NAT@anchor#1#2{%
1097
\hyper@natanchorstart{#1\@extra@b@citeb}%
1098
\def\@tempa{#2}\@ifx{\@tempa\@empty}{}{\@biblabel{#2}}%
1099
\hyper@natanchorend
1100
}%
1101
\providecommand\hyper@natanchorstart[1]{}%
1102
\providecommand\hyper@natanchorend{}%
1103
\providecommand\hyper@natlinkstart[1]{}%
1104
\providecommand\hyper@natlinkend{}%
1105
\providecommand\hyper@natlinkbreak[2]{#1}%
1106
\AtBeginDocument{%
1107
\@ifpackageloaded{babel}{%
1108
\let\org@@citex\@citex}{}}
1109
\providecommand\@safe@activestrue{}%
1110
\providecommand\@safe@activesfalse{}%
1111
1112
\newcommand\NAT@sort@cites[1]{%
1113
\let\NAT@cite@list\@empty
1114
\@for\@citeb:=#1\do{\expandafter\NAT@star@cite\@citeb\@@}%
1115
\if@filesw
1116
\expandafter\immediate\expandafter\write\expandafter\@auxout
1117
\expandafter{\expandafter\string\expandafter\citation\expandafter{\NAT@cite@list}}%
1118
\fi
1119
\@ifnum{\NAT@sort>\z@}{%
1120
\expandafter\NAT@sort@cites@\expandafter{\NAT@cite@list}%
1121
}{}%
1122
}%
1123
\def\NAT@star@cite{%
1124
\let\NAT@star@sw\@secondoftwo
1125
\@ifnum{\NAT@merge>\z@}{%
1126
\@ifnextchar*{%
1127
\let\NAT@star@sw\@firstoftwo
1128
\NAT@star@cite@star
1129
}{%
1130
\NAT@star@cite@nostar
1131
}%
1132
}{%
1133
\NAT@star@cite@noextension
1134
}%
1135
}%
1136
\def\NAT@star@cite@star*{%
1137
\NAT@star@cite@nostar
1138
}%
1139
\def\NAT@star@cite@nostar{%
1140
\let\nat@keyopt@open\@empty
1141
\let\nat@keyopt@shut\@empty
1142
\@ifnextchar[{\NAT@star@cite@pre}{\NAT@star@cite@pre[]}%
1143
}%
1144
\def\NAT@star@cite@pre[#1]{%
1145
\def\nat@keyopt@open{#1}%
1146
\@ifnextchar[{\NAT@star@cite@post}{\NAT@star@cite@post[]}%
1147
}%
1148
\def\NAT@star@cite@post[#1]#2\@@{%
1149
\def\nat@keyopt@shut{#1}%
1150
\NAT@star@sw{\expandafter\global\expandafter\let\csname NAT@b*@#2\endcsname\@empty}{}%
1151
\NAT@cite@list@append{#2}%
1152
}%
1153
\def\NAT@star@cite@noextension#1\@@{%
1154
\let\nat@keyopt@open\@empty
1155
\let\nat@keyopt@shut\@empty
1156
\NAT@cite@list@append{#1}%
1157
}%
1158
\def\NAT@cite@list@append#1{%
1159
\edef\@citeb{\@firstofone#1\@empty}%
1160
\if@filesw\@ifxundefined\@cprwrite{}{\expandafter\@cprwrite\@citeb=}\fi
1161
\if\relax\nat@keyopt@open\relax\else
1162
\global\expandafter\let\csname NAT@b@open@\@citeb\endcsname\nat@keyopt@open
1163
\fi
1164
\if\relax\nat@keyopt@shut\relax\else
1165
\global\expandafter\let\csname NAT@b@shut@\@citeb\endcsname\nat@keyopt@shut
1166
\fi
1167
\toks@\expandafter{\NAT@cite@list}%
1168
\ifx\NAT@cite@list\@empty
1169
\@temptokena\expandafter{\@citeb}%
1170
\else
1171
\@temptokena\expandafter{\expandafter,\@citeb}%
1172
\fi
1173
\edef\NAT@cite@list{\the\toks@\the\@temptokena}%
1174
}%
1175
\newcommand\NAT@sort@cites@[1]{%
1176
\count@\z@
1177
\@tempcntb\m@ne
1178
\let\@celt\delimiter
1179
\def\NAT@num@list{}%
1180
\let\NAT@cite@list\@empty
1181
\let\NAT@nonsort@list\@empty
1182
\@for \@citeb:=#1\do{\NAT@make@cite@list}%
1183
\ifx\NAT@nonsort@list\@empty\else
1184
\protected@edef\NAT@cite@list{\NAT@cite@list\NAT@nonsort@list}%
1185
\fi
1186
\ifx\NAT@cite@list\@empty\else
1187
\protected@edef\NAT@cite@list{\expandafter\NAT@xcom\NAT@cite@list @@}%
1188
\fi
1189
}%
1190
\def\NAT@make@cite@list{%
1191
\advance\count@\@ne
1192
\@safe@activestrue
1193
\edef\@citeb{\expandafter\@firstofone\@citeb\@empty}%
1194
\@safe@activesfalse
1195
\@ifundefined{b@\@citeb\@extra@b@citeb}%
1196
{\def\NAT@num{A}}%
1197
{\NAT@parse{\@citeb}}%
1198
\NAT@ifcat@num\NAT@num
1199
{\@tempcnta\NAT@num \relax
1200
\@ifnum{\@tempcnta<\@tempcntb}{%
1201
\let\NAT@@cite@list=\NAT@cite@list
1202
\let\NAT@cite@list\@empty
1203
\begingroup\let\@celt=\NAT@celt\NAT@num@list\endgroup
1204
\protected@edef\NAT@num@list{%
1205
\expandafter\NAT@num@celt \NAT@num@list \@gobble @%
1206
}%
1207
}{%
1208
\protected@edef\NAT@num@list{\NAT@num@list \@celt{\NAT@num}}%
1209
\protected@edef\NAT@cite@list{\NAT@cite@list\@citeb,}%
1210
\@tempcntb\@tempcnta
1211
}%
1212
}%
1213
{\protected@edef\NAT@nonsort@list{\NAT@nonsort@list\@citeb,}}%
1214
}%
1215
\def\NAT@celt#1{%
1216
\@ifnum{#1>\@tempcnta}{%
1217
\xdef\NAT@cite@list{\NAT@cite@list\@citeb,\NAT@@cite@list}%
1218
\let\@celt\@gobble
1219
}{%
1220
\expandafter\def@NAT@cite@lists\NAT@@cite@list\@@
1221
}%
1222
}%
1223
\def\NAT@num@celt#1#2{%
1224
\ifx#1\@celt
1225
\@ifnum{#2>\@tempcnta}{%
1226
\@celt{\number\@tempcnta}%
1227
\@celt{#2}%
1228
}{%
1229
\@celt{#2}%
1230
\expandafter\NAT@num@celt
1231
}%
1232
\fi
1233
}%
1234
\def\def@NAT@cite@lists#1,#2\@@{%
1235
\xdef\NAT@cite@list{\NAT@cite@list#1,}%
1236
\xdef\NAT@@cite@list{#2}%
1237
}%
1238
\def\NAT@nextc#1,#2@@{#1,}
1239
\def\NAT@restc#1,#2{#2}
1240
\def\NAT@xcom#1,@@{#1}
1241
\InputIfFileExists{natbib.cfg}
1242
{\typeout{Local config file natbib.cfg used}}{}
1243
%%
1244
%% <<<<< End of generated file <<<<<<
1245
%%
1246
%% End of file `natbib.sty'.
1247
1248