Advertisement
gonmedare

Untitled

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