Contact Us!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
sagemathinc

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.

GitHub Repository: sagemathinc/cocalc-example-files
Path: blob/master/RMarkdown/rticles/rss_article/natbib.sty
Views: 1114
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
%% Full documentation can be obtained by LaTeXing the source file:
10
%% natbib.dtx.
11
%%
12
%% Only a few abbreviated comments remain here to describe the usage.
13
%%
14
\NeedsTeXFormat{LaTeX2e}[1994/06/01]
15
\ProvidesPackage{natbib}
16
[1998/02/19 6.8 (PWD)]
17
%%-------------------------------------------------------------------
18
%% NOTICE:
19
%% This file may be used for non-profit purposes.
20
%% It may not be distributed in exchange for money,
21
%% other than distribution costs.
22
%%
23
%% The author provides it `as is' and does not guarantee it in any way.
24
%%
25
%% Natbib coding copyright (C) 1994--1998 Patrick W. Daly
26
%% Max-Planck-Institut f\"ur Aeronomie
27
%% Max-Planck-Str. 2
28
%% D-37191 Katlenburg-Lindau
29
%% Germany
30
%%
31
%% E-mail: daly@linmpi.mpg.de
32
%%-----------------------------------------------------------
33
% This package reimplements the LaTeX \cite command to be used for various
34
% citation styles, both author-year and numerical. It accepts BibTeX
35
% output intended for many other packages, and therefore acts as a
36
% general, all-purpose citation-style interface.
37
%
38
% With standard numerical .bst files, only numerical citations are
39
% possible. With an author-year .bst file, both numerical and
40
% author-year citations are possible.
41
%
42
% If author-year citations are selected, \bibitem must have one of the
43
% following forms:
44
% \bibitem[Jones et al.(1990)]{key}...
45
% \bibitem[Jones et al.(1990)Jones, Baker, and Williams]{key}...
46
% \bibitem[Jones et al., 1990]{key}...
47
% \bibitem[\protect\citeauthoryear{Jones, Baker, and Williams}{Jones
48
% et al.}{1990}]{key}...
49
% \bibitem[\protect\citeauthoryear{Jones et al.}{1990}]{key}...
50
% \bibitem[\protect\astroncite{Jones et al.}{1990}]{key}...
51
% \bibitem[\protect\citename{Jones et al., }1990]{key}...
52
% \harvarditem[Jones et al.]{Jones, Baker, and Williams}{1990}{key}...
53
%
54
% This is either to be made up manually, or to be generated by an
55
% appropriate .bst file with BibTeX.
56
% Author-year mode || Numerical mode
57
% Then, \citet{key} ==>> Jones et al. (1990) || Jones et al. [21]
58
% \citep{key} ==>> (Jones et al., 1990) || [21]
59
% Multiple citations as normal:
60
% \citep{key1,key2} ==>> (Jones et al., 1990; Smith, 1989) || [21,24]
61
% or (Jones et al., 1990, 1991) || [21,24]
62
% or (Jones et al., 1990a,b) || [21,24]
63
% \cite{key} is the equivalent of \citet{key} in author-year mode
64
% and of \citep{key} in numerical mode
65
% Full author lists may be forced with \citet* or \citep*, e.g.
66
% \citep*{key} ==>> (Jones, Baker, and Williams, 1990)
67
% Optional notes as:
68
% \citep[chap. 2]{key} ==>> (Jones et al., 1990, chap. 2)
69
% \citep[e.g.,][]{key} ==>> (e.g., Jones et al., 1990)
70
% \citep[see][pg. 34]{key}==>> (see Jones et al., 1990, pg. 34)
71
% (Note: in standard LaTeX, only one note is allowed, after the ref.
72
% Here, one note is like the standard, two make pre- and post-notes.)
73
% \citealt{key} ==>> Jones et al. 1990
74
% \citealt*{key} ==>> Jones, Baker, and Williams 1990
75
% \citealp{key} ==>> Jones et al., 1990
76
% \citealp*{key} ==>> Jones, Baker, and Williams, 1990
77
% Additional citation possibilities (both author-year and numerical modes)
78
% \citeauthor{key} ==>> Jones et al.
79
% \citeauthor*{key} ==>> Jones, Baker, and Williams
80
% \citeyear{key} ==>> 1990
81
% \citeyearpar{key} ==>> (1990)
82
% \citetext{priv. comm.} ==>> (priv. comm.)
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
% Defining the citation style of a given bib style:
87
% Use \bibpunct (in the preamble only) with 6 mandatory arguments:
88
% 1. opening bracket for citation
89
% 2. closing bracket
90
% 3. citation separator (for multiple citations in one \cite)
91
% 4. the letter n for numerical styles, s for superscripts
92
% else anything for author-year
93
% 5. punctuation between authors and date
94
% 6. punctuation between years (or numbers) when common authors missing
95
% One optional argument is the character coming before post-notes. It
96
% appears in square braces before all other arguments. May be left off.
97
% Example (and default) \bibpunct[,]{(}{)}{;}{a}{,}{,}
98
%
99
% To make this automatic for a given bib style, named newbib, say, make
100
% a local configuration file, natbib.cfg, with the definition
101
% \newcommand{\bibstyle@newbib}{\bibpunct...}
102
% Then the \bibliographystyle{newbib} will cause \bibstyle@newbib to
103
% be called on THE NEXT LATEX RUN (via the aux file).
104
%
105
% Such preprogrammed definitions may be invoked in the text (preamble only)
106
% by calling \citestyle{newbib}. This is only useful if the style specified
107
% differs from that in \bibliographystyle.
108
%
109
% With \citeindextrue and \citeindexfalse, one can control whether the
110
% \cite commands make an automatic entry of the citation in the .idx
111
% indexing file. For this, \makeindex must also be given in the preamble.
112
%
113
% LaTeX2e Options: (for selecting punctuation)
114
% round - round parentheses are used (default)
115
% square - square brackets are used [option]
116
% curly - curly braces are used {option}
117
% angle - angle brackets are used <option>
118
% colon - multiple citations separated by colon (default)
119
% comma - separated by comma
120
% authoryear - selects author-year citations (default)
121
% numbers- selects numerical citations
122
% super - numerical citations as superscripts
123
% sort - sorts multiple citations according to order in ref. list
124
% sort&compress - like sort, but also compresses numerical citations
125
% longnamesfirst - makes first citation full author list
126
% sectionbib - puts bibliography in a \section* instead of \chapter*
127
% Punctuation so selected dominates over any predefined ones.
128
% LaTeX2e options are called as, e.g.
129
% \usepackage[square,comma]{natbib}
130
% LaTeX the source file natbib.dtx to obtain more details
131
% or the file natnotes.tex for a brief reference sheet.
132
%-----------------------------------------------------------
133
\@ifclassloaded{aguplus}{\PackageError{natbib}
134
{The aguplus class already includes natbib coding,\MessageBreak
135
so you should not add it explicitly}
136
{Type <Return> for now, but then later remove\MessageBreak
137
the command \protect\usepackage{natbib} from the document}
138
\endinput}{}
139
\@ifclassloaded{nlinproc}{\PackageError{natbib}
140
{The nlinproc class already includes natbib coding,\MessageBreak
141
so you should not add it explicitly}
142
{Type <Return> for now, but then later remove\MessageBreak
143
the command \protect\usepackage{natbib} from the document}
144
\endinput}{}
145
\@ifclassloaded{egs}{\PackageError{natbib}
146
{The egs class already includes natbib coding,\MessageBreak
147
so you should not add it explicitly}
148
{Type <Return> for now, but then later remove\MessageBreak
149
the command \protect\usepackage{natbib} from the document}
150
\endinput}{}
151
% Define citation punctuation for some author-year styles
152
% One may add and delete at this point
153
% Or put additions into local configuration file natbib.cfg
154
\newcommand\bibstyle@chicago{\bibpunct{(}{)}{;}{a}{,}{,}}
155
\newcommand\bibstyle@named{\bibpunct{[}{]}{;}{a}{,}{,}}
156
\newcommand\bibstyle@agu{\bibpunct{[}{]}{;}{a}{,}{,~}}%Amer. Geophys. Union
157
\newcommand\bibstyle@egs{\bibpunct{(}{)}{;}{a}{,}{,}}%Eur. Geophys. Soc.
158
\newcommand\bibstyle@agsm{\bibpunct{(}{)}{,}{a}{}{,}\gdef\harvardand{\&}}
159
\newcommand\bibstyle@kluwer{\bibpunct{(}{)}{,}{a}{}{,}\gdef\harvardand{\&}}
160
\newcommand\bibstyle@dcu{\bibpunct{(}{)}{;}{a}{;}{,}\gdef\harvardand{and}}
161
\newcommand\bibstyle@aa{\bibpunct{(}{)}{;}{a}{}{,}} %Astronomy & Astrophysics
162
\newcommand\bibstyle@pass{\bibpunct{(}{)}{;}{a}{,}{,}}%Planet. & Space Sci
163
\newcommand\bibstyle@anngeo{\bibpunct{(}{)}{;}{a}{,}{,}}%Annales Geophysicae
164
\newcommand\bibstyle@nlinproc{\bibpunct{(}{)}{;}{a}{,}{,}}%Nonlin.Proc.Geophys.
165
% Define citation punctuation for some numerical styles
166
\newcommand\bibstyle@cospar{\bibpunct{/}{/}{,}{n}{}{}%
167
\gdef\NAT@biblabelnum##1{##1.}}
168
\newcommand\bibstyle@esa{\bibpunct{(}{)}{,}{n}{}{}%
169
\gdef\NAT@biblabelnum##1{##1.\hspace{1em}}%
170
\gdef\NAT@citenum##1##2##3{\NAT@@open \if\relax##2\relax\else
171
##2\ \fi Ref.~##1\if\relax##3\relax\else\NAT@cmt\
172
##3\fi\NAT@@close\endgroup}}
173
\newcommand\bibstyle@nature{\bibpunct{}{}{,}{s}{}{\textsuperscript{,}}%
174
\gdef\NAT@biblabelnum##1{##1.}}
175
% The standard LaTeX styles
176
\newcommand\bibstyle@plain{\bibpunct{[}{]}{,}{n}{}{,}}
177
\let\bibstyle@alpha=\bibstyle@plain
178
\let\bibstyle@abbrv=\bibstyle@plain
179
\let\bibstyle@unsrt=\bibstyle@plain
180
% The author-year modifications of the standard styles
181
\newcommand\bibstyle@plainnat{\bibpunct{[}{]}{,}{a}{,}{,}}
182
\let\bibstyle@abbrvnat=\bibstyle@plainnat
183
\let\bibstyle@unsrtnat=\bibstyle@plainnat
184
\newif\ifNAT@numbers \NAT@numbersfalse
185
\newif\ifNAT@super \NAT@superfalse
186
\DeclareOption{numbers}{\NAT@numberstrue
187
\ExecuteOptions{square,comma,nobibstyle}}
188
\DeclareOption{super}{\NAT@supertrue\NAT@numberstrue
189
\ExecuteOptions{nobibstyle}}
190
\DeclareOption{authoryear}{\NAT@numbersfalse
191
\ExecuteOptions{round,colon,bibstyle}}
192
\DeclareOption{round}{%
193
\renewcommand\NAT@open{(} \renewcommand\NAT@close{)}
194
\ExecuteOptions{nobibstyle}}
195
\DeclareOption{square}{%
196
\renewcommand\NAT@open{[} \renewcommand\NAT@close{]}
197
\ExecuteOptions{nobibstyle}}
198
\DeclareOption{angle}{%
199
\renewcommand\NAT@open{$<$} \renewcommand\NAT@close{$>$}
200
\ExecuteOptions{nobibstyle}}
201
\DeclareOption{curly}{%
202
\renewcommand\NAT@open{\{} \renewcommand\NAT@close{\}}
203
\ExecuteOptions{nobibstyle}}
204
\DeclareOption{comma}{\renewcommand\NAT@sep{,}
205
\ExecuteOptions{nobibstyle}}
206
\DeclareOption{colon}{\renewcommand\NAT@sep{;}
207
\ExecuteOptions{nobibstyle}}
208
\DeclareOption{nobibstyle}{\let\bibstyle=\@gobble}
209
\DeclareOption{bibstyle}{\let\bibstyle=\@citestyle}
210
\newif\ifNAT@openbib \NAT@openbibfalse
211
\DeclareOption{openbib}{\NAT@openbibtrue}
212
\DeclareOption{sectionbib}{\def\NAT@sectionbib{on}}
213
\def\NAT@sort{0}
214
\DeclareOption{sort}{\def\NAT@sort{1}}
215
\DeclareOption{sort&compress}{\def\NAT@sort{2}}
216
\@ifpackageloaded{cite}{\PackageWarningNoLine{natbib}
217
{The `cite' package should not be used\MessageBreak
218
with natbib. Use option `sort' instead}\ExecuteOptions{sort}}{}
219
\newif\ifNAT@longnames\NAT@longnamesfalse
220
\DeclareOption{longnamesfirst}{\NAT@longnamestrue}
221
\renewcommand\bibstyle[1]{\@ifundefined{bibstyle@#1}{\relax}
222
{\csname bibstyle@#1\endcsname}}
223
\AtBeginDocument{\global\let\bibstyle=\@gobble}
224
\let\@citestyle\bibstyle
225
\newcommand\citestyle[1]{\@citestyle{#1}\let\bibstyle\@gobble}
226
\@onlypreamble{\citestyle}\@onlypreamble{\@citestyle}
227
\newcommand\bibpunct[7][,]%
228
{\gdef\NAT@open{#2}\gdef\NAT@close{#3}\gdef
229
\NAT@sep{#4}\global\NAT@numbersfalse\ifx #5n\global\NAT@numberstrue
230
\else
231
\ifx #5s\global\NAT@numberstrue\global\NAT@supertrue
232
\fi\fi
233
\gdef\NAT@aysep{#6}\gdef\NAT@yrsep{#7}%
234
\gdef\NAT@cmt{#1}%
235
\global\let\bibstyle\@gobble
236
}
237
\@onlypreamble{\bibpunct}
238
\newcommand\NAT@open{(} \newcommand\NAT@close{)}
239
\newcommand\NAT@sep{;}
240
\ProcessOptions
241
\newcommand\NAT@aysep{,} \newcommand\NAT@yrsep{,}
242
\newcommand\NAT@cmt{,}
243
\newcommand\NAT@cite%
244
[3]{\ifNAT@swa\NAT@@open\if\relax#2\relax\else#2\ \fi
245
#1\if\relax#3\relax\else\NAT@cmt\ #3\fi\NAT@@close\else#1\fi\endgroup}
246
\newcommand\NAT@citenum%
247
[3]{\ifNAT@swa\NAT@@open\if\relax#2\relax\else#2\ \fi
248
#1\if\relax#3\relax\else\NAT@cmt\ #3\fi\NAT@@close\else#1\fi\endgroup}
249
\newcommand\NAT@citesuper[3]{\ifNAT@swa
250
\unskip\hspace{1\p@}\textsuperscript{#1}%
251
\if\relax#3\relax\else\ (#3)\fi\else #1\fi\endgroup}
252
\providecommand
253
\textsuperscript[1]{\mbox{$^{\mbox{\scriptsize#1}}$}}
254
\providecommand\@firstofone[1]{#1}
255
\newcommand\NAT@citexnum{}
256
\def\NAT@citexnum[#1][#2]#3{%
257
\NAT@sort@cites{#3}%
258
\let\@citea\@empty
259
\@cite{\def\NAT@num{-1}\let\NAT@last@yr\relax\let\NAT@nm\@empty
260
\@for\@citeb:=\NAT@cite@list\do
261
{\edef\@citeb{\expandafter\@firstofone\@citeb}%
262
\if@filesw\immediate\write\@auxout{\string\citation{\@citeb}}\fi
263
\@ifundefined{b@\@citeb\@extra@b@citeb}{%
264
{\reset@font\bfseries?}
265
\NAT@citeundefined\PackageWarning{natbib}%
266
{Citation `\@citeb' on page \thepage \space undefined}}%
267
{\let\NAT@last@num\NAT@num\let\NAT@last@nm\NAT@nm
268
\NAT@parse{\@citeb}%
269
\ifNAT@longnames\@ifundefined{bv@\@citeb\@extra@b@citeb}{%
270
\let\NAT@name=\NAT@all@names
271
\global\@namedef{bv@\@citeb\@extra@b@citeb}{}}{}%
272
\fi
273
\ifNAT@full\let\NAT@nm\NAT@all@names\else
274
\let\NAT@nm\NAT@name\fi
275
\ifNAT@swa
276
\ifnum\NAT@ctype=2\relax\@citea
277
\hyper@natlinkstart{\@citeb}\NAT@test{2}\hyper@natlinkend\else
278
\ifnum\NAT@sort>1
279
\begingroup\catcode`\_=8
280
\ifcat _\ifnum\z@<0\NAT@num _\else A\fi
281
\global\let\NAT@nm=\NAT@num \else \gdef\NAT@nm{-2}\fi
282
\ifcat _\ifnum\z@<0\NAT@last@num _\else A\fi
283
\global\@tempcnta=\NAT@last@num \global\advance\@tempcnta by\@ne
284
\else \global\@tempcnta\m@ne\fi
285
\endgroup
286
\ifnum\NAT@nm=\@tempcnta
287
\ifx\NAT@last@yr\relax
288
\edef\NAT@last@yr{\@citea \mbox{\NAT@num}}%
289
\else
290
\edef\NAT@last@yr{--\penalty\@m\mbox{\NAT@num}}%
291
\fi
292
\else
293
\NAT@last@yr \@citea \mbox{\NAT@num}%
294
\let\NAT@last@yr\relax
295
\fi
296
\else
297
\@citea \mbox{\hyper@natlinkstart{\@citeb}\NAT@num
298
\hyper@natlinkend}%
299
\fi
300
\fi
301
\def\@citea{\NAT@sep\penalty\@m\NAT@space}%
302
\else
303
\ifcase\NAT@ctype\relax
304
\ifx\NAT@last@nm\NAT@nm \NAT@yrsep\penalty\@m\NAT@space\else
305
\@citea \NAT@test{1}\ \NAT@@open
306
\if\relax#1\relax\else#1\ \fi\fi \NAT@mbox{%
307
\hyper@natlinkstart{\@citeb}\NAT@num\hyper@natlinkend}%
308
\def\@citea{\NAT@@close\NAT@sep\penalty\@m\ }%
309
\or\@citea
310
\hyper@natlinkstart{\@citeb}\NAT@test{1}\hyper@natlinkend
311
\def\@citea{\NAT@sep\penalty\@m\ }%
312
\or\@citea
313
\hyper@natlinkstart{\@citeb}\NAT@test{2}\hyper@natlinkend
314
\def\@citea{\NAT@sep\penalty\@m\ }%
315
\fi
316
\fi
317
}}%
318
\ifnum\NAT@sort>1\NAT@last@yr\fi
319
\ifNAT@swa\else\ifnum\NAT@ctype=0\if\relax#2\relax\else
320
\NAT@cmt\ #2\fi \NAT@@close\fi\fi}{#1}{#2}}
321
\newcommand\NAT@test[1]{\ifnum#1=1 \ifx\NAT@nm\NAT@noname
322
{\reset@font\bfseries(author?)}\PackageWarning{natbib}
323
{Author undefined for citation`\@citeb'
324
\MessageBreak
325
on page \thepage}\else \NAT@nm \fi
326
\else \if\relax\NAT@date\relax
327
{\reset@font\bfseries(year?)}\PackageWarning{natbib}
328
{Year undefined for citation`\@citeb'
329
\MessageBreak
330
on page \thepage}\else \NAT@date \fi \fi}
331
\newcommand\NAT@citex{}
332
\def\NAT@citex%
333
[#1][#2]#3{%
334
\NAT@sort@cites{#3}%
335
\let\@citea\@empty
336
\@cite{\let\NAT@nm\@empty\let\NAT@year\@empty
337
\@for\@citeb:=\NAT@cite@list\do
338
{\edef\@citeb{\expandafter\@firstofone\@citeb}%
339
\if@filesw\immediate\write\@auxout{\string\citation{\@citeb}}\fi
340
\@ifundefined{b@\@citeb\@extra@b@citeb}{\@citea%
341
{\reset@font\bfseries ?}\NAT@citeundefined
342
\PackageWarning{natbib}%
343
{Citation `\@citeb' on page \thepage \space undefined}}%
344
{\let\NAT@last@nm=\NAT@nm\let\NAT@last@yr=\NAT@year
345
\NAT@parse{\@citeb}%
346
\ifNAT@longnames\@ifundefined{bv@\@citeb\@extra@b@citeb}{%
347
\let\NAT@name=\NAT@all@names
348
\global\@namedef{bv@\@citeb\@extra@b@citeb}{}}{}%
349
\fi
350
\ifNAT@full\let\NAT@nm\NAT@all@names\else
351
\let\NAT@nm\NAT@name\fi
352
\ifNAT@swa\ifcase\NAT@ctype
353
\ifx\NAT@last@nm\NAT@nm\NAT@yrsep
354
\ifx\NAT@last@yr\NAT@year
355
\hyper@natlinkstart{\@citeb}\NAT@exlab\hyper@natlinkend
356
\else\unskip\
357
\hyper@natlinkstart{\@citeb}\NAT@date\hyper@natlinkend
358
\fi
359
\else\@citea\hyper@natlinkstart{\@citeb}{\NAT@nm}\NAT@aysep
360
\ \NAT@date\hyper@natlinkend \fi
361
\or\@citea\hyper@natlinkstart{\@citeb}%
362
{\NAT@nm}\hyper@natlinkend
363
\or\@citea\hyper@natlinkstart{\@citeb}%
364
\NAT@date\hyper@natlinkend\fi \def\@citea{\NAT@sep\ }%
365
\else\ifcase\NAT@ctype
366
\ifx\NAT@last@nm\NAT@nm\NAT@yrsep
367
\ifx\NAT@last@yr\NAT@year
368
\hyper@natlinkstart{\@citeb}\NAT@exlab\hyper@natlinkend
369
\else\unskip\
370
\hyper@natlinkstart{\@citeb}\NAT@date\hyper@natlinkend
371
\fi
372
\else\@citea\hyper@natlinkstart{\@citeb}%
373
{\NAT@nm}\ \NAT@@open\if\relax#1\relax\else#1\ \fi
374
\NAT@date\hyper@natlinkend\fi
375
\or\@citea\hyper@natlinkstart{\@citeb}%
376
{\NAT@nm}\hyper@natlinkend
377
\or\@citea\hyper@natlinkstart{\@citeb}%
378
\NAT@date\hyper@natlinkend\fi \def\@citea{\NAT@@close\NAT@sep\ }%
379
\fi
380
}}\ifNAT@swa\else\if\relax#2\relax\else\NAT@cmt\ #2\fi
381
\NAT@@close\fi}{#1}{#2}}
382
\newif\ifNAT@par \NAT@partrue
383
\newcommand\NAT@@open{\ifNAT@par\NAT@open\fi}
384
\newcommand\NAT@@close{\ifNAT@par\NAT@close\fi}
385
\newcommand\shortcites[1]{%
386
\@bsphack\@for\@citeb:=#1\do
387
{\edef\@citeb{\expandafter\@firstofone\@citeb}%
388
\global\@namedef{bv@\@citeb\@extra@b@citeb}{}}\@esphack}
389
\newcommand\NAT@biblabel[1]{\hfill}
390
\newcommand\NAT@biblabelnum[1]{[#1]}
391
\def\@tempa#1{[#1]}
392
\ifx\@tempa\@biblabel\let\@biblabel\@empty\fi
393
\newcommand\NAT@bibsetnum[1]{\settowidth\labelwidth{\@biblabel{#1}}%
394
\setlength{\leftmargin}{\labelwidth}\addtolength{\leftmargin}{\labelsep}%
395
\setlength{\itemsep}{\bibsep}\setlength{\parsep}{\z@}%
396
\ifNAT@openbib
397
\addtolength{\leftmargin}{\bibindent}%
398
\setlength{\itemindent}{-\bibindent}%
399
\setlength{\listparindent}{\itemindent}%
400
\setlength{\parsep}{0pt}%
401
\fi
402
}
403
\newlength{\bibhang}
404
\setlength{\bibhang}{1em}
405
\newlength{\bibsep}
406
{\@listi \global\bibsep\itemsep \global\advance\bibsep by\parsep}
407
408
\newcommand\NAT@bibsetup%
409
[1]{\setlength{\leftmargin}{\bibhang}\setlength{\itemindent}{-\leftmargin}%
410
\setlength{\itemsep}{\bibsep}\setlength{\parsep}{\z@}}
411
\newcommand\NAT@set@cites{\ifNAT@numbers
412
\ifNAT@super \let\@cite\NAT@citesuper
413
\def\NAT@mbox##1{\unskip\nobreak\hspace{1\p@}\textsuperscript{##1}}%
414
\let\citeyearpar=\citeyear
415
\let\NAT@space\relax\else
416
\let\NAT@mbox=\mbox
417
\let\@cite\NAT@citenum \def\NAT@space{ }\fi
418
\let\@citex\NAT@citexnum
419
\ifx\@biblabel\@empty\let\@biblabel\NAT@biblabelnum\fi
420
\let\@bibsetup\NAT@bibsetnum
421
\def\natexlab##1{}%
422
\else
423
\let\@cite\NAT@cite
424
\let\@citex\NAT@citex
425
\ifx\@biblabel\@empty\let\@biblabel\NAT@biblabel\fi
426
\let\@bibsetup\NAT@bibsetup
427
\def\natexlab##1{##1}%
428
\fi}
429
\AtBeginDocument{\NAT@set@cites}
430
\AtBeginDocument{\ifx\SK@def\@undefined\else
431
\ifx\SK@cite\@empty\else
432
\SK@def\@citex[#1][#2]#3{\SK@\SK@@ref{#3}\SK@@citex[#1][#2]{#3}}\fi
433
\ifx\SK@citeauthor\@undefined\def\HAR@checkdef{}\else
434
\let\citeauthor\SK@citeauthor
435
\let\citefullauthor\SK@citefullauthor
436
\let\citeyear\SK@citeyear\fi
437
\fi}
438
\AtBeginDocument{\@ifpackageloaded{hyperref}{%
439
\ifnum\NAT@sort=2\def\NAT@sort{1}\fi}{}}
440
\newif\ifNAT@full\NAT@fullfalse
441
\newif\ifNAT@swa
442
\DeclareRobustCommand\citet
443
{\begingroup\NAT@swafalse\def\NAT@ctype{0}\NAT@partrue
444
\@ifstar{\NAT@fulltrue\NAT@citetp}{\NAT@fullfalse\NAT@citetp}}
445
\newcommand\NAT@citetp{\@ifnextchar[{\NAT@@citetp}{\NAT@@citetp[]}}
446
\newcommand\NAT@@citetp{}
447
\def\NAT@@citetp[#1]{\@ifnextchar[{\@citex[#1]}{\@citex[][#1]}}
448
\DeclareRobustCommand\citep
449
{\begingroup\NAT@swatrue\def\NAT@ctype{0}\NAT@partrue
450
\@ifstar{\NAT@fulltrue\NAT@citetp}{\NAT@fullfalse\NAT@citetp}}
451
\DeclareRobustCommand\cite
452
{\begingroup\def\NAT@ctype{0}\NAT@partrue\NAT@swatrue
453
\@ifstar{\NAT@fulltrue\NAT@cites}{\NAT@fullfalse\NAT@cites}}
454
\newcommand\NAT@cites{\@ifnextchar [{\NAT@@citetp}{%
455
\ifNAT@numbers\else
456
\NAT@swafalse
457
\fi
458
\NAT@@citetp[]}}
459
\DeclareRobustCommand\citealt
460
{\begingroup\NAT@swafalse\def\NAT@ctype{0}\NAT@parfalse
461
\@ifstar{\NAT@fulltrue\NAT@citetp}{\NAT@fullfalse\NAT@citetp}}
462
\DeclareRobustCommand\citealp
463
{\begingroup\NAT@swatrue\def\NAT@ctype{0}\NAT@parfalse
464
\@ifstar{\NAT@fulltrue\NAT@citetp}{\NAT@fullfalse\NAT@citetp}}
465
\DeclareRobustCommand\citeauthor
466
{\begingroup\NAT@swafalse\def\NAT@ctype{1}\NAT@parfalse
467
\@ifstar{\NAT@fulltrue\NAT@citetp}{\NAT@fullfalse\NAT@citetp}}
468
\DeclareRobustCommand\citeyear
469
{\begingroup\NAT@swafalse\def\NAT@ctype{2}\NAT@parfalse\NAT@citetp}
470
\DeclareRobustCommand\citeyearpar
471
{\begingroup\NAT@swatrue\def\NAT@ctype{2}\NAT@partrue\NAT@citetp}
472
\newcommand\citetext[1]{\NAT@open#1\NAT@close}
473
\DeclareRobustCommand\citefullauthor
474
{\citeauthor*}
475
\renewcommand\nocite[1]{\@bsphack
476
\@for\@citeb:=#1\do{%
477
\edef\@citeb{\expandafter\@firstofone\@citeb}%
478
\if@filesw\immediate\write\@auxout{\string\citation{\@citeb}}\fi
479
\if*\@citeb\else
480
\@ifundefined{b@\@citeb\@extra@b@citeb}{%
481
\NAT@citeundefined \PackageWarning{natbib}%
482
{Citation `\@citeb' undefined}}{}\fi}%
483
\@esphack}
484
\newcommand\NAT@parse[1]{{%
485
\let\protect=\@unexpandable@protect\let~\relax
486
\let\active@prefix=\@gobble
487
\xdef\NAT@temp{\csname b@#1\@extra@b@citeb\endcsname}}%
488
\expandafter\NAT@split\NAT@temp
489
\expandafter\NAT@parse@date\NAT@date??????@@%
490
\ifciteindex\NAT@index\fi
491
}
492
\newcommand\NAT@split[4]{%
493
\gdef\NAT@num{#1}\gdef\NAT@name{#3}\gdef\NAT@date{#2}%
494
\gdef\NAT@all@names{#4}%
495
\ifx\NAT@noname\NAT@all@names \gdef\NAT@all@names{#3}\fi}
496
\newcommand\NAT@parse@date{}
497
\def\NAT@parse@date#1#2#3#4#5#6@@{%
498
\ifnum\the\catcode`#1=11\def\NAT@year{}\def\NAT@exlab{#1}\else
499
\ifnum\the\catcode`#2=11\def\NAT@year{#1}\def\NAT@exlab{#2}\else
500
\ifnum\the\catcode`#3=11\def\NAT@year{#1#2}\def\NAT@exlab{#3}\else
501
\ifnum\the\catcode`#4=11\def\NAT@year{#1#2#3}\def\NAT@exlab{#4}\else
502
\def\NAT@year{#1#2#3#4}\def\NAT@exlab{{#5}}\fi\fi\fi\fi}
503
\newcommand\NAT@index{}
504
\let\NAT@makeindex=\makeindex
505
\renewcommand\makeindex{\NAT@makeindex
506
\renewcommand\NAT@index{\@bsphack\begingroup
507
\def~{\string~}\@wrindex{\NAT@idxtxt}}}
508
\newcommand\NAT@idxtxt{\NAT@name\ \NAT@open\NAT@date\NAT@close}
509
\newif\ifciteindex \citeindexfalse
510
\newcommand\citeindextype{default}
511
\newcommand\NAT@index@alt{{\let\protect=\noexpand\let~\relax
512
\xdef\NAT@temp{\NAT@idxtxt}}\expandafter\NAT@exp\NAT@temp\@nil}
513
\newcommand\NAT@exp{}
514
\def\NAT@exp#1\@nil{\index[\citeindextype]{#1}}
515
516
\AtBeginDocument{%
517
\@ifpackageloaded{index}{\let\NAT@index=\NAT@index@alt}{}}
518
\newcommand\NAT@ifcmd{\futurelet\NAT@temp\NAT@ifxcmd}
519
\newcommand\NAT@ifxcmd{\ifx\NAT@temp\relax\else\expandafter\NAT@bare\fi}
520
\def\NAT@bare#1(#2)#3()#4\@nil#5{%
521
\if\relax#2\relax
522
\expandafter\NAT@apalk#1, , \@nil{#5}\else
523
\stepcounter{NAT@ctr}%
524
\NAT@wrout{\arabic {NAT@ctr}}{#2}{#1}{#3}{#5}
525
\fi
526
}
527
\newcommand\NAT@wrout[5]{%
528
\if@filesw
529
{\let\protect\noexpand\let~\relax
530
\immediate
531
\write\@auxout{\string\bibcite{#5}{{#1}{#2}{{#3}}{{#4}}}}}\fi
532
\ignorespaces}
533
\def\NAT@noname{{}}
534
\renewcommand\bibitem{%
535
\@ifnextchar[{\@lbibitem}{%
536
\global\NAT@stdbsttrue
537
\stepcounter{NAT@ctr}\@lbibitem[\arabic{NAT@ctr}]}}
538
\def\@lbibitem[#1]#2{%
539
\@ifundefined{b@#2\@extra@b@citeb}{\def\NAT@num{}}{\NAT@parse{#2}}%
540
\item[\hfil\hyper@natanchorstart{#2}\@biblabel{\NAT@num}%
541
\hyper@natanchorend]%
542
\NAT@ifcmd#1()()\@nil{#2}}
543
\ifx\SK@lbibitem\@undefined\else
544
\let\SK@lbibitem\@lbibitem
545
\def\@lbibitem[#1]#2{%
546
\SK@lbibitem[#1]{#2}\SK@\SK@@label{#2}\ignorespaces}\fi
547
\newif\ifNAT@stdbst \NAT@stdbstfalse
548
549
\AtEndDocument
550
{\ifNAT@stdbst\if@filesw\immediate\write\@auxout{\string
551
\global\string\NAT@numberstrue}\fi\fi
552
}
553
\providecommand\bibcite{}
554
\renewcommand\bibcite[2]{\@ifundefined{b@#1\@extra@binfo}\relax
555
{\NAT@citemultiple
556
\PackageWarningNoLine{natbib}{Citation `#1' multiply defined}}%
557
\global\@namedef{b@#1\@extra@binfo}{#2}}
558
\AtEndDocument{\NAT@swatrue\renewcommand\bibcite[2]%
559
{\NAT@testdef{#1}{#2}}}
560
\newcommand\NAT@testdef[2]{%
561
\def\NAT@temp{#2}\expandafter \ifx \csname b@#1\@extra@binfo\endcsname
562
\NAT@temp \else \ifNAT@swa \NAT@swafalse
563
\PackageWarningNoLine{natbib}{Citation(s) may have
564
changed.\MessageBreak
565
Rerun to get citations correct}\fi\fi}
566
\newcommand\NAT@apalk{}
567
\def\NAT@apalk#1, #2, #3\@nil#4{\if\relax#2\relax
568
\global\NAT@stdbsttrue
569
\NAT@wrout{#1}{}{}{}{#4}\else
570
\stepcounter{NAT@ctr}%
571
\NAT@wrout{\arabic {NAT@ctr}}{#2}{#1}{}{#4}\fi}
572
\newcommand\citeauthoryear{}
573
\def\citeauthoryear#1#2#3()()\@nil#4{\stepcounter{NAT@ctr}\if\relax#3\relax
574
\NAT@wrout{\arabic {NAT@ctr}}{#2}{#1}{}{#4}\else
575
\NAT@wrout{\arabic {NAT@ctr}}{#3}{#2}{#1}{#4}\fi}
576
\newcommand\citestarts{\NAT@open}
577
\newcommand\citeends{\NAT@close}
578
\newcommand\betweenauthors{and}
579
\newcommand\astroncite{}
580
\def\astroncite#1#2()()\@nil#3{\stepcounter{NAT@ctr}\NAT@wrout{\arabic
581
{NAT@ctr}}{#2}{#1}{}{#3}}
582
\newcommand\citename{}
583
\def\citename#1#2()()\@nil#3{\expandafter\NAT@apalk#1#2, \@nil{#3}}
584
\newcommand\harvarditem[4][]%
585
{\if\relax#1\relax\bibitem[#2(#3)]{#4}\else
586
\bibitem[#1(#3)#2]{#4}\fi }
587
\newcommand\harvardleft{\NAT@open}
588
\newcommand\harvardright{\NAT@close}
589
\newcommand\harvardyearleft{\NAT@open}
590
\newcommand\harvardyearright{\NAT@close}
591
\AtBeginDocument{\providecommand{\harvardand}{and}}
592
\newcommand\harvardurl[1]{\textbf{URL:} \textit{#1}}
593
\providecommand\bibsection{}
594
\@ifundefined{chapter}%
595
{\renewcommand\bibsection{\section*{\refname
596
\@mkboth{\MakeUppercase{\refname}}{\MakeUppercase{\refname}}}}}
597
{\@ifundefined{NAT@sectionbib}%
598
{\renewcommand\bibsection{\chapter*{\bibname
599
\@mkboth{\MakeUppercase{\bibname}}{\MakeUppercase{\bibname}}}}}
600
{\renewcommand\bibsection{\section*{\bibname
601
\ifx\@mkboth\@gobbletwo\else\markright{\MakeUppercase{\bibname}}\fi}}}}
602
\@ifclassloaded{amsart}%
603
{\renewcommand\bibsection{\section*{\refname}}{}}{}
604
\@ifclassloaded{amsbook}%
605
{\renewcommand\bibsection{\section*{\bibname}}{}}{}
606
\@ifundefined{bib@heading}{}{\let\bibsection\bib@heading}
607
\newcounter{NAT@ctr}
608
\renewenvironment{thebibliography}[1]{%
609
\bibfont\bibsection\parindent \z@\list
610
{\@biblabel{\arabic{NAT@ctr}}}{\@bibsetup{#1}%
611
\setcounter{NAT@ctr}{0}}%
612
\ifNAT@openbib
613
\renewcommand\newblock{\par}
614
\else
615
\renewcommand\newblock{\hskip .11em \@plus.33em \@minus.07em}%
616
\fi
617
\sloppy\clubpenalty4000\widowpenalty4000
618
\sfcode`\.=1000\relax
619
\let\citeN\cite \let\shortcite\cite
620
\let\citeasnoun\cite
621
}{\def\@noitemerr{%
622
\PackageWarning{natbib}
623
{Empty `thebibliography' environment}}%
624
\endlist\vskip-\lastskip}
625
\let\bibfont=\relax
626
\providecommand\reset@font{\relax}
627
\providecommand\bibname{Bibliography}
628
\providecommand\refname{References}
629
\newcommand\NAT@citeundefined{\gdef \NAT@undefined {%
630
\PackageWarningNoLine{natbib}{There were undefined citations}}}
631
\let \NAT@undefined \relax
632
\newcommand\NAT@citemultiple{\gdef \NAT@multiple {%
633
\PackageWarningNoLine{natbib}{There were multiply defined citations}}}
634
\let \NAT@multiple \relax
635
\AtEndDocument{\NAT@undefined\NAT@multiple}
636
\providecommand\@mkboth[2]{}
637
\providecommand\MakeUppercase{\uppercase}
638
\providecommand{\@extra@b@citeb}{}
639
\gdef\@extra@binfo{}
640
\providecommand\hyper@natanchorstart[1]{}
641
\providecommand\hyper@natanchorend{}
642
\providecommand\hyper@natlinkstart[1]{}
643
\providecommand\hyper@natlinkend{}
644
\@ifpackageloaded{babel}{\PackageWarningNoLine{natbib}{%
645
If you use both babel and natbib\MessageBreak
646
then load babel AFTER natbib}}{}
647
\AtBeginDocument{\@ifpackageloaded{babel}{%
648
\bbl@redefine\@citex[#1][#2]#3{%
649
\@safe@activestrue\org@@citex[#1][#2]{#3}\@safe@activesfalse}%
650
}{}}
651
\ifnum\NAT@sort>0
652
\newcommand\NAT@sort@cites[1]{%
653
\@tempcntb\m@ne
654
\let\@celt\delimiter
655
\def\NAT@num@list{}%
656
\def\NAT@cite@list{}%
657
\def\NAT@nonsort@list{}%
658
\@for \@citeb:=#1\do{\NAT@make@cite@list}%
659
\edef\NAT@cite@list{\NAT@cite@list\NAT@nonsort@list}%
660
\edef\NAT@cite@list{\expandafter\NAT@xcom\NAT@cite@list @@}}
661
\begingroup \catcode`\_=8
662
\gdef\NAT@make@cite@list{%
663
\edef\@citeb{\expandafter\@firstofone\@citeb}%
664
\@ifundefined{b@\@citeb\@extra@b@citeb}{\def\NAT@num{A}}%
665
{\NAT@parse{\@citeb}}%
666
\ifcat _\ifnum\z@<0\NAT@num _\else A\fi
667
\@tempcnta\NAT@num \relax
668
\ifnum \@tempcnta>\@tempcntb
669
\edef\NAT@num@list{\NAT@num@list \@celt{\NAT@num}}%
670
\edef\NAT@cite@list{\NAT@cite@list\@citeb,}%
671
\@tempcntb\@tempcnta
672
\else
673
\let\NAT@@cite@list=\NAT@cite@list \def\NAT@cite@list{}%
674
\edef\NAT@num@list{\expandafter\NAT@num@celt \NAT@num@list \@gobble @}%
675
{\let\@celt=\NAT@celt\NAT@num@list}%
676
\fi
677
\else
678
\edef\NAT@nonsort@list{\NAT@nonsort@list\@citeb,}%
679
\fi}
680
\endgroup
681
\def\NAT@celt#1{\ifnum #1<\@tempcnta
682
\xdef\NAT@cite@list{\NAT@cite@list\expandafter\NAT@nextc\NAT@@cite@list @@}%
683
\xdef\NAT@@cite@list{\expandafter\NAT@restc\NAT@@cite@list}%
684
\else
685
\xdef\NAT@cite@list{\NAT@cite@list\@citeb,\NAT@@cite@list}\let\@celt\@gobble%
686
\fi}
687
\def\NAT@num@celt#1#2{\ifx \@celt #1%
688
\ifnum #2<\@tempcnta
689
\@celt{#2}%
690
\expandafter\expandafter\expandafter\NAT@num@celt
691
\else
692
\@celt{\number\@tempcnta}\@celt{#2}%
693
\fi\fi}
694
\def\NAT@nextc#1,#2@@{#1,}
695
\def\NAT@restc#1,#2{#2}
696
\def\NAT@xcom#1,@@{#1}
697
\else
698
\newcommand\NAT@sort@cites[1]{\edef\NAT@cite@list{#1}}\fi
699
\InputIfFileExists{natbib.cfg}
700
{\typeout{Local config file natbib.cfg used}}{}
701
%%
702
%% <<<<< End of decommented file <<<<<<
703
%%
704
%% End of file `natbib.sty'.
705
706