Plan 9 from Bell Labs’s /usr/web/sources/contrib/steve/root/sys/lib/texmf/tex/latex/misc/natbib.sty

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


%%
%% This is file `natbib.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% natbib.dtx  (with options: `package,all')
%% 
%% Only a few abbreviated comments remain here to describe the usage.
%% 
\NeedsTeXFormat{LaTeX2e}[1994/06/01]
\ProvidesPackage{natbib}
        [1997/02/05 6.5 (PWD)]
%%-------------------------------------------------------------------
%% NOTICE:
%% This file may be used for non-profit purposes.
%% It may not be distributed in exchange for money,
%%   other than distribution costs.
%%
%% The author provides it `as is' and does not guarantee it in any way.
%%
%% Natbib coding copyright (C) 1994--1997 Patrick W. Daly
%% Max-Planck-Institut f\"ur Aeronomie
%% Postfach 20
%% D-37189 Katlenburg-Lindau
%% Germany
%%
%% E-mail:
%% Internet-- [email protected]
%%-----------------------------------------------------------
 % This package reimplements the LaTeX \cite command to be used for various
 % citation styles, both author-year and numerical. It accepts BibTeX
 % output intended for many other packages, and therefore acts as a
 % general, all-purpose citation-style interface.
 %
 % With standard numerical .bst files, only numerical citations are
 % possible. With an author-year .bst file, both numerical and
 % author-year citations are possible.
 %
 % If author-year citations are selected, \bibitem must have one of the
 %   following forms:
 %   \bibitem[Jones et al.(1990)]{key}...
 %   \bibitem[Jones et al.(1990)Jones, Baker, and Williams]{key}...
 %   \bibitem[Jones et al., 1990]{key}...
 %   \bibitem[\protect\citeauthoryear{Jones, Baker, and Williams}{Jones
 %       et al.}{1990}]{key}...
 %   \bibitem[\protect\citeauthoryear{Jones et al.}{1990}]{key}...
 %   \bibitem[\protect\astroncite{Jones et al.}{1990}]{key}...
 %   \bibitem[\protect\citename{Jones et al., }1990]{key}...
 %   \harvarditem[Jones et al.]{Jones, Baker, and Williams}{1990}{key}...
 %
 % This is either to be made up manually, or to be generated by an
 % appropriate .bst file with BibTeX.
 %                            Author-year mode     ||   Numerical mode
 % Then, \citet{key}  ==>>  Jones et al. (1990)    ||   Jones et al. [21]
 %       \citep{key}  ==>> (Jones et al., 1990)    ||   [21]
 % Multiple citations as normal:
 % \citep{key1,key2}  ==>> (Jones et al., 1990; Smith, 1989) || [21,24]
 %                           or  (Jones et al., 1990, 1991)  || [21,24]
 %                           or  (Jones et al., 1990a,b)     || [21,24]
 % \cite{key} is the equivalent of \citet{key} in author-year mode
 %                         and  of \citep{key} in numerical mode
 % Full author lists may be forced with \citet* or \citep*, e.g.
 %       \citep*{key}      ==>> (Jones, Baker, and Williams, 1990)
 % Optional notes as:
 %   \citep[chap. 2]{key}    ==>> (Jones et al., 1990, chap. 2)
 %   \citep[e.g.,][]{key}    ==>> (e.g., Jones et al., 1990)
 %   \citep[see][pg. 34]{key}==>> (see Jones et al., 1990, pg. 34)
 %  (Note: in standard LaTeX, only one note is allowed, after the ref.
 %   Here, one note is like the standard, two make pre- and post-notes.)
 %   \citealt{key}          ==>> Jones et al. 1990
 %   \citealt*{key}         ==>> Jones, Baker, and Williams 1990
 %   \citealt{key1,key2}    ==>> Jones et al. 1990; Smith 1989
 % Additional citation possibilities (both author-year and numerical modes)
 %   \citeauthor{key}     ==>> Jones et al.
 %   \citeyear{key}       ==>> 1990
 %   \citefullauthor{key} ==>> Jones, Baker, and Williams
 % (Multiple keys NOT allowed!)
 % Note: full author lists depends on whether the bib style supports them;
 %       if not, the abbreviated list is printed even when full requested.
 %
 % Defining the citation style of a given bib style:
 % Use \bibpunct (in the preamble only) with 6 mandatory arguments:
 %    1. opening bracket for citation
 %    2. closing bracket
 %    3. citation separator (for multiple citations in one \cite)
 %    4. the letter n for numerical styles, s for superscripts
 %        else anything for author-year
 %    5. punctuation between authors and date
 %    6. punctuation between years when common authors missing
 % One optional argument is the character coming before post-notes. It
 %   appears in square braces before all other arguments. May be left off.
 % Example (and default) \bibpunct[,]{(}{)}{;}{a}{,}{,}
 %
 % To make this automatic for a given bib style, named newbib, say, make
 % a local configuration file, natbib.cfg, with the definition
 %   \newcommand{\bibstyle@newbib}{\bibpunct...}
 % Then the \bibliographystyle{newbib} will cause \bibstyle@newbib to
 % be called on THE NEXT LATEX RUN (via the aux file).
 %
 % Such preprogrammed definitions may be invoked in the text (preamble only)
 %  by calling \citestyle{newbib}. This is only useful if the style specified
 %  differs from that in \bibliographystyle.
 %
 % With \citeindextrue and \citeindexfalse, one can control whether the
 % \cite commands make an automatic entry of the citation in the .idx
 % indexing file. For this, \makeindex must also be given in the preamble.
 %
 % LaTeX2e Options: (for selecting punctuation)
 %   round  -  round parentheses are used (default)
 %   square -  square brackets are used   [option]
 %   curly  -  curly braces are used      {option}
 %   angle  -  angle brackets are used    <option>
 %   colon  -  multiple citations separated by colon (default)
 %   comma  -  separated by comma
 %   authoryear - selects author-year citations (default)
 %   numbers-  selects numerical citations
 %   super  -  numerical citations as superscripts
 %   sort   -  sorts and compresses numerical citations
 %   sectionbib - puts bibliography in a \section* instead of \chapter*
 % Punctuation so selected dominates over any predefined ones.
 % LaTeX2e options are called as, e.g.
 %        \usepackage[square,comma]{natbib}
 % LaTeX the source file natbib.dtx to obtain more details.
 %-----------------------------------------------------------
\@ifclassloaded{aguplus}{\PackageError{natbib}
  {The aguplus class already includes natbib coding,\MessageBreak
   so you should not add it explicitly}
  {Type <Return> for now, but then later remove\MessageBreak
   the command \protect\usepackage{natbib} from the document}
  \endinput}{}
\@ifclassloaded{nlinproc}{\PackageError{natbib}
  {The nlinproc class already includes natbib coding,\MessageBreak
   so you should not add it explicitly}
  {Type <Return> for now, but then later remove\MessageBreak
   the command \protect\usepackage{natbib} from the document}
  \endinput}{}
\@ifclassloaded{egs}{\PackageError{natbib}
  {The egs class already includes natbib coding,\MessageBreak
   so you should not add it explicitly}
  {Type <Return> for now, but then later remove\MessageBreak
   the command \protect\usepackage{natbib} from the document}
  \endinput}{}
 % Define citation punctuation for some author-year styles
 % One may add and delete at this point
 % Or put additions into local configuration file natbib.cfg
\newcommand\bibstyle@chicago{\bibpunct{(}{)}{;}{a}{,}{,}}
\newcommand\bibstyle@named{\bibpunct{[}{]}{;}{a}{,}{,}}
\newcommand\bibstyle@agu{\bibpunct{[}{]}{;}{a}{,}{,~}}%Amer. Geophys. Union
\newcommand\bibstyle@egs{\bibpunct{(}{)}{;}{a}{,}{,}}%Eur. Geophys. Soc.
\newcommand\bibstyle@agsm{\bibpunct{(}{)}{,}{a}{}{,}\gdef\harvardand{\&}}
\newcommand\bibstyle@kluwer{\bibpunct{(}{)}{,}{a}{}{,}\gdef\harvardand{\&}}
\newcommand\bibstyle@dcu{\bibpunct{(}{)}{;}{a}{;}{,}\gdef\harvardand{and}}
\newcommand\bibstyle@aa{\bibpunct{(}{)}{;}{a}{}{,}} %Astronomy & Astrophysics
\newcommand\bibstyle@pass{\bibpunct{(}{)}{;}{a}{,}{,}}%Planet. & Space Sci
\newcommand\bibstyle@anngeo{\bibpunct{(}{)}{;}{a}{,}{,}}%Annales Geophysicae
\newcommand\bibstyle@nlinproc{\bibpunct{(}{)}{;}{a}{,}{,}}%Nonlin.Proc.Geophys.
 % Define citation punctuation for some numerical styles
\newcommand\bibstyle@cospar{\bibpunct{/}{/}{,}{n}{}{}%
     \gdef\NAT@biblabelnum##1{##1.}}
\newcommand\bibstyle@esa{\bibpunct{(}{)}{,}{n}{}{}%
     \gdef\NAT@biblabelnum##1{##1.\hspace{1em}}%
     \gdef\NAT@citenum##1##2##3{\NAT@open \if\relax##2\relax\else
       ##2\ \fi Ref.~##1\if\relax##3\relax\else\NAT@cmt\ ##3\fi\NAT@close}}
\newcommand\bibstyle@nature{\bibpunct{}{}{,}{s}{}{}%
     \gdef\NAT@biblabelnum##1{##1.}}
 % The standard LaTeX styles
\newcommand\bibstyle@plain{\bibpunct{[}{]}{,}{n}{}{}}
\let\bibstyle@alpha=\bibstyle@plain
\let\bibstyle@abbrv=\bibstyle@plain
\let\bibstyle@unsrt=\bibstyle@plain
 % The author-year modifications of the standard styles
\newcommand\bibstyle@plainnat{\bibpunct{[}{]}{,}{a}{,}{,}}
\let\bibstyle@abbrvnat=\bibstyle@plainnat
\let\bibstyle@unsrtnat=\bibstyle@plainnat
\newif\ifNAT@numbers \NAT@numbersfalse
\newif\ifNAT@super \NAT@superfalse
\DeclareOption{numbers}{\NAT@numberstrue
   \ExecuteOptions{square,comma,nobibstyle}}
\DeclareOption{super}{\NAT@supertrue\NAT@numberstrue
   \ExecuteOptions{nobibstyle}}
\DeclareOption{authoryear}{\NAT@numbersfalse
   \ExecuteOptions{round,colon,bibstyle}}
\DeclareOption{round}{%
      \renewcommand\NAT@open{(} \renewcommand\NAT@close{)}
   \ExecuteOptions{nobibstyle}}
\DeclareOption{square}{%
      \renewcommand\NAT@open{[} \renewcommand\NAT@close{]}
   \ExecuteOptions{nobibstyle}}
\DeclareOption{angle}{%
      \renewcommand\NAT@open{$<$} \renewcommand\NAT@close{$>$}
   \ExecuteOptions{nobibstyle}}
\DeclareOption{curly}{%
      \renewcommand\NAT@open{\{} \renewcommand\NAT@close{\}}
   \ExecuteOptions{nobibstyle}}
\DeclareOption{comma}{\renewcommand\NAT@sep{,}
   \ExecuteOptions{nobibstyle}}
\DeclareOption{colon}{\renewcommand\NAT@sep{;}
   \ExecuteOptions{nobibstyle}}
\DeclareOption{nobibstyle}{\let\bibstyle=\@gobble}
\DeclareOption{bibstyle}{\let\bibstyle=\@citestyle}
\newif\ifNAT@openbib \NAT@openbibfalse
\DeclareOption{openbib}{\NAT@openbibtrue}
\DeclareOption{sectionbib}{\def\NAT@sectionbib{on}}
\def\NAT@sort{0}
\DeclareOption{sort}{\def\NAT@sort{1}}
\@ifpackageloaded{cite}{\PackageWarningNoLine{natbib}
  {The `cite' package should not be used\MessageBreak
   with natbib. Use option `sort' instead}\ExecuteOptions{sort}}{}
\renewcommand\bibstyle[1]{\@ifundefined{bibstyle@#1}{\relax}
     {\csname bibstyle@#1\endcsname}}
\AtBeginDocument{\global\let\bibstyle=\@gobble}
\let\@citestyle\bibstyle
\newcommand\citestyle[1]{\@citestyle{#1}\let\bibstyle\@gobble}
\@onlypreamble{\citestyle}\@onlypreamble{\@citestyle}
\newcommand\bibpunct[7][,]%
  {\gdef\NAT@open{#2}\gdef\NAT@close{#3}\gdef
   \NAT@sep{#4}\global\NAT@numbersfalse\ifx #5n\global\NAT@numberstrue
   \else
   \ifx #5s\global\NAT@numberstrue\global\NAT@supertrue
   \fi\fi
   \gdef\NAT@aysep{#6}\gdef\NAT@yrsep{#7}%
   \gdef\NAT@cmt{#1}%
   \global\let\bibstyle\@gobble
  }
\@onlypreamble{\bibpunct}
\newcommand\NAT@open{(} \newcommand\NAT@close{)}
\newcommand\NAT@sep{;}
\ProcessOptions
\newcommand\NAT@aysep{,} \newcommand\NAT@yrsep{,}
\newcommand\NAT@cmt{,}
\newcommand\NAT@cite%
    [3]{\ifNAT@swa\NAT@open\if\relax#2\relax\else#2\ \fi
        #1\if\relax#3\relax\else\NAT@cmt\ #3\fi\NAT@close\else#1\fi}
\newcommand\NAT@citenum[3]{\NAT@open\if\relax#2\relax\else
   #2\ \fi #1\if\relax#3\relax\else\NAT@cmt\ #3\fi\NAT@close}
\newcommand\NAT@citesuper[3]{\unskip\hspace{1pt}\textsuperscript{#1}%
   \if\relax#3\relax\else\ (#3)\fi}
\providecommand
  \textsuperscript[1]{\mbox{$^{\mbox{\scriptsize#1}}$}}
\providecommand\@firstofone[1]{#1}
\newcommand\NAT@citexnum{}
\def\NAT@citexnum[#1][#2]#3{\let\@citea\@empty
  \@cite{\@for\@citeb:=#3\do
    {\@citea\def\@citea{\NAT@sep\penalty\@m\NAT@space}%
     \edef\@citeb{\expandafter\@firstofone\@citeb}%
     \if@filesw\immediate\write\@auxout{\string\citation{\@citeb}}\fi
     \@ifundefined{b@\@citeb\@extra@b@citeb}{%
{\reset@font\bfseries?}
        \NAT@citeundefined\PackageWarning{natbib}%
       {Citation `\@citeb' on page \thepage \space undefined}}%
     {\NAT@parse{\@citeb}\hbox{\hyper@natlinkstart{\@citeb}%
      \NAT@num\hyper@natlinkend}}}}{#1}{#2}}
\newcommand\NAT@citex{}
\def\NAT@citex%
  [#1][#2]#3{\let\@citea\@empty
  \@cite{\let\NAT@nm\@empty\let\NAT@year\@empty
    \@for\@citeb:=#3\do
    {\edef\@citeb{\expandafter\@firstofone\@citeb}%
     \if@filesw\immediate\write\@auxout{\string\citation{\@citeb}}\fi
     \@ifundefined{b@\@citeb\@extra@b@citeb}{\@citea%
       {\reset@font\bfseries ?}\NAT@citeundefined
                 \PackageWarning{natbib}%
       {Citation `\@citeb' on page \thepage \space undefined}}%
     {\hyper@natlinkstart{\@citeb}%
     \let\NAT@last@nm=\NAT@nm\let\NAT@last@yr=\NAT@year
     \NAT@parse{\@citeb}\ifNAT@full\let\NAT@nm\NAT@all@names\else
       \let\NAT@nm\NAT@name\fi
     \ifNAT@swa
       \ifx\NAT@last@nm\NAT@nm\NAT@yrsep
          \ifx\NAT@last@yr\NAT@year \NAT@exlab\else\unskip\ \NAT@date\fi
       \else\@citea{\NAT@nm}\NAT@aysep
       \ \NAT@date \fi \def\@citea{\NAT@sep\ }%
     \else
       \ifx\NAT@last@nm\NAT@nm\NAT@yrsep\ifx\NAT@last@yr\NAT@year
         \NAT@exlab\else \unskip\ \NAT@date\fi
       \else\@citea{\NAT@nm}\ \NAT@open\if\relax#1\relax\else#1\ \fi
         \NAT@date\fi
       \def\@citea{\NAT@close\NAT@sep\ }%
     \fi \hyper@natlinkend
     }}\ifNAT@swa\else\if\relax#2\relax\else\NAT@cmt\ #2\fi
     \NAT@close\fi}{#1}{#2}}
\newcommand\NAT@biblabel[1]{\hfill}
\newcommand\NAT@biblabelnum[1]{[#1]}
\newcommand\NAT@bibsetnum[1]{\settowidth\labelwidth{\@biblabel{#1}}%
   \setlength{\leftmargin}{\labelwidth}\addtolength{\leftmargin}{\labelsep}%
   \setlength{\itemsep}{\bibsep}\setlength{\parsep}{\z@}%
   \ifNAT@openbib
     \addtolength{\leftmargin}{\bibindent}%
     \setlength{\itemindent}{-\bibindent}%
     \setlength{\listparindent}{\itemindent}%
     \setlength{\parsep}{0pt}%
   \fi
}
\newlength{\bibhang}
\setlength{\bibhang}{1em}
\newlength{\bibsep}
{\@listi \global\bibsep\itemsep \global\advance\bibsep by\parsep}

\newcommand\NAT@bibsetup%
   [1]{\setlength{\leftmargin}{\bibhang}\setlength{\itemindent}{-\leftmargin}%
       \setlength{\itemsep}{\bibsep}\setlength{\parsep}{\z@}}
\newcommand\NAT@set@cites{\ifNAT@numbers
  \ifNAT@super \let\@cite\NAT@citesuper
     \let\NAT@space\relax\else
     \let\@cite\NAT@citenum \def\NAT@space{ }\fi
  \let\@citex\NAT@citexnum
  \let\@biblabel\NAT@biblabelnum
  \let\@bibsetup\NAT@bibsetnum
  \def\natexlab##1{}%
 \else
  \let\@cite\NAT@cite
  \let\@citex\NAT@citex
  \let\@biblabel\NAT@biblabel
  \let\@bibsetup\NAT@bibsetup
  \def\natexlab##1{##1}%
 \fi}
\AtBeginDocument{\NAT@set@cites}
\AtBeginDocument{\@ifpackageloaded{showkeys}{%
\let\SK@citex\@citex
       \def\@citex[#1][#2]#3{\SK@\SK@@ref{#3}\SK@citex[#1][#2]{#3}}
}{}}
\newif\ifNAT@full\NAT@fullfalse
\newif\ifNAT@swa
\DeclareRobustCommand\citet
   {\NAT@swafalse
         \@ifstar{\NAT@fulltrue\NAT@citet}{\NAT@fullfalse\NAT@citet}}
\newcommand\NAT@citet{\@ifnextchar[{\NAT@@citet}{\NAT@@citet[]}}
\newcommand\NAT@@citet{}
\def\NAT@@citet[#1]{\@ifnextchar[{\NAT@@@citet[#1]}{\NAT@@@citet[][#1]}}
\newcommand\NAT@@@citet{}
\def\NAT@@@citet[#1][#2]#3{%
  \ifNAT@numbers\ifNAT@full\citefullauthor{#3}\else
  \citeauthor{#3}\fi\ \fi
  \@citex[#1][#2]{#3}}
\DeclareRobustCommand\citep
   {\NAT@swatrue
         \@ifstar{\NAT@fulltrue\NAT@citep}{\NAT@fullfalse\NAT@citep}}
\newcommand\NAT@citep{\@ifnextchar[{\NAT@@citep}{\NAT@@citep[]}}
\newcommand\NAT@@citep{}
\def\NAT@@citep[#1]{\@ifnextchar [{\@citex[#1]}{\@citex[][#1]}}
\DeclareRobustCommand\cite
    {\@ifstar{\NAT@fulltrue\NAT@cites}{\NAT@fullfalse\NAT@cites}}
\newcommand\NAT@cites{\@ifnextchar [{\NAT@swatrue\NAT@@citep}{\NAT@swafalse
    \NAT@@citep[]}}
\DeclareRobustCommand\citealt
    {\@ifstar{\NAT@alts}{\NAT@alt}}
\newcommand\NAT@alt[1]{{\ifNAT@numbers\else
     \renewcommand\NAT@open{}\renewcommand\NAT@close{}\fi\cite{#1}}}
\newcommand\NAT@alts[1]{{\ifNAT@numbers\else
     \renewcommand\NAT@open{}\renewcommand\NAT@close{}\fi\cite*{#1}}}
\newcommand\citeauthor[1]{\if@filesw\immediate\write
     \@auxout{\string\citation{#1}}\fi
     \@ifundefined{b@#1\@extra@b@citeb}{%
       {\reset@font\bfseries ?}\NAT@citeundefined
            \PackageWarning{natbib}%
       {Citation `#1' on page \thepage \space undefined}}%
       {\NAT@parse{#1}\ifx\NAT@noname\NAT@name
         {\reset@font\bfseries(author?)}\PackageWarning{natbib}
           {Author undefined for citation `#1'
             \MessageBreak
            on page \thepage}\else
         {\hyper@natlinkstart{#1}\NAT@name\hyper@natlinkend}\fi}%
}
\newcommand\citeyear[1]{\if@filesw\immediate\write
     \@auxout{\string\citation{#1}}\fi
     \@ifundefined{b@#1\@extra@b@citeb}{%
       {\reset@font\bfseries ?}\NAT@citeundefined
            \PackageWarning{natbib}%
       {Citation `#1' on page \thepage \space undefined}}%
       {\NAT@parse{#1}\if\relax\NAT@date\relax
         {\reset@font\bfseries(year?)}\PackageWarning{natbib}
           {Year undefined for citation `#1'
             \MessageBreak
            on page \thepage}\else
         {\hyper@natlinkstart{#1}\NAT@date\hyper@natlinkend}\fi}%
}
\newcommand\citefullauthor[1]{\if@filesw\immediate\write
     \@auxout{\string\citation{#1}}\fi
     \@ifundefined{b@#1\@extra@b@citeb}{%
       {\reset@font\bfseries ?}\NAT@citeundefined
            \PackageWarning{natbib}%
       {Citation `#1' on page \thepage \space undefined}}%
       {\NAT@parse{#1}\ifx\NAT@noname\NAT@all@names
         {\reset@font\bfseries(author?)}\PackageWarning{natbib}
           {Author undefined for citation `#1'
             \MessageBreak
            on page \thepage}\else
         {\hyper@natlinkstart{#1}\NAT@all@names\hyper@natlinkend}\fi}%
}
\newcommand\NAT@parse[1]{{%
     \let\protect=\@unexpandable@protect\let~\relax
     \xdef\NAT@temp{\csname b@#1\@extra@b@citeb\endcsname}}%
     \expandafter\NAT@split\NAT@temp
     \expandafter\NAT@parse@date\NAT@date??????@@%
     \ifciteindex\NAT@index\fi
}
\newcommand\NAT@split[4]{%
  \gdef\NAT@num{#1}\gdef\NAT@name{#3}\gdef\NAT@date{#2}%
  \gdef\NAT@all@names{#4}%
  \ifx\NAT@noname\NAT@all@names \gdef\NAT@all@names{#3}\fi}
\newcommand\NAT@parse@date{}
\def\NAT@parse@date#1#2#3#4#5#6@@{%
  \ifnum\the\catcode`#1=11\def\NAT@year{}\def\NAT@exlab{#1}\else
  \ifnum\the\catcode`#2=11\def\NAT@year{#1}\def\NAT@exlab{#2}\else
  \ifnum\the\catcode`#3=11\def\NAT@year{#1#2}\def\NAT@exlab{#3}\else
  \ifnum\the\catcode`#4=11\def\NAT@year{#1#2#3}\def\NAT@exlab{#4}\else
    \def\NAT@year{#1#2#3#4}\def\NAT@exlab{{#5}}\fi\fi\fi\fi}
\newcommand\NAT@index{}
\let\NAT@makeindex=\makeindex
\renewcommand\makeindex{\NAT@makeindex
  \renewcommand\NAT@index{\@bsphack\begingroup
     \def~{\string~}\@wrindex{\NAT@idxtxt}}}
\newcommand\NAT@idxtxt{\NAT@name\ \NAT@open\NAT@date\NAT@close}
\newif\ifciteindex \citeindexfalse
\newcommand\citeindextype{default}
\newcommand\NAT@index@alt{{\let\protect=\noexpand\let~\relax
  \xdef\NAT@temp{\NAT@idxtxt}}\expandafter\NAT@exp\NAT@temp\@nil}
\newcommand\NAT@exp{}
\def\NAT@exp#1\@nil{\index[\citeindextype]{#1}}

\AtBeginDocument{%
\@ifpackageloaded{index}{\let\NAT@index=\NAT@index@alt}{}}
\newcommand\NAT@ifcmd{\futurelet\NAT@temp\NAT@ifxcmd}
\newcommand\NAT@ifxcmd{\ifx\NAT@temp\relax\else\expandafter\NAT@bare\fi}
\def\NAT@bare#1(#2)#3()#4\@nil#5{%
  \if\relax#2\relax
  \expandafter\NAT@apalk#1, , \@nil{#5}\else
  \stepcounter{NAT@ctr}%
  \NAT@wrout{\arabic {NAT@ctr}}{#2}{#1}{#3}{#5}
\fi
}
\newcommand\NAT@wrout[5]{%
\if@filesw
      {\let\protect\noexpand\let~\relax
       \immediate
       \write\@auxout{\string\bibcite{#5}{{#1}{#2}{{#3}}{{#4}}}}}\fi
\ignorespaces}
\def\NAT@noname{{}}
\renewcommand\bibitem{%
  \@ifnextchar[{\@lbibitem}{%
    \global\NAT@stdbsttrue
    \stepcounter{NAT@ctr}\@lbibitem[\arabic{NAT@ctr}]}}
\def\@lbibitem[#1]#2{%
   \@ifundefined{b@#2\@extra@b@citeb}{\def\NAT@num{}}{\NAT@parse{#2}}%
   \item[\hfil\hyper@natanchorstart{#2}\@biblabel{\NAT@num}%
    \hyper@natanchorend]%
    \NAT@ifcmd#1()()\@nil{#2}}
\@ifpackageloaded{showkeys}{%
   \let\SK@lbibitem\@lbibitem
   \def\@lbibitem[#1]#2{%
     \SK@lbibitem[#1]{#2}\SK@\SK@@label{#2}\ignorespaces}}{}
\newif\ifNAT@stdbst \NAT@stdbstfalse

\AtEndDocument
  {\ifNAT@stdbst\if@filesw\immediate\write\@auxout{\string
   \global\string\NAT@numberstrue}\fi\fi
  }
\providecommand\bibcite{}
\renewcommand\bibcite[2]{\@ifundefined{b@#1\@extra@binfo}\relax
     {\NAT@citemultiple
      \PackageWarningNoLine{natbib}{Citation `#1' multiply defined}}%
  \global\@namedef{b@#1\@extra@binfo}{#2}}
\AtEndDocument{\NAT@swatrue\renewcommand\bibcite[2]%
                         {\NAT@testdef{#1}{#2}}}
\newcommand\NAT@testdef[2]{%
  \def\NAT@temp{#2}\expandafter \ifx \csname b@#1\@extra@binfo\endcsname
    \NAT@temp \else \ifNAT@swa \NAT@swafalse
       \PackageWarningNoLine{natbib}{Citation(s) may have
          changed.\MessageBreak
          Rerun to get citations correct}\fi\fi}
\newcommand\NAT@apalk{}
\def\NAT@apalk#1, #2, #3\@nil#4{\if\relax#2\relax
  \global\NAT@stdbsttrue
  \NAT@wrout{#1}{}{}{}{#4}\else
  \stepcounter{NAT@ctr}%
  \NAT@wrout{\arabic {NAT@ctr}}{#2}{#1}{}{#4}\fi}
\newcommand\citeauthoryear{}
\def\citeauthoryear#1#2#3()()\@nil#4{\stepcounter{NAT@ctr}\if\relax#3\relax
   \NAT@wrout{\arabic {NAT@ctr}}{#2}{#1}{}{#4}\else
   \NAT@wrout{\arabic {NAT@ctr}}{#3}{#2}{#1}{#4}\fi}
\newcommand\citestarts{\NAT@open}
\newcommand\citeends{\NAT@close}
\newcommand\betweenauthors{and}
\newcommand\astroncite{}
\def\astroncite#1#2()()\@nil#3{\stepcounter{NAT@ctr}\NAT@wrout{\arabic
{NAT@ctr}}{#2}{#1}{}{#3}}
\newcommand\citename{}
\def\citename#1#2()()\@nil#3{\expandafter\NAT@apalk#1#2, \@nil{#3}}
\newcommand\harvarditem[4][]%
    {\if\relax#1\relax\bibitem[#2(#3)]{#4}\else
        \bibitem[#1(#3)#2]{#4}\fi }
\newcommand\harvardleft{\NAT@open}
\newcommand\harvardright{\NAT@close}
\newcommand\harvardyearleft{\NAT@open}
\newcommand\harvardyearright{\NAT@close}
\AtBeginDocument{\providecommand{\harvardand}{and}}
\newcommand\harvardurl[1]{\textbf{URL:} \textit{##1}}
\providecommand\bibsection{}
\@ifundefined{chapter}%
  {\renewcommand\bibsection{\section*{\refname
    \@mkboth{\MakeUppercase{\refname}}{\MakeUppercase{\refname}}}}}
  {\@ifundefined{NAT@sectionbib}%
    {\renewcommand\bibsection{\chapter*{\bibname
     \@mkboth{\MakeUppercase{\bibname}}{\MakeUppercase{\bibname}}}}}
    {\renewcommand\bibsection{\section*{\bibname
     \ifx\@mkboth\@gobbletwo\else\markright{\MakeUppercase{\bibname}}\fi}}}}
\@ifclassloaded{amsart}%
  {\renewcommand\bibsection{\section*{\refname}}{}}{}
\@ifclassloaded{amsbook}%
  {\renewcommand\bibsection{\section*{\bibname}}{}}{}
\@ifundefined{bib@heading}{}{\let\bibsection\bib@heading}
\newcounter{NAT@ctr}
\renewenvironment{thebibliography}[1]{%
 \bibfont\bibsection\parindent \z@\list
   {\@biblabel{\arabic{NAT@ctr}}}{\@bibsetup{#1}%
    \setcounter{NAT@ctr}{0}}%
    \ifNAT@openbib
      \renewcommand\newblock{\par}
    \else
      \renewcommand\newblock{\hskip .11em \@plus.33em \@minus.07em}%
    \fi
    \sloppy\clubpenalty4000\widowpenalty4000
    \sfcode`\.=1000\relax
    \let\citeN\cite \let\shortcite\cite
    \let\citeasnoun\cite
 }{\def\@noitemerr{%
  \PackageWarning{natbib}
     {Empty `thebibliography' environment}}%
  \endlist\vskip-\lastskip}
\let\bibfont=\relax
\providecommand\reset@font{\relax}
\providecommand\bibname{Bibliography}
\providecommand\refname{References}
\newcommand\NAT@citeundefined{\gdef \NAT@undefined {%
    \PackageWarningNoLine{natbib}{There were undefined citations}}}
\let \NAT@undefined \relax
\newcommand\NAT@citemultiple{\gdef \NAT@multiple {%
    \PackageWarningNoLine{natbib}{There were multiply defined citations}}}
\let \NAT@multiple \relax
\AtEndDocument{\NAT@undefined\NAT@multiple}
\providecommand\@mkboth[2]{}
\providecommand\MakeUppercase{\uppercase}
\providecommand{\@extra@b@citeb}{}
\gdef\@extra@binfo{}
\providecommand\hyper@natanchorstart[1]{}
\providecommand\hyper@natanchorend{}
\providecommand\hyper@natlinkstart[1]{}
\providecommand\hyper@natlinkend{}
\ifnum\NAT@sort=1
\newcommand\NAT@citen[1]{%
\nocite{#1}%
\@tempcntb\m@ne
\let\@h@ld\relax
\let\@citea\@empty
\let\@celt\delimiter
\def\@cite@list{}%
\@for \@citeb:=#1\do{\@make@cite@list}%
\@tempcnta\m@ne
\let\@celt\@compress@cite \@cite@list
\@h@ld}

\begingroup \catcode`\_=8
\gdef\@make@cite@list{%
     \edef\@citeb{\expandafter\@firstofone\@citeb}%
     \@ifundefined{b@\@citeb\@extra@b@citeb}{%
      \@citea{\reset@font\bfseries?}\def\@citea{\NAT@sep\penalty\@m\NAT@space}%
      \NAT@citeundefined\PackageWarning{natcite}%
      {Citation `\@citeb' on page \thepage\space undefined}}%
    {\NAT@parse{\@citeb}%
      \ifcat _\ifnum\z@<0\NAT@num _\else A\fi % a positive number, put in list
       \@tempcnta\NAT@num \relax
       \ifnum \@tempcnta>\@tempcntb % new highest, add to end (efficiently)
          \edef\@cite@list{\@cite@list \@celt{\NAT@num}}%
          \@tempcntb\@tempcnta
       \else % arbitrary number: insert appropriately
          \edef\@cite@list{\expandafter\@sort@celt \@cite@list \@gobble @}%
       \fi
    \else % citation is not a number, output immediately
       \@citea \NAT@num \def\@citea{\NAT@sep\penalty\@m\NAT@space}%
 \fi}}
\endgroup

\def\@compress@cite#1{%
  \advance\@tempcnta\@ne
  \ifnum #1=\@tempcnta
     \ifx\@h@ld\relax
        \edef\@h@ld{\@citea #1}%
     \else
        \def\@h@ld{\hbox{--}\penalty\@m #1}%
     \fi
  \else
     \@h@ld \@citea #1\let\@h@ld\relax
  \fi \@tempcnta#1\def\@citea{\NAT@sep\penalty\@m\NAT@space}%
}

\def\@sort@celt#1#2{\ifx \@celt #1%
     \ifnum #2<\@tempcnta
        \@celt{#2}%
        \expandafter\expandafter\expandafter\@sort@celt
     \else
        \@celt{\number\@tempcnta}\@celt{#2}%
  \fi\fi}
\def\NAT@citexnum[#1][#2]#3{\let\@citea\@empty
  \@cite{\NAT@citen{#3}}{#1}{#2}}
\fi
\InputIfFileExists{natbib.cfg}
       {\typeout{Local config file natbib.cfg used}}{}
%% <<<<< End of decommented file <<<<<<
%%
%% End of file `natbib.sty'.

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to [email protected].