% \iffalse      THIS IS A META-COMMENT
%<*dtx>
\ProvidesFile
%========================================================================
                       {F-NATBIB.DTX}
%========================================================================
%</dtx>
%% Copyright 1993-1999 Patrick W Daly
%% Max-Planck-Institut f\"ur Aeronomie
%% Max-Planck-Str. 2
%% D-37191 Katlenburg-Lindau
%% Germany
%% E-mail: daly@linmpi.mpg.de
% 
% This program can be redistributed and/or modified under the terms
% of the LaTeX Project Public License Distributed from CTAN
% archives in directory macros/latex/base/lppl.txt; either
% version 1 of the License, or any later version.
%
% This is a contributed file to the LaTeX2e system.
% -------------------------------------------------
% This is a LaTeX package to modify \cite and \thebibliography for author-year 
%    systems of bibliographic citation; will also work with 
%    numerical systems, allowing simplified style changes for them too.
% Installation:
%    LaTeX this file: creates docstrip installation file natbib.ins
%                         AND the (LaTeX2e) documentation
%    (La)TeX natbib.ins: creates package file natbib.sty 
%                        and optionally documentation driver natbib.drv
%    (natbib.ins may be edited as needed)
% Docstrip options available:
%        package - to produce a (LaTeX2e) package .sty file 
%        notes   - to produce a reference sheet for natbib usage
%        driver  - to produce a driver file to print the documentation
%        209     - (with package) for style file that runs under LaTeX 2.09 
%        subpack - (with package) for coding included in other packages
%        all     - (with package) to include all author-year systems
%                   else individually with:
%        apalike, newapa, chicago, harvard, authordate, astron
%        agu     - (with package,subpack) for inclusion in aguplus package
%        egs- (with package,subpack) for inclusion in egs package
%        nopreonly - allows \citestyle and \bibpunct to be used anywhere
%--------------------------------------------------------------------------
%<*!subpack>
%<package&209>\def\ProvidesPackage#1#2]
%<package&209>  {\typeout{Style option `#1'#2]}}
%
%  *** Identify the package file:-
%<package&!209>\NeedsTeXFormat{LaTeX2e}[1995/06/01]
% (Need LaTeX2e release 3 for option definition with single #)
%<package>\ProvidesPackage{natbib}
%</!subpack>
%
%  *** Provide command to dislay module version
%<package&subpack>\def\ModuleVersion#1[#2]{}
%<package&subpack>    \ModuleVersion{natbib}
%
%  *** Provide command to identify reference sheet (notes)
%<notes>\NeedsTeXFormat{LaTeX2e}
%<notes>\def\DescribesFile#1 [#2 #3 #4]
%<notes>  {\def\filename{#1}\def\filedate{#2}\def\fileversion{#3}}
%<notes>\DescribesFile{natbib}
%
%  *** Identify the driver file:-
%<driver>\NeedsTeXFormat{LaTeX2e}
%<driver>\ProvidesFile{natbib.drv}
%
%  *** The DATE, VERSION, and other INFO
%\fi
%\ProvidesFile{natbib}
        [1999/05/28 7.0 (PWD)]
% \changes{4.0}{1993 Aug 19}{First documented release}
% \changes{4.1}{1993 Oct 4}{Simplification of \cs{@citeapalk}}
% \changes{4.1a}{1993 Oct 14}{Add \texttt{rev} option for reversed comments 
%                             in \cs{cite}}
% \changes{4.1b}{1993 Oct 18}{Add \cs{bibfont} to list definition =\cs{relax}}
% \changes{4.2}{1993 Oct 22}{Add coding for AGU, NLINPROC}
% \changes{4.2}{1993 Nov 20}{Add more coding for AGU}
% \changes{4.3a}{1994 Feb 24}{First additions for \LaTeXe}
% \changes{5.0}{1994 May 18}{Revised for \LaTeXe{} and 2.09}
% \changes{5.0}{1994 May 18}{Remove obsolete JGR, GRL coding}
% \changes{5.0}{1994 May 18}{Add \cs{citeauthor}, \cs{citeyear}}
% \changes{5.0}{1994 May 18}{Two optional texts for \cs{cite} so \texttt{rev}
%                            option obsolete}
% \changes{5.0}{1994 May 18}{\LaTeXe\ options to select punctuation}
% \changes{5.1}{1994 Jun 22}{Conform to first official release of \LaTeXe}
% \changes{5.1}{1994 Jun 22}{Separate \LaTeX\ and 2.09 files}
% \changes{5.1}{1994 Jun 22}{Put doc driver first}
% \changes{5.2}{1994 Aug 25}{Fix up 2.09 style to run in compatibility mode}
% \changes{5.2}{1994 Aug 25}{\cs{citeauthor}, \cs{citeyear} make BibTeX 
%                             entry in aux file}
% \changes{5.2}{1994 Aug 25}{\cs{@citex} defined as in \LaTeXe}
% \changes{5.2}{1994 Aug 25}{Local config file \texttt{natbib.cfg} read in}
% \changes{5.3}{1994 Sep 13}{Add \cs{citefullauthor}, options \texttt{angle}, 
%                             \texttt{curly}}
% \changes{5.3}{1994 Sep 19}{Add star version of \cs{cite} for full authors}
% \changes{5.3}{1994 Sep 26}{Fix accents in citations with proper definition
%                             of \cs{protect}}
% \changes{5.4}{1994 Nov 24}{Add space in \cs{@citex} for text cites}
% \changes{5.4}{1994 Nov 24}{Replace \cs{if@tempswa} by \cs{ifNAT@swa}}
% \changes{5.4}{1994 Nov 24}{Add superscript citation type to \cs{bibpunct}}
% \changes{5.4}{1994 Nov 24}{Add \cs{@citesuper}, fix up bugs in superscripts}
% \changes{5.4}{1994 Nov 24}{Define \cs{@citexnum} as in \LaTeXe}
% \changes{5.4}{1995 Feb 03}{Add \cs{citestyle} same as \cs{bibstyle}}
% \changes{5.4}{1995 Feb 08}{For repeated years and authors, print just letter}
% \changes{5.5}{1995 Mar 13}{Add \cs{bibhang} and command space in
%      \cs{@cite}}
% \changes{5.5}{1995 Mar 16}{Add \cs{citealt} for citation with no
%      parentheses}
% \changes{5.5}{1995 Mar 24}{Reorganize internal commands, using \cs{NAT@}
%     prefixes}
% \changes{5.5}{1995 Mar 24}{Punctuation selection commands \cs{bibpunct},
%     \cs{citestyle} are now preamble only, whereas previously they had to
%     come after the preamble}
% \changes{5.5}{1995 May 14}{Change names of punctuation commands to
%     \cs{NAT@...}}
% \changes{6.0}{1995 Sep 4}{Allow numerical styles with author-year
%     \texttt{bst} files}
% \changes{6.0}{1995 Sep 21}{Add automatic indexing of citations}
% \changes{6.0}{1995 Sep 29}{Accommodate \texttt{index} package}
% \changes{6.1}{1995 Nov 22}{Fixed for \LaTeXe\ \texttt{1995/12/01}}
% \changes{6.1}{1995 Dec 4}{Make more robust against changes to internals}
% \changes{6.1a}{1995 Dec 19}{Fix test for changed citations}
% \changes{6.2}{1996 Jan 10}{Replace all \cs{uppercase}}
% \changes{6.2}{1996 Jan 11}{Add \cs{citet}}
% \changes{6.2}{1996 Feb 2}{Fix superscript size}
% \changes{6.2}{1996 Mar 05}{Add length \cs{bibsep} for linespacing between
%               references}
% \changes{6.2}{1996 Apr 15}{Fix clash with \texttt{amsart} and
%              \texttt{amsbook}}
% \changes{6.3}{1996 Jun 10}{Allow \texttt{showkeys} to be loaded first}
% \changes{6.3}{1996 Jun 17}{Fix punctuation for \texttt{plainnat}}
% \changes{6.3}{1996 Jun 17}{Suppress extra labels with numericals}
% \changes{6.4}{1996 Jun 18}{Provide \cs{bibname} and \cs{refname}}
% \changes{6.4}{1996 Jun 27}{Change \texttt{nlinproc} option to \texttt{egs}}
% \changes{6.4}{1996 Sep 1}{Make compatible with \texttt{chapterbib.sty}}
% \changes{6.4}{1996 Sep 12}{Fix spacing for superscripts}
% \changes{6.4}{1996 Sep 12}{Extra letter printed with \cs{citeyear}}
% \changes{6.4}{1996 Sep 13}{Add compression and sorting of numerical citations}
% \changes{6.4}{1996 Oct 2}{Make compatible with \texttt{hyperref.sty}}
% \changes{6.5}{1996 Dec 11}{KOMA script compatibility}
% \changes{6.5}{1997 Jan 10}{For EGS, no blank line between references}
% \changes{6.5}{1997 Jan 30}{Recode notes so they work with \cs{citet} and
%     \cs{citep}; change documentation to stress these commands over \cs{cite}}
% \changes{6.5}{1997 Feb 5}{Fix KOMA script properly}
% \changes{6.6}{1997 Apr 6}{Fix \cs{nocite} to work with \texttt{chapterbib}}
% \changes{6.6}{1997 May 26}{Let \cs{citealt} have full \cs{cite} syntax}
% \changes{6.6}{1997 Jun 4}{Add \cs{citeyearpar}}
% \changes{6.6}{1997 Jun 4}{Add sorting of author--year citations}
% \changes{6.6}{1997 Jun 12}{Add \cs{citealp} like \cs{citep} without parentheses}
% \changes{6.6}{1997 Jun 24}{Fix \texttt{showkeys} functionality}
% \changes{6.6}{1997 Jun 25}{Improve \texttt{hyperref} functionality}
% \changes{6.6}{1997 Jun 30}{Fix bug in \cs{NAT@citex}}
% \changes{6.7}{1997 Jul 14}{Add \texttt{longnamesfirst} option}
% \changes{6.7}{1997 Sep 12}{Fix interface with \texttt{showkeys}}
% \changes{6.7}{1997 Nov 10}{Fix interface with \texttt{babel}}
% \changes{6.7}{1997 Nov 11}{Add reference sheet extraction}
% \changes{6.8}{1997 Dec 1}{Permit \cs{@biblabel} to be user modified}
% \changes{6.8}{1998 Feb 19}{Fix hyperref bug in \cs{citep}}
% \changes{6.8a}{1998 Mar 6}{Correct wrong name for \texttt{longnamesfirst}
%    in the documentation}
% \changes{6.8a}{1998 May 14}{\cs{@biblabel} only redefinable for numerical
%    mode}
% \changes{6.8b}{1998 July 6}{Hyperref: to work with \texttt{chapterbib} and 
%     breaks links in textual citations}
% \changes{6.8c}{1998 July 14}{Hyperref: remove opening brace and notes from 
%     link}
% \changes{6.8d}{1998 Nov 23}{Fix bug in \texttt{super} option; suppress brackets}
% \changes{6.9}{1999 Jan 22}{Fix bug with \cs{makeindex}}
% \changes{6.9}{1999 Feb 23}{Update copyright notice}
% \changes{6.9}{1999 Mar 26}{Babel test made more general}
% \changes{7.0}{1999 May 7}{With empty year, act like \cs{citeauthor}}
% \changes{7.0}{1999 May 21}{Correct \cs{bibsection} for \texttt{amsbook}}
%
% \CheckSum{2346}
% \CharacterTable
%  {Upper-case    \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
%   Lower-case    \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
%   Digits        \0\1\2\3\4\5\6\7\8\9
%   Exclamation   \!     Double quote  \"     Hash (number) \#
%   Dollar        \$     Percent       \%     Ampersand     \&
%   Acute accent  \'     Left paren    \(     Right paren   \)
%   Asterisk      \*     Plus          \+     Comma         \,
%   Minus         \-     Point         \.     Solidus       \/
%   Colon         \:     Semicolon     \;     Less than     \<
%   Equals        \=     Greater than  \>     Question mark \?
%   Commercial at \@     Left bracket  \[     Backslash     \\
%   Right bracket \]     Circumflex    \^     Underscore    \_
%   Grave accent  \`     Left brace    \{     Vertical bar  \|
%   Right brace   \}     Tilde         \~}
%
% \iffalse
%<*install>
%^^A =============================================
%^^A    Here is the docstrip installation file
%^^A    It is written on first LaTeX run if it 
%^^A    does not already exist
%^^A =============================================
\begin{filecontents*}{f-natbib.ins}
% File: natbib.ins
% Copyright 1999 Patrick W. Daly
%
% This file can be redistributed and/or modified under the terms
% of the LaTeX Project Public License Distributed from CTAN
% archives in directory macros/latex/base/lppl.txt; either
% version 1 of the License, or any later version.
% 
% It is an installation file for extracting package and driver
% files from the original source file. Simply process it under
% TeX or LaTeX. It works with Docstrip versions before and after
% December 1995.

\def\batchfile{f-natbib.ins}
\input docstrip

\preamble
=============================================
IMPORTANT NOTICE:

This program can be redistributed and/or modified under the terms
of the LaTeX Project Public License Distributed from CTAN
archives in directory macros/latex/base/lppl.txt; either
version 1 of the License, or any later version.

This is a generated file.
It may not be distributed without the original source file \inFileName.

Full documentation can be obtained by LaTeXing that original file.
Only a few abbreviated comments remain here to describe the usage.
=============================================
\endpreamble
\postamble

<<<<< End of generated file <<<<<<
\endpostamble
\keepsilent

% Docstrip before Dec 95 does not have \generate syntax, nor
%   \declarepreamble. Must redefine them. The \generateFile called
%   for each output file individually.
% Docstrip before Dec 96 cannot interprete multiline \if..\fi 
%   Thus for maximum compatibility, have only one-line conditionals

\let\oldDS F\relax
\expandafter\ifx\csname generate\endcsname\relax \let\oldDS T\relax\fi
\if\oldDS T  \def\declarepreamble#1{\preamble}\fi
\if\oldDS T  \def\declarepostamble#1{\postamble}\fi
\if\oldDS T  \generateFile{natbib.sty}{f}{\from{f-natbib.dtx}{package,all}} \fi

\declarepreamble\refsheet
=============================================
IMPORTANT NOTICE:

This program can be redistributed and/or modified under the terms
of the LaTeX Project Public License Distributed from CTAN
archives in directory macros/latex/base/lppl.txt; either
version 1 of the License, or any later version.

This is a generated file.
It may not be distributed without the original source file \inFileName.

This is a Reference Sheet for natbib. It consists of excerpts from the
original source file.

For more details, LaTeX the source \inFileName.
==============================================
\endpreamble

\declarepostamble\refsheetq

End of Reference Sheet file

\endpostamble

\ifx\oldDS T \generateFile{natnotes}{f}{\from{f-natbib.dtx}{notes}}\fi

\declarepreamble\driver
============================================
This is the driver file to produce the LaTeX documentation 
from the original source file \inFileName.

Make changes to it as needed. (Never change the file \inFileName!)
============================================
\endpreamble

\declarepostamble\driverq

End of documentation driver file.
\endpostamble

\ifx\oldDS T \generateFile{natbib.drv}{f}{\from{f-natbib.dtx}{driver}}\fi

\ifx\oldDS T \let\askforoverwritefalse\relax\def\generate#1{}\fi

\askforoverwritefalse
\generate{\file{natbib.sty}{\from{f-natbib.dtx}{package,all}}
          \file{natnotes}{\usepreamble\refsheet\usepostamble\refsheetq
                                \from{f-natbib.dtx}{notes}}
          \file{natbib.drv}{\usepreamble\driver\usepostamble\driverq
                           \from{f-natbib.dtx}{driver}}
         }

\obeyspaces
\Msg{*********************************************}%
\Msg{* For documentation, process f-natbib.dtx   *}%
\Msg{*    or the driver file      natbib.drv     *}%
\Msg{* For reference sheet, process natnotes.tex *}
\Msg{*********************************************}
\end{filecontents*}
%</install>
%<*driver>
\documentclass{ltxdoc}
\usepackage[latin1]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage[francais]{babel}
%<driver>%\documentclass[twoside]{ltxdoc}
%<driver>%\documentclass[a4paper]{ltxdoc}
%<driver>%\documentclass[twoside,a4paper]{ltxdoc}
\raggedbottom

 %** To include the detailed explanation of the coding, comment out
 %**   the next line
\OnlyDescription

 %** To produce a command index: add the following line for one run,
 %**   then run  makeindex -s gind.ist natbib
 %**   and reprocess, with or without this line (much faster without)
%<driver>% \EnableCrossrefs\CodelineIndex 

 %** To produce a change history: add the following line for one run,
 %**   then run  makeindex -s gglo.ist -o natbib.gls natbib.glo
 %**   and reprocess, with or without this line (faster without)
%<driver>% \RecordChanges 

\DisableCrossrefs %May stay; zapped by \EnableCrossrefs
\CodelineNumbered %May stay

\begin{document}
   \DocInput{f-natbib.dtx}
\end{document}
%</driver>
%<*notes>
%^^A ***************************
%^^A Preamble to the Reference Sheet
%^^A ***************************
\documentclass{article}

\setlength{\parindent}{0pt}
\setlength{\parskip}{1ex}
\setlength{\textwidth}{\paperwidth}
\addtolength{\textwidth}{-2in}
\setlength{\oddsidemargin}{0pt}
\setlength{\textheight}{\paperheight}

\addtolength{\textheight}{-\headheight}
\addtolength{\textheight}{-\headsep}
\addtolength{\textheight}{-\footskip}
\addtolength{\textheight}{-2in}
\makeatletter
\def\@listI{\leftmargin\leftmargini
  \topsep\z@ \parsep\parskip \itemsep\z@}
\let\@listi\@listI
\@listi
\makeatother
\newcommand{\head}[1]{\subsubsection*{#1}}

\pagestyle{headings}
\markright{Reference sheet: \texttt{natbib}}

\usepackage{shortvrb}
\MakeShortVerb{\|}

\begin{document}
\thispagestyle{plain}

%</notes>
%\fi
%
% \DoNotIndex{\begin,\CodelineIndex,\CodelineNumbered,\def,\DisableCrossrefs}
% \DoNotIndex{\DocInput,\documentclass,\EnableCrossrefs,\end,\GetFileInfo}
% \DoNotIndex{\NeedsTeXFormat,\OnlyDescription,\RecordChanges,\usepackage}
% \DoNotIndex{\ProvidesClass,\ProvidesPackage,\ProvidesFile,\RequirePackage}
% \DoNotIndex{\LoadClass,\PassOptionsToClass,\PassOptionsToPackage}
% \DoNotIndex{\DeclareOption,\CurrentOption,\ProcessOptions,\ExecuteOptions}
% \DoNotIndex{\AtEndOfClass,\AtEndOfPackage,\AtBeginDocument,\AtEndDocument}
% \DoNotIndex{\InputIfFileExists,\IfFileExists,\ClassError,\PackageError}
% \DoNotIndex{\ClassWarning,\PackageWarning,\ClassWarningNoLine}
% \DoNotIndex{\PackageWarningNoLine,\ClassInfo,\PackageInfo,\MessageBreak}
% \DoNotIndex{\space,\protect,\DeclareRobustCommand,\CheckCommand}
% \DoNotIndex{\newcommand,\renewcommand,\providecommand,\newenvironment}
% \DoNotIndex{\renewenvironment,\newif,\newlength,\newcounter,\setlength}
% \DoNotIndex{\setcounter,\if,\ifx,\ifcase,\ifnum,\ifdim,\else,\fi}
% \DoNotIndex{\texttt,\textbf,\textrm,\textsl,\textsc,\reset@font}
% \DoNotIndex{\textup,\textit,\textmd,\textsf,\emph,\futurelet}
% \DoNotIndex{\ttfamily,\rmfamily,\sffamily,\mdseries,\bfseries,\upshape}
% \DoNotIndex{\slshape,\scshape,\itshape,\em,\LaTeX,\LaTeXe}
% \DoNotIndex{\filename,\fileversion,\filedate,\let,\makeindex}
% \DoNotIndex{\@auxout,\@for,\@gobble,\@ifnextchar,\@m,\@mkboth,\@nil}
% \DoNotIndex{\@noitemerr,\@tempa,\@tempswafalse,\@tempswatrue,\@warning}
% \DoNotIndex{\advance,\arabic,\AtBeginDocument,\bf,\bibname,\chapter}
% \DoNotIndex{\citation,\clubpenalty,\CodelineNumbered,\csname}
% \DoNotIndex{\DisableCrossrefs,\do,\edef,\else,\endcsname,\endlist}
% \DoNotIndex{\expandafter,\fi,\gdef,\global,\hbox,\hfill,\hskip,\hspace}
% \DoNotIndex{\if,\if@filesw,\if@tempswa,\ifx,\immediate,\itemindent,\labelsep}
% \DoNotIndex{\labelwidth,\lastskip,\leftmargin,\list,\mbox,\newblock}
% \DoNotIndex{\newpage,\p@enumiv,\parindent,\penalty,\refname}
% \DoNotIndex{\relax,\section,\settowidth,\sfcode,\sloppy,\small,\string}
% \DoNotIndex{\theenumiv,\thepage,\unskip,\uppercase,\usecounter,\vskip}
% \DoNotIndex{\widowpenalty,\write,\xdef,\z@,\catcode,\ifnum,\the}
% \DoNotIndex{\.,\@empty,\@ifundefined,\@latex@warning,\@minus,\@plus,\ }
% \DoNotIndex{\document,\@namedef,\@listi,\markboth,\or,\p@}
% \DoNotIndex{\listparindent,\noexpand,\par,\parsep,\pb,\pbf,\pbfseries}
% \DoNotIndex{\pc,\pd,\pem,\pit,\pitshape,\pmdseries,\prm,\prmfamily,\psc}
% \DoNotIndex{\pscshape,\psf,\psffamily,\psl,\pslshape,\ptt,\pttfamily}
% \DoNotIndex{\pupshape,\@iden,\@firstofone,\@unexpandable@protect}
% \DoNotIndex{\&,\{,\},\bibitem,\bibindent,\if@draft,\typeout}
% \DoNotIndex{\@ifclassloaded,\@ifstar,\@onlypreamble,\@preamblecmds}
% \DoNotIndex{\addtolength,\endinput,\@bsphack,\begingroup,\@wrindex}
% \DoNotIndex{\@listctr,\bibname,\enddocument,\hfil,\ignorespaces,\item}
% \DoNotIndex{\NAT@temp,\refname,\stepcounter,\@ifpackageloaded}
% \DoNotIndex{\@gobbletwo,\index,\itemsep,\markright,\scriptsize}
% \DoNotIndex{\textsuperscript,\@undefined}
% \DoNotIndex{\@celt,\@cite@list,\@citea,\@citeb,\@compress@cite}
% \DoNotIndex{\@bsphack,\@esphack,\@h@ld,\@make@cite@list,\@ne}
% \DoNotIndex{\@sort@celt,\@tempcnta,\@tempcntb,\delimiter,\endgroup}
% \DoNotIndex{\ifcat,\m@ne,\number}
% \DoNotIndex{\@markboth,\@mkboth,\nobreak,\SK@,\SK@@citex}
% \DoNotIndex{\SK@@label,\SK@@ref,SK@def,\SK@lbibitem,\bbl@redefine}
% \DoNotIndex{\@safe@activesfalse,\@save@activestrue,\active@prefix}
%
% \setcounter{IndexColumns}{2}
% \setlength{\IndexMin}{10cm}
% \setcounter{StandardModuleDepth}{1}
%
% \hyphenation{par-en-the-ti-cal}
%
% \GetFileInfo{natbib}
%
% \title{{\bfseries Citations et r�f�rences en sciences naturelle}\\
%         (sch�mas auteur--ann�e ou num�rique)}
%    
% \author{Patrick W. \textsc{Daly}\thanks{Traduction Jean-Pierre \textsc{Drucbert}, amend�e par Nicolas \textsc{Le Nov�re} le 12 avril 2000. Titre original :
% {\bfseries Natural Sciences Citations and References} (Author--Year and Numerical Schemes)}}
%         
% \date{Ce papier d�crit le package \texttt{\filename}\\
%       version \fileversion{} du \filedate.
%  }
% 
% \maketitle
%
% \pagestyle{myheadings}
% \markboth{P. W. \textsc{Daly}}{CITATIONS ET R\'EF\'ERENCES EN SCIENCES NATURELLES}
%
% \iffalse % The following lines belong to both the documentation and notes
%<*notes>
% \fi
\newcommand{\btx}{\textsc{Bib}\TeX}
\newcommand{\thestyle}{\texttt{\filename}}
% \iffalse % These lines belong only to the notes
\begin{center}{\bfseries\Large 
    Reference sheet for \thestyle\ usage}\\
    \large(Describing version \fileversion\ from \filedate)
\end{center}

\begin{quote}\slshape
For a more detailed description of the \thestyle\ package, \LaTeX\ the
source file \thestyle\texttt{.dtx}.
\end{quote}
%</notes>
% \fi
%
%^^A In order to keep all marginal notes on the one (left) side:
%^^A (otherwise they switch sides disasterously with twoside option)
% \makeatletter \@mparswitchfalse \makeatother 
%
% \begin{abstract}
% \iffalse % First line is Reference Sheet only, rest for both doc and Ref. Sheet
%<*notes>
\head{Overview}
% \fi
Le package \thestyle\ est une r�implementation de la commande \LaTeX\ |\cite|, 
pour fonctionner � la fois avec les citations auteurs--date et les citations num�riques. 

Il est compatible
avec les styles bibliographiques standard, tels que \texttt{plain.bst}, ainsi qu'avec ceux
pour \texttt{harvard}, \texttt{apalike}, \texttt{chicago}, \texttt{astron}, \texttt{authordate}
et bien s�r \texttt{natbib}.

% \iffalse
%</notes>
% \fi
% Au contraire des packages cit�s ci-dessus, le package \texttt{\thestyle{}} supporte 
% non seulement les divers styles de bibliographie auteur--ann�e, mais �galement 
% ceux pour les citations num�riques standards.  En fait, il peut aussi produire 
% des citations num�riques m�me avec un style bibliographique auteur--ann�e, quelque 
% chose qui permet un passage facile d'un mode de citation � l'autre. Dans ce but, 
% des remplacements pour les fichiers \texttt{.bst} standard de \LaTeX\ sont �galement
% fournis.
% 
% Il est possible de d�finir le \emph{style} de citation (type de crochets autour et de ponctuation
% entre les citations) et m�me de l'associer au nom du style bibliographique afin qu'il soit
% automatiquement activ�. Les styles de citation peuvent �tre d�finis pour des fichiers
% \texttt{.bst} locaux au moyen d'un fichier de configuration
% \label{natbib.cfg}\texttt{natbib.cfg}.
%
% Ce package est compatible avec les packages~: \texttt{babel}, \texttt{index}, \texttt{showkeys},
% \texttt{chapterbib}, \texttt{hyperref}, \texttt{koma} et avec les classes de document
% \texttt{amsbook} et \texttt{amsart}. Il peut �galement �muler les fonctions de tri et de
% compression du paquetage \texttt{cite} (avec lequel il est par contre incompatible).
%
% Le package \thestyle\ agit donc comme une interface unique, souple, pour la plupart des
% styles bibliographiques disponibles.

% \end{abstract}  
% 
% \newpage\tableofcontents\newpage
%
% \section{Introduction}
%
% Le premier probl�me de l'utilisation des citations auteur--ann�e avec le \LaTeX{} standard est
% que les deux formes de citations ne sont pas support�es. Ce sont les formes~:
% \begin{quote}
% textuelle~: \dots\ comme le montre Jones et al. (1990) \dots\\
% parenth�s�e~: Il a �t� montr� (Jones et al., 1990) que \dots
% \end{quote}
% Il n'y a qu'une seule commande \verb|\cite| pour faire les deux travaux.
%
% Un deuxi�me probl�me est que l'environnement \texttt{thebibliography}, pour lister les
% r�f�rences, insiste pour inclure les \emph{labels} dans la liste. Ces labels sont normalement
% les num�ros, n�cessaires pour r�f�rencer. Dans le syst�me auteur--ann�e, ils sont
% superflus\,\footnote{NdT: c'est l'opinion de l'auteur, Patrick W. Daly.} et devraient �tre laiss�s de c�t�.
% Donc, si l'on construisait une bibliographie avec l'auteur--ann�e comme label, comme dans
% \begin{quote}
% \begin{verbatim}
% \begin{thebibliography}{...}
% \bibitem[Jones et all., 1990]{jon90}
% Jones, P. K., . . .
% \end{thebibliography}
% \end{verbatim}
% \end{quote}
% alors \verb|\cite{jon90}| produit la citation parenth�s�e [Jones et al., 1990],
% mais il n'y a pas moyen d'obtenir la citation textuelle. De plus, le texte de citation sera aussi
% inclus dans la liste des r�f�rences.
%
% Le probl�me final est de trouver un style de bibliographie \btx{} qui conviendra.
%
% \section{Solutions ant�rieures}
% \begin{quote}\slshape
% Cette section peut ne pas int�resser tous les utilisateurs. Pour savoir comment utiliser 
% \thestyle\  sans avoir � lire le contexte historique, sautez � la
% section~\ref{sec:usage}.
%\end{quote}
% Bien que le mode de citation auteur--ann�e ne soit pas support� par le \LaTeX\ \emph{standard},
% il y a un certain nombre de packages dans les contributions qui essayent de r�soudre ce
% probl�me. Les divers styles bibliographiques (fichiers \texttt{.bst}) qui existent sont
% habituellement con�us pour �tre utilis�s avec un package \LaTeX\ particulier.
%
% J'ai trouv� sur les serveurs un grand nombre de fichiers \texttt{.bst} qui
% peuvent servir d'indicateurs des divers syst�mes disponibles\,\footnote{NdT: les commentaires
% sur ces diff�rents styles sont ceux de l'auteur, Patrick W. \textsc{Daly}.}.
%
% \subsection{Le style \texttt{natsci.bst}}
%
% Ce qui me donna ma premi�re inspiration fut le style \texttt{natsci.bst} d� �
% Stephen \textsc{Gildea} � utiliser avec son package \texttt{agujgr.sty}.
% Ceci me montra que le probl�me �tait soluble. Cependant le style de \textsc{Gildea} met en page
% \verb|\bibitem| exactement comme je l'ai illustr� au-dessus~: avec un label optionnel form� des
% auteurs abr�g�s et de l'ann�e. Donc seules les citations parenth�s�es peuvent �tre adapt�es. La
% liste des r�f�rences, cependant, est corrig�e dans ses fichiers de style.
%
% \subsection{Le style \texttt{apalike.bst}}
% Oren \textsc{Patashnik}, l'auteur de \btx{} et des fichiers \texttt{.bst}
% standards, a aussi travaill� sur un style auteur--ann�e, appel� \texttt{apalike.bst}, avec un
% package correspondant \texttt{apalike.sty} pour le supporter. Ici encore, seule la
% citation sous forme parenth�s�e est fournie. Except� le fait que son style fonctionne avec la
% version~0.99 de \btx, sa fonctionnalit� est identique � celle des fichiers \texttt{natsci}.
% 
% \textsc{Patashnik} n'aime pas les citations auteur--ann�e. Il le dit tr�s clairement dans ses manuels
% \btx{} et dans l'en-t�te de \texttt{apalike.bst}. N�anmoins, nous devons respecter son
% travail dans ce domaine, simplement parce qu'il devrait �tre le meilleur expert en mati�re de
% \btx. Donc \texttt{apalike.bst} devrait �tre la base pour d'autre styles.
%
% La forme des entr�es de \texttt{thebibliography} dans ce syst�me est
% \begin{quote}
% |\bibitem[Jones et al., 1990]{jon90}...|
% \end{quote}
% la m�me que j'ai illustr� plus haut. C'est la forme minimale qui peut �tre donn�e. Je la 
% nomme variante \texttt{apalike}, d'apr�s \texttt{apalike.bst} et \texttt{apalike.sty} de
% \textsc{Patashnik}. Cependant il pourrait y avoir beaucoup de fichiers \texttt{.bst} ind�pendants qui
% suivent cette voie. 
% Les fichiers de styles bibliographiques appartenant � ce groupe comprennent~:
% \begin{quote}
% \texttt{apalike}, \texttt{apalike2}, \texttt{cea}, \texttt{cell}, 
% \texttt{jmb}, \texttt{phapalik}, \texttt{phppcf}, \texttt{phrmp}
% \end{quote}
% 
% \subsection{Le style \texttt{newapa}}
%
% Un progr�s majeur a �t� accompli avec \texttt{newapa.bst} et le package associ�
% \label{newapa.sty} par Stephen N. \textsc{Spencer} et Young U. \textsc{Ryu}.
% Avec leur syst�me, trois �l�ments distincts d'information sont inclus dans le label de
% \verb|\bibitem|, pour �tre utilis�s � la demande. Ce sont~: la liste compl�te des auteurs, la
% liste abr�g�e et l'ann�e. Ceci est effectu� au moyen d'une commande
% \verb|\citeauthoryear| incluse dans le label, comme par exemple
% \begin{quote}
% |\bibitem[\protect\citeauthoryear{Jones, Barker,|\\
% |  and Williams}{Jones et al.}{1990}]{jon90}...|
% \end{quote}
% En fait, ceci ne fait qu'illustrer la structure de base de \verb|\citeauthoryear|; les fichiers
% \texttt{newapa} vont encore plus loin en rempla�ant certains mots et signes de ponctuation par
% des commandes. Par exemple, le mot �~and~� ci-dessus est en r�alit�
% \verb|\betweenauthors|, quelque chose qui doit �tre d�fini dans le
% fichier \texttt{.sty}. Bien s�r, \verb|\citeauthoryear| est aussi d�fini
% dans ce fichier. Un certain nombre de commandes \verb|\cite| sont disponibles pour imprimer la
% citation avec la liste compl�te des auteurs, avec la liste courte, avec ou sans la date, sous
% la forme textuelle ou parenth�s�e.
% 
% Donc l'entr�e \verb|\citeauthoryear| dans \verb|\bibitem| est tr�s souple, ce qui permet au
% fichier de style d'engendrer chaque forme de citation que l'on peut souhaiter. Elle est
% utilis�e par de nombreux autres styles, avec les fichiers \texttt{.sty} correspondants. Ils
% semblent tous avoir �t� inspir�s par \texttt{newapa.bst}, bien qu'il leur manque les commandes
% suppl�mentaires de ponctuation.
%
% Les fichiers de styles bibliographiques appartenant au groupe \texttt{newapa} comprennent~:
% \begin{quote}
% \texttt{newapa}, \texttt{chicago}, \texttt{chicagoa}, \texttt{jas99}, 
% \texttt{named}
% \end{quote}
% Note: le dernier de ces styles, \texttt{named.bst}, utilise \verb|\citeauthoryear| d'une
% mani�re l�g�rement diff�rente, avec seulement deux arguments~: la liste courte et l'ann�e.
% 
% \subsection{La famille Harvard}
% Le m�me effet est r�alis� selon une approche diff�rente dans la famille de styles
% bibliographiques Harvard. Ici un substitut
% de \verb|\bibitem| est utilis�, comme dans
% \begin{quote}
% \verb|\harvarditem[Jones et al.]{Jones, Baker, and|\\
% \verb|   Williams}{1990}{jon90}...|
% \end{quote}
% Le package d'interface associ� s'appelle \texttt{harvard.sty} et a �t� �crit par
% Peter \textsc{Williams} et Thorsten \textsc{Schnier}. Il d�finit
% \verb|\harvarditem| ainsi que les commandes de citation
% \verb|\cite|, pour les citations parenth�s�es et
% \verb|\citeasnoun| pour les citations textuelles. La premi�re
% citation utilise la liste longue des auteurs, les suivantes la liste plus courte, si elle a �t�
% donn�e dans l'argument optionnel de \verb|\harvarditem|.
% 
% Les fichiers de styles bibliographiques appartenant � la famille Harvard sont~:
% \begin{quote}
% \texttt{agsm}, \texttt{dcu}, \texttt{kluwer}
% \end{quote}
% 
% Ce package a �t� mis � jour pour \LaTeXe, avec de nombreux ajouts pour la souplesse. Le
% r�sultat est une interface puissante qui devrait satisfaire la plupart des besoins concernant
% les citations (il ne supprime cependant pas les auteurs r�p�t�s, comme le fait \thestyle{}).
%
% \subsection{Le style Astronomie}
% R�alisant apparemment les limitations de son syst�me \texttt{apalike}, Oren
% \textsc{Patashnik}\, entreprit de d�velopper un �~vrai~� style bibliographique
% \texttt{apa}, en faisant usage de la m�thode d�j� employ�e par un journal d'astronomie.
% Celui-ci est en fait tr�s semblable au label cr�� par \texttt{newapa} mais avec seulement la
% liste courte des auteurs:
% \begin{quote}
% |\bibitem[\protect\astroncite{Jones et al.}{1990}]{jon90}|\\
% |   ...|
% \end{quote}
% Il n�cessite le package \texttt{astron.sty} ou tout autre package qui
% d�finisse \verb|\astroncite| de mani�re appropri�e.
% Les fichiers de styles bibliographiques appartenant au groupe astronomie sont:
% \begin{quote}
% \texttt{apa}, \texttt{astron}, \texttt{bbs}, \texttt{cbe}, 
% \texttt{humanbio}, \texttt{humannat}, \texttt{jtb}
% \end{quote}
% Ceci est aussi bon que la commande \verb|\citeauthoryear|, bien que moins souple car il manque
% la liste compl�te des auteurs.
% 
% \subsection{Les styles \texttt{authordate}}
% Enfin, j'ai �galement trouv� quelques packages qui font usage d'une commande de label appel�e
% \verb|\citename| sous la forme
% \begin{quote}
% |\bibitem[\protect\citename{Jones et al., }1990]{jon90}|\\
% |    ...|
% \end{quote}
%
% Ce n'est pas un bon syst�me parce que la liste des auteurs et la date ne sont pas nettement s�par�es
% en tant qu'arguments individuels et parce que la ponctuation est incluse dans le texte du
% label. Il est pr�f�rable de conserver la ponctuation totalement retir�e, faisant partie
% des d�finitions dans le fichier \texttt{.sty}, afin d'avoir une souplesse compl�te.
% 
% Les styles bibliographiques appartenant � ce groupe sont:
% \begin{quote}
% \texttt{authordate1}, \texttt{authordate2}, \texttt{authordate3}, 
% \texttt{authordate4}, \texttt{aaai-named}
% \end{quote}
% avec les packages \texttt{authordate1-4.sty}. 
% 
% \section{Le syst�me \thestyle{}}
% La forme de l'entr�e \verb|\bibitem| que j'ai utilis� pour tous mes styles
% bibliographiques est seulement l�g�rement plus compliqu�e que la forme minimale, mais elle
% permet une s�paration claire entre les auteurs et la date:
% \begin{quote}
% |\bibitem[Jones et al.(1990)]{jon90}...|\\[1ex]
% ou alternativement\\[1ex]
% |\bibitem[Jones et al.(1990)Jones, Baker, |\\
% \hspace*{2em}|and Williams]{jon90}...|
% \end{quote}
%
% (Une faiblesse du format \thestyle{} est qu'il �choue si la liste
% d'auteurs contient elle-m�me des parenth�ses! Ceci peut �tre corrig� si la liste
% des auteurs est plac�e entre accolades.)
%
% Je voulais appeler ce syst�me quelque chose comme �~natural sciences bibliography~�,
% ayant l'intention d'en faire une variante de \texttt{natsci.sty}. Puisque ce nom �tait d�j� pris, 
% j'ai d� prendre le nom quelque peu cryptique, et d�finitivement laid, de \thestyle.
%
% Le package \thestyle\texttt{.sty}\footnote{pr�cedemment appel� un \emph{fichier de style} selon l'ancienne terminologie de 
% \LaTeX~2.09} supporte non seulement mon propre format pour \verb|\bibitem|,
% mais aussi tous les autres d�crits dans ce chapitre, plus les modes de citation num�riques.
% Les donn�es suppl�mentaires concernant le style de citation (type de crochets, virgules ou
% points-virgules entre les citations) peuvent �tre d�finies une fois pour toutes pour chaque
% fichier \texttt{.bst} et n'ont jamais besoin d'�tre explicitement notifi�es dans le texte
% source.
% Les commandes \verb|\cite| et leur syntaxe sont toujours celles de \thestyle, m�me
% lorsqu'elles sont utilis�es avec un fichier \texttt{.bst} comme \texttt{chicago.bst} qui
% aurait normalement un autre jeu de commandes (d�finies dans le package \texttt{chicago.sty}).
% Le r�sultat est un seul package \LaTeX{} pour traiter \emph{tous} les styles
% bibliographiques d'une mani�re uniforme.
% 
% Tous les fichiers de style bibliographique auteur--ann�e peuvent aussi �tre utilis�s pour des
% citations \emph{num�riques}, en s�lectionnant simplement le mode de l'une des mani�res d�crites aux
% sections~\ref{sec:bibpunct} et \ref{sec:opts}. Il n'est pas possible d'employer des
% citations auteur-ann�e avec des fichiers \texttt{.bst} purement num�rique, et ce ne le sera
% jamais. Voir la section~\ref{sec:6.0} pour plus d'informations.
% 
% \section{Utilisation du present package}\label{sec:usage}
% 
% \iffalse
%<*notes>
\head{Chargement}
Charger avec |\usepackage[|\emph{options}|]{|\thestyle|}|. Voir la liste des 
\emph{options} � la fin.
%</notes>
% \fi
% Dans ce papier, je fais la distinction entre le \emph{mode} de citation (auteur--ann�e
% ou num�rique) et le \emph{style} de citation (le type de ponctuation utilis� pour les
% citations). Le style de citation est quelque chose qui est ind�pendant du style de
% bibliographie et n'est pas programm� dans les fichiers \texttt{.bst}.
% 
% \subsection{Nouveaux styles de bibliographie}\label{sec:plainnat}
% 
% \iffalse
%<*notes>
\head{Styles de bibliographie de remplacement}
% \fi
Je fournis trois nouveaux fichiers \texttt{.bst} pour remplacer les num�riques standards de \LaTeX{}~:
\begin{quote}\ttfamily
 plainnat.bst \qquad abbrvnat.bst \qquad unsrtnat.bst
\end{quote}
% \iffalse
%</notes>
% \fi
% Ces styles produisent des listes de r�f�rences dans le m�me style que le fichier \texttt{.bst}
% standard correspondant, mais fonctionnent avec \texttt{natbib}. L'avantage est qu'ils peuvent
% �tre utilis�s en mode num�rique et en mode auteur--ann�e.
%
% Ces fichiers \texttt{.bst} ne pr�tendent en aucune mani�re �tre exhaustifs. D'autres fichiers
% de style se conformant au format \texttt{natbib} existent, ou peuvent �tre engendr�s par le
% programme \texttt{custom-bib} (aussi connue sous le nom de \texttt{makebst}.
%
% \subsection{Commandes de citation basiques}
% 
% \DescribeMacro{\citet}
% \DescribeMacro{\citep}
% \iffalse
%<*notes>
\head{Commandes basiques}
% \fi
Le package \thestyle\ offre deux commandes basiques de citation, \verb|\citet| et
\verb|\citep| pour les citations \emph{textuelles} et \emph{parenth�s�es} respectivement.
Il existe aussi les formes �toil�es \verb|\citet*| et \verb|\citep*|
qui impriment la liste compl�te des auteurs, et pas seulement la liste abr�g�e. Toutes ces
commandes acceptent un ou deux arguments optionnels qui ajoutent du texte avant et apr�s la
citation.
\begin{quote}
\begin{tabular}{l@{\quad$\Rightarrow$\quad}l}
  |\citet{jon90}| & Jones et al. (1990)\\
  |\citet[chap.~2]{jon90}| & Jones et al. (1990, chap.~2)\\[0.5ex]
  |\citep{jon90}| & (Jones et al., 1990)\\
  |\citep[chap.~2]{jon90}| & (Jones et al., 1990, chap.~2)\\
  |\citep[see][]{jon90}| & (see Jones et al., 1990)\\
  |\citep[see][chap.~2]{jon90}| & (see Jones et al., 1990, chap.~2)\\[0.5ex]
  |\citet*{jon90}| & Jones, Baker, and Williams (1990)\\
  |\citep*{jon90}| & (Jones, Baker, and Williams, 1990)
\end{tabular}
\end{quote}
% \iffalse
%</notes>
% \fi
% Les formes �toil�es ne peuvent lister la liste compl�te des auteurs que si le fichier
% \texttt{.bst} supporte cette possibilit�; sinon la liste abr�g�e est imprim�e.
%
% En \LaTeX\ standard, la commande \verb|\cite| ne peut prendre qu'un seul argument optionnel
% pour une note apr�s la citation; ici un seul texte optionnel est une note post�rieure, tandis
% que deux donnent une note ant�rieure et une note post�rieure. Pour avoir seulement une note
% ant�rieure, il suffit de fournir une note post�rieure vide, comme indiqu� ci-dessus.
%
% Des m�langes plus complexes de texte et citations peuvent �tre engendr�s par la commande �
% tout faire \verb|\citetext| de la section~\ref{sec:excite}.
% 
% \iffalse
%<*notes>
\head{Citations multiples}
% \fi
Les citations multiples peuvent se faire en incluant plus d'une cl� de
citation dans l'argument de la commande \verb|\cite|. 
% \textsl{Si des citations adjacentes d�signent les m�mes auteurs mais des ann�es diff�rentes, 
% alors les noms d'auteurs ne sont pas r�p�t�s.}
\begin{quote}
\begin{tabular}{l@{\quad$\Rightarrow$\quad}l}
  |\citet{jon90,jam91}| & Jones et al. (1990); James et al. (1991)\\
  |\citep{jon90,jam91}| & (Jones et al., 1990; James et al. 1991)\\
  |\citep{jon90,jon91}| & (Jones et al., 1990, 1991)\\
  |\citep{jon90a,jon90b}| & (Jones et al., 1990a,b)
\end{tabular}
\end{quote}

% \iffalse
\head{Mode num�rique}
% \fi
Ces exemples sont pour le mode de citation auteur--ann�e. En mode num�rique, les r�sultats sont
diff�rents.
\begin{quote}
\begin{tabular}{l@{\quad$\Rightarrow$\quad}l}
  |\citet{jon90}| & Jones et al. [21]\\
  |\citet[chap.~2]{jon90}| & Jones et al. [21, chap.~2]\\[0.5ex]
  |\citep{jon90}| & [21]\\
  |\citep[chap.~2]{jon90}| & [21, chap.~2]\\
  |\citep[see][]{jon90}| & [see 21]\\
  |\citep[see][chap.~2]{jon90}| & [see 21, chap.~2]\\[0.5ex]
  |\citep{jon90a,jon90b}| & [21, 32]
\end{tabular}
\end{quote}
% \iffalse
%</notes>
% \fi
% Les auteurs ne peuvent �tre list�s que si le fichier \texttt{.bst} supporte les citations
% auteurs--ann�e. Les fichiers \texttt{.bst} standard, comme \texttt{plain.bst}, sont uniquement
% num�riques et ne transmettent aucune information auteur--ann�e � \LaTeX. Dans ce cas,
% \verb|\citet| imprime �~\textbf{(author?)}~[21]~�.
% 
% \DescribeMacro{\cite}
% Dans les versions originales de \thestyle, la commande traditionnelle
% \verb|\cite| �tait utilis�e � la fois pour les citations textuelles et
% parenth�s�es. La pr�sence d'un texte optionnel vide entre crochets droits signalait le cas
% parenth�s�. Cette syntaxe a �t� retenue dans un souci de compatibilit�, mais elle n'est plus
% conseill�e.
% 
% Ceci signifie que \verb|\cite| (sans notes) est identique � \verb|\citet| dans le mode
% auteur--ann�e, tandis qu'en mode num�rique, elle est identique � \verb|\citep|. La forme �toil�e,
% comme la syntaxe avec une ou deux notes optionnelles, peut aussi �tre utilis�e.
%
% Il est possible d'avoir des citations multiples tri�es dans le m�me ordre que leur apparition
% dans la liste des r�f�rences, quelque soit leur ordre en tant qu'arguments des commandes
% \verb|\cite|. L'option \texttt{sort} est n�cessaire pour cela; voir la section~\ref{sec:sort}.
% 
% Certaines maisons d'�dition demandent que la premi�re citation de toute r�f�rence donn�e soit
% imprim�e avec la liste compl�te des auteurs, mais que les citations ult�rieures le soient
% toutes avec la liste abr�g�e. Il suffit d'ajouter l'option \texttt{longnamesfirst} pour
% activer cela pour \thestyle. Voir la section~\ref{sec:long}.
% 
% \subsection{Commandes �tendues de citation}
% \label{sec:excite}
% 
% \DescribeMacro{\citealt}
% \DescribeMacro{\citealp}
% \DescribeMacro{\citetext}
% \iffalse
%<*notes>
\head{Parenth�ses supprim�es}
% \fi
Comme autre forme de citation, \verb|\citealt| est analoque � \verb|\citet| mais
\emph{sans aucune parenth�se}, De m�me, \verb|\citealp| est \verb|\citep|
sans les parenth�ses. Les r�f�rences multiples, les notes et les
formes �toil�es existent aussi.
\begin{quote}
\begin{tabular}{l@{\quad$\Rightarrow$\quad}l}
  |\citealt{jon90}| & Jones et al.\ 1990\\
  |\citealt*{jon90}| & Jones, Baker, and Williams 1990\\
  |\citealp{jon90}| & Jones et al., 1990\\
  |\citealp*{jon90}| & Jones, Baker, and Williams, 1990\\
  |\citealp{jon90,jam91}| & Jones et al., 1990; James et al., 1991\\
  |\citealp[pg.~32]{jon90}| & Jones et al., 1990, pg.~32\\
  |\citetext{priv.\ comm.}| & (priv.\ comm.)
\end{tabular}
\end{quote}
La commande \verb|\citetext| permet de placer
du texte arbitraire dans les parenth�ses courantes de citation. Ceci peut �tre utilis� en
combinaison avec \verb|\citealp|.
% Par exemple,
% \begin{verbatim}
% \citetext{voir \citealp{jon90}, 
%   ou encore mieux \citealp{jam91}}
% \end{verbatim}
% pour produire (voir Jones et al., 1990, ou encore mieux James et al., 1991).
%
% \iffalse
%</notes>
% \fi
%
% \DescribeMacro{\citeauthor}
% \DescribeMacro{\citeyear}
% \DescribeMacro{\citeyearpar}
% \DescribeMacro{\citefullauthor}
% \iffalse
%<*notes>
\head{Citations partielles}   
% \fi
Dans les sch�mas auteur--ann�e, il est parfois souhaitable de pouvoir faire r�f�rence aux
auteurs sans l'ann�e, ou vice versa. Ceci est obtenu gr�ce aux commandes suppl�mentaires
\begin{quote}
\begin{tabular}{l@{\quad$\Rightarrow$\quad}l}
  |\citeauthor{jon90}| & Jones et al.\\
  |\citeauthor*{jon90}| & Jones, Baker, and Williams\\
  |\citeyear{jon90}|   & 1990\\
  |\citeyearpar{jon90}| & (1990)
\end{tabular}
\end{quote}
% \iffalse
%</notes>
% \fi
% Il existe aussi une commande \verb|\citefullauthor| qui est �quivalente �
% \verb|\citeauthor*|.
% 
% Si les informations compl�tes sur les auteurs sont manquantes, alors \verb|\citeauthor*| est
% identique � \verb|\citeauthor|, n'imprimant que la liste abr�g�e. Ceci s'applique �galement
% aux formes �toil�es de \verb|\citet| et \verb|\citep|.
% 
% Si l'information auteur ou ann�e est manquante (comme c'est le cas avec les fichiers
% \texttt{.bst} du \LaTeX{} standard), ces commandes �mettent un avertissement.
%
% \medskip\noindent
% \textbf{Note~:}
% ces commandes peuvent aussi �tre utilis�es avec des
% citations num�riques, pourvu qu'un fichier \texttt{.bst} auteur--ann�e soit utilis�.
%
% \medskip\noindent
% \textbf{Note:} toutes les commandes \verb|\cite...| ont la m�me syntaxe,
% permettant les citations multiples et au plus deux notes (il n'y a cependant pas de forme �toil�e
% de \verb|\citeyear|). Cela n'a pas grande signification d'ajouter des notes � \verb|\citeyear|
% ou \verb|\citeauthor|, en particulier avec des citations multiples; cependant il est possible
% de le faire, et il n'y aura pas de message d'erreur, mais les r�sultats sont parfois �tranges.
% Par exemple, en mode num�rique, les notes sont compl�tement ignor�es, tandis qu'en mode
% auteur--ann�e, seule la note post�rieure est accept�e. Les citations multiples dans
% \verb|\citet| ne sont pas non plus recommand�es (et n'ont, selon moi, aucun sens), mais si elles sont
% utilis�es avec des notes, la note ant�rieure appara�tra avant chaque ann�e, et la note
% post�rieure seulement apr�s la derni�re ann�e. Il faut admettre que ce sont des erreurs, mais
% l'effort n�cessaire pour les �liminer ne se justifie pas par l'utilit� contestable de ces
% possibilit�s.
%
% En r�sum�, les notes sont destin�es seulement � \verb|\citep| mais peuvent aussi �tre utilis�es
% avec \verb|\citet| en mode auteur--ann�e, avec des citations simples. Dans toute autre
% situation, les r�sultats sont impr�visibles.
% 
% \DescribeMacro{\Citet}
% \DescribeMacro{\Citep}
% \DescribeMacro{\Citealt}
% \DescribeMacro{\Citealp}
% \DescribeMacro{\Citeauthor}
% \subsection{Forcer les noms en majuscules}
% \iffalse
%<*notes>
\head{Forcer les noms en majuscules}
% \fi
Si le nom du premier auteur contient une partie \textsl{von}, comme dans �~della Robbia~�,
alors \verb|\citet{dRob98}| produit �~della Robbia (1998)~�, m�me au d�but d'une phrase. Vous
pouvez forcer la premi�re lettre � �tre une majuscule en utilisant plut�t la commande
\verb|\Citet|. D'autres commandes pour forcer une majuscule existent:
\begin{quote}
\begin{tabular}{rl@{\quad$\Rightarrow$\quad}l}
  when & |\citet{dRob98}| & della Robbia (1998) \\
  then & |\Citet{dRob98}| & Della Robbia (1998) \\
     &   |\Citep{dRob98}| & (Della Robbia, 1998) \\
     &   |\Citealt{dRob98}| & Della Robbia 1998 \\
     &   |\Citealp{dRob98}| & Della Robbia, 1998 \\
     &   |\Citeauthor{dRob98}| & Della Robbia 
\end{tabular}
\end{quote}
Ces commandes existent aussi en forme �toil�e pour les noms complets des auteurs
% \textbf{Note:} le codage des commandes de passage en majuscule est compliqu� et probablement
% erron�. Il op�re sur les noms qui sont rang�s dans l'entr�e \verb|\bibitem| et fonctionne m�me
% si des commandes de fontes de l'ancien style sont utilis�es; cependant les commandes
% \textsf{\textbf{NFSS}} provoqueront un plantage; donc 
% \begin{tabular}{ll}
%   |\bibitem[{\it della Robbia}(1998)]{dRob98}| & fonctionne, mais \\
%   |\bibitem[\textit{della Robbia}(1998)]{dRob98}| & plante.
% \end{tabular}
% J'esp�re am�liorer cette situation dans le futur.
% 
% \iffalse
%</notes>
% \fi
%
% \subsection{Alias de citation}
% \DescribeMacro{\defcitealias}
% \DescribeMacro{\citetalias}
% \DescribeMacro{\citepalias}
% \iffalse
%<*notes>
\head{Alias de citation}
% \fi
On souhaite parfois citer une r�f�rence avec une d�signation sp�ciale, au lieu de le faire par
les auteurs. par exemple, sous Papier~I, Papier~II. De tels alias peuvent �tre d�finis et
utilis�s, dans le texte et/ou entre parenth�ses avec:
\begin{quote}
\begin{tabular}{lcl}
  |\defcitealias{jon90}{Paper~I}|\\
  |\citetalias{jon90}| & $\Rightarrow$ & Paper~I\\
  |\citepalias{jon90}| & $\Rightarrow$ & (Paper~I)
\end{tabular}
\end{quote}
Ces commandes de citation fonctionnent tout comme \verb|\citet| et \verb|\citep|: elles peuvent
prendre plusieurs cl�s dans l'argument, peuvent contenir des notes et sont marqu�es comme
hyper-liens.
% \iffalse
%</notes>
% \fi
% 
% Un avertissement est �mis si l'alias est utilis� avant qu'il soit d�fini, ou si un alias est
% red�fini pour une citation donn�e. Aucun n'avertissement n'est �mis si un alias est d�fini
% pour une cl� de citation qui n'existe pas; l'avertissement viendra lorsque l'alias sera utilis�!
% 
% Voir la section~\ref{sec:yearless} pour d'autres m�thodes de citation avec un nom de code.
%
% \subsection{R�f�rences sans auteur et sans ann�e}\label{sec:yearless}
% Que doit-on faire des r�f�rences qui n'ont pas d'auteur? Ceci m'a longtemps ennuy� 
% mais j'ai une suggestion. Les styles \BibTeX\ standards font usage d'un champ \texttt{KEY}
% dans les entr�es, champ � utiliser pour classer alphab�tiquement lorsque auteurs et �diteurs
% sont manquants. Les styles auteur--ann�e vont encore plus loin et ins�rent le champ
% \texttt{Key} � la place des auteurs. On peut � ce moment imaginer de donner un code de
% d�signation pour le document. Par exemple,
% \begin{quote}
% \begin{verbatim}
% @MANUAL{handbk98,
%   title = {Assembling Computers},
%   year = 1998,
%   organization = {MacroHard Inc.},
%   key = "MH-MAN"
% }
% \end{verbatim}
% \end{quote}
% Avec le style bibliographique \texttt{plain}, le texte de la cl� \texttt{MH-MAN} n'est utilis�
% que pour classer la r�f�rence, mais avec le style bibliographique \texttt{plainnat} et
% d'autres styles auteur--ann�e, il est utilis� � la place des auteurs. On peut alors y faire
% r�f�rence par~\verb|\citeauthor{handbk98}| pour obtenir MH-MAN ou par
% \verb|\citetext{\citeauthor{handbk98}}| pour obtenir (MH-MAN), une citation parenth�s�e.
% 
% Ceci peut �tre grandement simplifi� si le style bibliographique laisse la date en blanc dans
% l'entr�e \verb|\bibitem|, comme dans
% \begin{quote}
% |\bibitem[MH-MAN()]{handbk98}|
% \end{quote}
% car alors \thestyle\ supprime la date, la ponctuation pr�c�dente et les accolades pour
% \verb|\citet|. Cela signifie que \verb|\citet| et \verb|\citep| se comportent automatiquement
% comme dans les deux exemples ci-dessus. La date peut encore appara�tre dans le texte de la
% r�f�rence.
% 
% Les styles bibliographiques de \thestyle\ ont �t� modifi�s en cons�quence pour omettre
% la date de l'entr�e \verb|\bibitem| lorsque les auteurs et/ou �fiteurs sont remplac�s par le
% texte de la cl�.
% 
% De m�me, si l'ann�e est manquente, elle sera laiss�e en blanc dans l'entr�e \verb|\bibitem|;
% donc citer un tel document ne produira que les noms des auteurs.

% \textbf{Note:} il y a de nombreuses autres possibilit�s avec ce dispositif. On peut m�me
% produire des citations comme celles du style bibliographique \texttt{alpha}, en pla�ant le
% code de citation � la place des auteurs dans l'entr�e \verb|\bibitem| et en laissant l'ann�e
% en blanc. Un deuxi�me code (ou peut-�tre m�me les auteurs eux-m�mes) pourrait �tre plac� l� ou
% appara�t normalement la liste compl�te des auteurs, pour �tre imprim� avec la forme �toil�e des
% commandes \verb|\cite|. Par exemple,
% \begin{quote}
% |\bibitem[MH-MAN()MacroHard Inc.]{handbk98}|
% \end{quote}
% 
% \subsection{Dispositifs suppl�mentaires dans la famille \texttt{plainnat}}\label{sec:url}
%
% Les fichiers \texttt{.bst} sp�ciaux pour \thestyle\ mentionn�s dans la
% section~\ref{sec:plainnat} ont de nombreux champs suppl�mentaires par rapport aux fichiers
% d'origine: \\
% \begin{tabular}{ll}
% \texttt{ISBN} & pour le num�ro ISBN dans les livres,\\
% \texttt{ISSN} & pour le num�ro ISSN dans les p�riodique,\\
% \texttt{URL} & pour l'adresse Internet des documents en ligne.
% \end{tabular}
% L'adresse Internet est compos�e dans une fonte machine � �crire et conduit souvent � des
% probl�mes de coupure de ligne. Il est conseill� de charger le package \texttt{url} de Donald 
% \textsc{Arseneau}, qui permet au texte en fonte
% machine � �crire d'�tre coup� sur les marques de ponctuation. Les adresses URL sont compos�es
% avec la commande \verb|\url| dans ce package, mais s'il n'est pas charg�, alors \verb|\url|
% est d�fini comme �tant \verb|\textttt|, sans coupure de ligne.
% 
% Comme le signale la section~\ref{sec:yearless}, le champ \texttt{KEY} est trait�
% diff�remment par \texttt{plainnat} et par \texttt{plain}. Tandis que ce dernier utilise ce
% champ seulement pour classer alphab�tiquement les entr�es sans auteur, 
% \texttt{plainnat} l'ins�re vraiment � la place de l'auteur, les deux dans le texte de
% r�f�rence et dans le label de citation (entr�es \verb|\bibitem|). De plus, l'ann�e est laiss�e
% vide dans \verb|\bibitem| afin que \verb|\citep| n'imprime que le texte �~author~�, qui est
% maintenant le champ \texttt{KEY}. Ce devrait �tre un certain code pour d�signer le document
% cit�.
% 
% \subsection{S�lection de la ponctuation pour les citations}\label{sec:bibpunct}
%
% \DescribeMacro{\bibpunct}
% Les exemples ci-dessus ont �t� imprim�s avec le style de citation par d�faut. Il est possible
% d'en changer, comme de choisir le mode num�rique ou auteur--ann�e, au moyen
% de la commande \verb|\bibpunct|, qui prend un argument optionnel et
% 6~arguments obligatoires. Les arguments obligatoires sont :
% \iffalse
%<*notes>
\head{S�lection du style de citation et de la ponctuation}
Utilisez la commande |\bibpunct| avec un argument optionnel et
6~arguments obligatoires :
% \fi
\begin{enumerate}
\item le symbole crochet ouvrant, par d�faut �~\verb|(|~�;
\item le symbole crochet fermant, par d�faut~�~\verb|)|~�;
\item la ponctuation entre des citations multiples, par d�faut~�~\verb|;|~�;
\item la lettre �~\texttt{n}~� pour le style num�rique, ou �~\texttt{s}~� pour le style num�rique en exposant, 
                ou toute autre lettre pour
                auteur--ann�e, par d�faut auteur--ann�e; notez qu'il n'est pas n�cessaire de
                sp�cifier quelle interface auteur--ann�e est utilis�e, car toutes seront
                reconnues;    
\item la ponctuation qui vient se placer entre les noms d'auteurs et l'ann�e (cas parenth�s�
                seulement), par d�faut~�~\verb|,|~�;
\item la ponctuation qui vent se placer entre les ann�es lorsque des listes d'auteurs communes
                sont supprim�es (par d�faut �~\verb|{,~}|�); 
%               si � la fois auteurs et ann�es sont
%               communs, la citation est imprim�e sous la forme �~\verb|1994a,b|~�, mais si un
%               espace est demand� entre les lettres suppl�mentaires, alors incluez l'espace
%               dans l'argument, comme dans \verb|{,~}|.
% 
%                Pour le mode num�rique, \verb|\citet{jon90,jon91}| produit
%               �~Jones et al.\ [21, 22]~� avec cette ponctuation entre les num�ros. Un espace est
%               automatiquement inclus pour les num�ros, mais pas pour les exposants.

\end{enumerate}

L'argument optionnel est le caract�re qui pr�c�de une note post�rieure; par d�faut, c'est une virgule
plus un espace. En red�finissant ce caract�re, il faut inclure un espace si vous en voulez
un.

% la commande \verb|\bibpunct| doit �tre appel�e dans le pr�ambule donc
% \emph{avant} \verb|\begin{document}|.

Example~1, |\bibpunct{[}{]}{,}{a}{}{;}| change la sortie de
\begin{quote}
  |\citep{jon90,jon91,jam92}| 
\end{quote}
en [Jones et al. 1990; 1991, James et al. 1992].

Example~2, |\bibpunct[; ]{(}{)}{,}{a}{}{;}| change la sortie de
\begin{quote}
  |\citep[and references therein]{jon90}| 
\end{quote}
en (Jones et al. 1990; and references therein).

% \iffalse
%</notes>
% \fi
% 
% \DescribeMacro{\bibstyle@xxx}
% Habituellement le style de citation est d�termin� par le journal pour lequel vous �crivez, et
% fait autant partie du style de bibliographie que tout le reste. Le package \thestyle{} 
% permet que les d�finitions de ponctuation soient directement coupl�es � la commande
% \verb|\bibliographystyle| qui doit toujours �tre pr�sente lorsque
% \btx{} est utilis�. C'est cette commande qui s�lectionne le fichier \texttt{.bst}; en
% ajoutant un tel couplage  � \thestyle{} pour tout fichier \texttt{.bst} que l'on pourrait
% vouloir utiliser, il n'est pas n�cessaire d'ajouter \verb|\bibpunct| explicitement dans le
% document lui-m�me, sauf bien s�r si vous voulez passer outre les valeurs par d�faut.
% 
% Un tel couplage est r�alis� en d�finissant une commande
% \verb|\bibstyle@|\emph{ .bst}, o� \emph{bst\/} est le nom du
% fichier \texttt{.bst}. Par exemple, l'American Geophysical Union (AGU) demande dans ses publications
% que les citations soient faites avec des crochets droits et s�par�es par des points-virgules. Il
% y a donc un fichier \texttt{agu.bst} pour effectuer la plus grande partie de la
% mise en forme, mais de telles ponctuations ne sont pas incluses dans ce fichier. En revanche,
% \thestyle{} a la d�finition
% \begin{quote}
% |\newcommand{\bibstyle@agu}{\bibpunct{[}{]}{;}{a}{,}{,~}}|
% \end{quote}
% 
% Ces styles d�finissant des commandes peuvent contenir plus que simplement \verb|\bibpunct|.
% Certains sch�mas de citation num�riques n�cessitent encore plus de modifications. Par exemple,
% le journal \textsl{Nature} non seulement utilise des nombres en exposant pour les citations, il
% imprime aussi les num�ros dans la liste des r�f�rences sans les crochets droits habituels.
% Pour s'adapter � cela, \thestyle{} contient la d�finition de style
% \begin{quote}\begin{verbatim}
% \newcommand{\bibstyle@nature}%
%     {\bibpunct{}{}{,}{s}{}{\textsuperscript{,}}%
%      \gdef\NAT@biblabelnum##1{##1.}}
% \end{verbatim}
% \end{quote}
% La commande red�finie \verb|\NAT@biblabelnum| sp�cifie comment les
% num�ros des r�f�rences doivent �tre mis en forme dans la liste des r�f�rences elle-m�me. La
% red�finition doit �tre faite avec \verb|\gdef|, mais pas avec \verb|\def| ni
% \verb|\renewcommand|.
% 
% Le style de ponctuation s�lectionn� et les autres red�finitions ne seront pas effectives lors
% de premi�re ex�cution de \LaTeX, car elles sont m�moris�es dans le fichier auxiliaire
% en vue de l'ex�cution suivante.
% 
% L'utilisateur peut ajouter beaucoup de telles d�finitions de lui-m�me, pour s'adapter aux
% journaux et fichiers \texttt{.bst} qu'il a. Il peut soit les ajouter � sa copie locale de
% \thestyle\texttt{.sty}, ou mieux les
% placer dans un fichier nomm� \thestyle\texttt{.cfg}. Ce fichier sera lu s'il
% existe, en ajoutant toutes configurations locales. Donc de telles configurations pourront
% survivre aux mises � jour futures du package. (Ce pour \LaTeXe{} seulement.)
%
% \medskip
% \noindent\textbf{Note:} 
% tout appel explicite � \verb|\bibpunct| a priorit� sur les
% styles de citation pr�d�fini.
% 
% \DescribeMacro{\citestyle}
% Un style de citation pr�programm� est normalement invoqu� par la commande classique
% \verb|\bibliographystyle|,
% comme d�crit ci-dessus. Cependant, il se peut que l'on veuille appliquer un certain style de
% citation � un autre style de bibliographie. Ceci peut �tre fait avec
% \verb|\citestyle|, plac�e \emph{avant} \verb|\begin{document}|. Par
% exemple, pour utiliser le style bibliographique \texttt{plainnat} (pour la liste des
% r�f�rences) avec le style \textsl{Nature} de citations (exposants),
% \begin{quote}
% |\documentclass{article}|\\
% |\usepackage{|\thestyle|}|\\
% |. . . . .|\\
% |\citestyle{nature}|\\
% |\begin{document}|\\
% |\bibliographystyle{plainnat}|\\
% |. . . . .|
% \end{quote}
% 
% \noindent
% \textbf{Note:} toutes les modifications au style de
% citation, y compris la ponctuation, doivent �tre faites \emph{avant} \verb|\begin{document}|,
% qui g�le le style de citation.
%
% \subsection{Priorit� des commandes de style}\label{sec:priority}
% Le style de citation (ponctuation et mode) peut �tre s�lectionn� au moyen des commandes
% \verb|\bibpunct|, \verb|\citestyle| et de commandes pr�d�finies \verb|\bibstyle@|\textit{bst}.
% Ces �l�ments peuvent aussi �tre s�lectionn�s par des options \LaTeXe{} (voir la
% section~\ref{sec:opts}). Que se passe-t-il s'il y a plusieurs s�lections en conflit?
% 
% La prorit� la plus basse est affect�e aux commandes pr�d�finies \verb|\bibstyle@|\textit{bst},
% puisqu'elles sont implicites et non directement visibles par l'utilisateur. Les options
% \LaTeXe{} ont la priorit� suivante. Enfin, toute s�lection faite par \verb|\bibpunct| et/ou
% \verb|\citestyle| outrepasse celles des autres m�thodes.
% 
% \subsection{Autres options de mise en forme}
% 
% \iffalse
%<*notes>
\head{Autres options de mise en forme}
% \fi
%
% \DescribeMacro{\bibsection}
% La liste des r�f�rences appara�t normalement comme une \verb|\section*| ou un \verb|\chapter*|
% selon la classe du document. Si vous voulez concevoir votre propre mis en page du titre, disons
% une section num�rot�e avec \verb|\section|, alors la commande
% \verb|\bibsection| peut �tre red�finie en cons�quence par l'utilisateur.
%
% \iffalse
Red�finit \verb|\bibsection| � la commande de sectionnement d�sir�e pour introduire 
la listes des r�f�rences. C'est normalement |\section*| ou |\chapter*|.
% \fi
% 
% \DescribeMacro{\bibpreamble}
% Un pr�ambule apparaissant apr�s l'en-t�te \verb|\bibsection| peut �tre ins�r� avant la vraie
% liste des r�f�rences en d�finissant \verb|\bibpreamble|. Il appara�tra
% dans la fonte du texte normal, � moins qu'il ne contienne des d�clarations de fontes.
% La fonte d�finie par \verb|\bibfont| s'applique � la liste de r�f�rences, non � ce
% pr�ambule.
% 
% \iffalse
D�finit |\bibpreamble| comme �tant tout texte devant �tre imprim� apr�s l'en-t�te
mais avant la liste de r�f�rences proprement dite.

% \fi
%
% \DescribeMacro{\bibfont}
% La liste des r�f�rences est normalement imprim�e dans la m�me taille et le m�me style de fonte que
% le corps principal du texte. Cependant, il est possible de d�finir
% \verb|\bibfont| comme �tant des commandes de fonte qui seront activ�es � l'int�rieur
% de l'environnement \texttt{thebibliography} apr�s tout pr�ambule.
% Par exemple,
% \begin{quote}
% \verb|\newcommand{\bibfont}{\small}|
% \end{quote}
% \iffalse
D�finit \verb|\bibfont| comme une d�claration de fonte, e.g.\ \verb|\small| � appliquer � la liste
de r�f�rences.

% \fi
%
% \DescribeMacro{\citenumfont}
% Les citations num�riques peuvent �tre imprim�es dans une fonte diff�rente. D�finissez
% \verb|\citenumfont| comme �tant une d�claration de fonte par exemple
% \verb|\itshape| ou m�me une commande prenant des arguments comme \verb|\textit|.
% \begin{quote}
% |\newcommand{\citenumfont}[1]{\textit{#1}}|
% \end{quote}
% Cette derni�re d�claration est meilleure que \verb|\itshape| puisqu'elle ajoute
% automatiquement la correction italique.
% \iffalse
D�finit |\citenumfont| comme �tant une d�claration de fonte ou une commande, par exemple |\itshape| 
ou |\textit|.

% \fi
%
% \DescribeMacro{\bibnumfmt}
% Le format du listing num�rique dans la liste de r�f�rence peut aussi �tre chang� de celui par
% d�faut [32] en red�finissant \verb|\bibnumfmt|, par exemple
% \begin{quote}
% |\renewcommand{\bibnumfmt}[1]{\textbf{#1}:}|
% \end{quote}
% pour obtenir \textbf{32}: � la place.
% \iffalse
Red�finit \verb|\bibnumfmt| comme une commande avec un argument 
pour formater les nombres dans la liste de r�f�rences. La d�finition par d�faut est 
|[#1]|.

% \fi
%
% \DescribeMacro{\bibhang}
% La liste des r�f�rences pour les styles auteur--ann�e utilise un format avec indentation pendante:
% la premi�re ligne de chaque r�f�rence est en fer � gauche, les lignes suivantes sont compos�es
% avec une indentation par rapport � la marge gauche. Cette indentation est de 1~em par d�faut et
% peut �tre modifi�e (par \verb|\setlength|) en changeant le param�tre longueur
% \verb|\bibhang|.
%
% \iffalse
L'indentation apr�s la premi�re ligne de chaque r�f�rence est d�finie par 
\verb|\bibhang|; changez cela avec la commande \verb|\setlength|.

% \fi
% \DescribeMacro{\bibsep}
% L'espacement vertical entre les r�f�rences dans la liste, que ce soit en style auteur--ann�e ou
% num�rique, est contr�l� par la longueur \verb|\bibsep|. Si elle est r�gl�e
% �~0~pt, il n'y a pas d'espacement suppl�mentaire entre les r�f�rences. 
% L'espacement par d�faut d�pend de la
% taille de fonte choisie dans \verb|\documentclass|, et est presque �quivalente � une ligne blanche.
% Ce param�tre s'ajuste � l'aide de la commande \verb|\setlength|.
% 
% \iffalse
L'espacement vertical entre les r�f�rences est r�gl� par \var|\bibsep|; changez cela avec
la commande \verb|\setlength|.

%</notes>
% \fi
%
% \subsection{Indexation automatique des citations}
% 
% \DescribeMacro{\citeindextrue}
% \DescribeMacro{\citeindexfalse}
% \iffalse
%<*notes>
\head{Indexation automatique des citations}
% \fi
Si l'on d�sire que les citations soient ajout�es au fichier d'indexation
\texttt{.idx}, il est seulement n�cessaire de placer la commande
\verb|\citeindextrue| en un point quelconque du document. Toutes les
commandes \verb|\cite| subs�quentes, dans toutes leurs variantes, ins�reront 
alors l'entr�e correspondante dans ce fichier. Avec \verb|\citeindexfalse|, 
ces entr�es ne seront plus cr��es.

% \iffalse
%</notes>
% \fi
% Les commandes \verb|\bibitem| dans l'environnement \texttt{thebibliography} cr�eront �galement des
% entr�es dans l'index. Si ceci n'est pas souhait�, placez une commande \verb|\citeindexfalse|
% avant \verb|\bibliography| ou \verb|\begin{thebibliography}|.
% 
% Bien entendu, il faut aussi appeler \verb|\makeindex| dans le pr�ambule pour
% activer l'indexation, comme d'habitude. Dans le cas contraire aucune indexation n'est effectu�e.
%
% Assurez vous que le document a �t� trait� au moins deux fois apr�s la derni�re ex�cution de
% \btx\ avant de lancer le programme \textbf{makeindex}.
% 
% \DescribeMacro{\NAT@idxtxt}
% Le format des entr�es dans l'index est �tabli par la commande interne
% \verb|\NAT@idxtxt|, qui peut �tre red�finie par les astucieux (dans le
% fichier \texttt{natbib.cfg} s'il vous plait). Par d�faut, elle imprime la liste courte
% des auteurs plus la date dans le style parenth�s� courant.
% 
% Le package \thestyle\ peut �galement �tre utilis� avec le package \texttt{index}
% de David M.~Jones. L'ordre de chargement des packages est sans importance.
%
% \DescribeMacro{\citeindextype}
% Dans ce package, les listes d'index multiples peuvent �tre cr��es au moyen d'une commande
% \verb|\newindex|. Par exemple, il peut �tre souhaitable de placer toutes
% les entr�es d'index pour les citations dans une liste distincte. D'abord cette liste doit �tre
% initialis�e par
% \begin{quote}
%    |\newindex{cite}{ctx}{cnd}{Liste des Citations}|
% \end{quote}
% puis l'indexation automatique des citations est associ�e � cette liste avec la commande
% suivante du package \thestyle\
% \begin{quote}
%    |\renewcommand{\citeindextype}{cite}|
% \end{quote}
% Voyez la documentation du package \texttt{index.sty} pour les d�tails.
% 
% \subsection{Compatibilit� avec Hyper\TeX}
% Le package \thestyle\ est compatible avec le package \texttt{hyperref} 
% de Sebastian Rahtz, pour une utilisation avec \LaTeX\ $\rightarrow$ conversions HTML, pdf\TeX, \texttt{pdfmark}.
% La compatibilit� est de nature mutuelle: les deux packages contiennent du
% code qui interagit avec celui de l'autre.
%
% Il y a une option sp�ciale \texttt{nonamebreak} qui peut �tre utilis�e avec le package
% \texttt{hyperref}; elle conserve tous les noms d'auteurs dans une citation sur une seule
% ligne, ce qui �vite certains probl�mes avec pdf\TeX. Mais sinon elle n'est pas recommand�e,
% car elle entraine de nombreuses lignes qui d�bordent.
%
% \subsection{Bibliographies multiples dans un m�me document}\label{sec:chapbib}
% 
% \iffalse
%<*notes>
\head{Utilisation du package \texttt{chapterbib}}
% \fi

% Le package \thestyle\  est compatible avec le package \texttt{chapterbib}  
% de Donald Arseneau et Niel Kempson,\relax
% \footnote{J'ain utilis� la version 1.5 du 1995/10/09; Je ne peux pas garantir 
% les versions pr�c�dentes.}
% qui permet d'avoir plusieurs bibliographies dans un m�me document.
% L'application usuelle est d'avoir des bibliographies dans chaque chapitre d'un livre, en
% particulier s'ils ont �t� �crits par des auteurs diff�rents.
% 
% Le package \texttt{chapterbib} fonctionne d'une mani�re tr�s naturelle pour l'auteur; seul
% l'�diteur qui met ensemble tous les chapitres en un seul livre a un peu de travail
% suppl�mentaire.
% Ce paquetage utilise la commande \verb|\include| et c'est en fait chaque
% fichier inclus par cette commande qui a sa propre bibliographie. Pour de gros livres, il est de
% toutes fa�ons tr�s raisonnable de tirer avantage de cette fonctionnalit�.
% 
% Pour l'utilisation de la commande \verb|\include|, 
% rappelez vous que le fichier principal
% \begin{verbatim}
%   \documentclass{...}
%   \includeonly{ch2}
%   \begin{document}
%     \include{ch1}
%     \include{ch2}
%     \include{ch3}
%   \end{document}
% \end{verbatim}
% ne traitera que le fichier \texttt{ch2.tex} comme si les fichiers \texttt{ch1.tex} et
% \texttt{ch3.tex} �taient aussi pr�sents.
% En fait tous les compteurs, en particulier les compteurs de page et de section, fonctionneront
% comme si le document complet �tait trait�. L'astuce est que chaque fichier inclus par \verb|\include|
% a son propre fichier \texttt{.aux} contenant ces d�finitions, et qu'elles sont lues chaque
% fois, m�me si le fichier \texttt{.tex} ne l'est pas. Les fichiers \texttt{.aux} contiennent
% aussi les informations de citation pour \btx, chose que le paquetage \texttt{chapterbib}
% exploite.
% 
% Si le package \texttt{chapterbib} a �t� charg�, les cl�s dans chaque commande \verb|\cite| et
% \verb|\bibitem| sont associ�es au fichier inclus par \verb|\include| courant et sont
% distingu�es des cl�s identiques dans un fichier inclus diff�rent. Chacun de ces fichiers doit
% contenir ses propres commandes \verb|\bibliography| et \verb|\bibliographystyle|. On ex�cute
% \btx\ sur chaque fichier s�par�ment avant de le traiter par \LaTeX\ (au moins deux fois).
% 
% \subsubsection{Consid�rations sp�ciales pour \thestyle\ et \texttt{chapterbib}}
 
L'ordre dans lequel les packages \texttt{natbib} et \texttt{chapterbib} est sans importance.

Le package \texttt{chapterbib} offre une option \texttt{sectionbib} qui met la bibliographie
dans une \verb|\section*| au lieu d'un \verb|\chapter*|, chose qui a un sens s'il y a une
bibliographie dans chaque chapitre. Cette option ne marchera pas si \thestyle\ est
�galement charg�; il faut plut�t ajouter cette option pour \thestyle. 
% (L'option
% \texttt{sectionbib} peut toujours �tre donn�e, mais elle n'a de signification que pour les
% classes \texttt{book} et \texttt{report}, et celles qui en d�rivent.)

Chaque fichier inclus par \verb|\include|
doit contenir sa propre commande
\verb|\bibliography| l� o� devra appara�tre la bibliographie. Les fichiers bases de donn�es
list�s comme arguments de cette commande peuvent �tre diff�rents dans chaque fichier, bien s�r.
Cependant, ce qui n'est pas �vident, est que chaque fichier doit aussi contenir une commande
\verb|\bibliographystyle|, \emph{de pr�f�rence avec le m�me argument style}. 
% Si des styles
% bibliographiques diff�rents sont sp�cifi�s pour les diff�rents fichiers, alors le style
% pr�programm� de citation (ponctuation et mode de citation) sera celui du premier style
% bibliographique donn�. Les styles pr�programm�s de citation ne peuvent �tre chang�s que dans le
% pr�ambule (voir la section~\ref{sec:priority}), ce qui garantit un style uniforme pour
% l'ensemble du document\,\footnote{Il serait relativement facile de permettre des modifications
% du style n'importe o� dans le document, mais cela me choque comme �tant une
% mauvaise politique. Cependant cela est fourni par l'option \texttt{nopreonly} de
% \texttt{docstrip}}.
%
% \iffalse
%</notes>
% \fi
%
% \subsection{Tri et compression des citations num�riques}
% \label{sec:sort}
% 
% Un autre package de Donald Arseneau, \texttt{cite.sty}, r�-impl�mente l'ensemble du syst�me 
% de citation (num�rique) pour que l'on
% puisse contr�ler la ponctuation et le format de citation, choses qui sont aussi faites par
% \thestyle\. Cependant, il peut aussi trier et comprimer les citations num�riques, chose
% qui est demand�e par certains journaux.
% 
% Ceci signifie que lorsque plusieurs citations sont donn�es dans une seule commande
% \verb|\cite|, l'ordre normal des num�ros est la s�quence donn�e. C'est en g�n�ral une suite
% quelconque de nombres, comme \mbox{[4,2,8,3]}. Avec le package \texttt{cite}, cette liste
% devient \mbox{[2--4,8]}.
% 
% Il est impossible de rendre les packages \texttt{cite} et \thestyle\ compatibles,
% puisque les deux red�finissent compl�tement \verb|\cite|. A la place j'ai donc repris une
% partie du code de \texttt{cite.sty}, en le modifiant pour \thestyle{}. Ce code est activ�
% en sp�cifiant l'une des options \texttt{sort} ou \texttt{sort\&compress} dans la commande
% \verb|\usepackage|.
% 
% Pour les citations auteur--ann�e, l'option \texttt{sort} classe les citations dans une m�me
% commande \verb|\citep| ou \verb|\citet| dans l'ordre o� elles apparaissent dans la liste des
% r�f�rences. C'est normalement d'abord par ordre alphab�tique, puis par ann�e. Ceci devrait
% �viter des citations du type: �~James et~al.\ (1994b,a)~�. Pour le mode auteur--ann�e, l'option
% \texttt{sort\&compress} est identique � \texttt{sort}.
% 
% \iffalse
%<*notes>
\head{Tri et compression des citations num�riques}
N'utilisez pas le package \texttt{cite} avec \thestyle; Utilisez plut�t les options  
\texttt{sort} ou \texttt{sort\&compress}.

Cela fonctionne aussi pour les citations auteurs--ann�e, Faisant que de multiples citations 
apparaissent dans cet ordre dans la liste de r�f�rence.

%</notes>
% \fi
% 
% \subsection{Liste longue des auteurs lors de la premi�re citation}\label{sec:long}
% 
Un dispositif qui a souvent �t� r�clam� par des utilisateurs pour le reste satisfaits de
\thestyle\ est disponible en standard avec le package
\texttt{harvard}: avec la premi�re citation d'une r�f�rence bibliographique quelconque, la
liste compl�te des auteurs est imprim�e, puis, ensuite seulement, la liste abr�g�e. On peut
obtenir ceci avec \verb|\citet*| pour la premi�re citation, et \verb|\citet| ou \verb|\citep|
ensuite. Cependant, le m�canisme automatique est tr�s demand�.
% 
% Ceci peut �tre activ� avec l'option 
% \texttt{longnamesfirst}.
% 
% \iffalse
%<*notes>
\head{Liste longue des auteurs lors de la premi�re citation}
Utilisez l'option \texttt{longnamesfirst} pour obtenir que la premi�re citation donne automatiquement 
la liste compl�te des auteurs.

Vous pouvez supprimer cela pour certaines citations avec \verb|\shortcites{|\emph{key-list}|}|,
d�clar� avant la premi�re citation.

%</notes>
% \fi
%
% \DescribeMacro{\shortcites}
% Certaines r�f�rences ont tellement d'auteurs que vous voudriez supprimer la liste compl�te
% seulement pour elles. Dans ce cas, dites
% \begin{quote}
%   |\shortcites|\marg{liste de cl�s}
% \end{quote}
% avant les premi�res citations et les
% r�f�rences dont la cl� appara�t dans la liste de cl�s auront une liste courte m�me pour
% leur premi�re citation.
%
% Une liste compl�te des auteurs peut toujours �tre forc�e avec les formes �toil�es des commandes.
% 
% \section{Citations num�riques avec les styles auteur--ann�e}\label{sec:6.0}
% 
% Il est possible de produire des citations num�riques avec tout fichier \texttt{.bst}
% auteur-ann�e, avec des modifications minimales dans le texte. Les commandes \verb|\citet| et
% \verb|\citep| produiront des r�sultats corrects dans les deux modes, sans �dition sp�ciale.
% �videmment le contraire n'est pas possible; un fichier \texttt{.bst} con�u pout la citation
% num�rique ne peut jamais produire des citations auteur--ann�e, tout simplement parce que les
% informations ne sont pas transmises au fichier auxiliaire.
% 
% \subsection{S�lection du mode num�rique}
% Par d�faut, \thestyle{} est en mode auteur--ann�e. Ceci peut �tre chang� en
% \begin{enumerate}
%   \item �lectionnant un style bibliographique num�rique avec un style de citation pr�d�fini,
% d�fini soit dans le paquetage soit dans le fichier de configuration local;
%         
%   \item donnant les options \texttt{numbers} ou \texttt{super} � la commande \verb|\usepackage|;
% 
%   \item appelant \verb|\bibpunct| avec un quatri�me argument obligatoire �gal �~\texttt{n}
% ou~\texttt{s};
% 
%   \item appelant \verb|\citestyle| avec le nom d'un style bibliographique num�rique pr�d�fini.
% \end{enumerate}
% Les m�thodes sont list�es par ordre de priorit� croissante.
% 
% Le paquetage \thestyle{} passera automatiquement en mode num�rique si une quelconque des
% entr�es \verb|\bibitem| se trouve ne pas �tre conforme aux formats auteur--ann�e possibles. Il
% n'y a aucun moyen de passer outre ceci, puisqu'une telle entr�e s�merait le trouble dans le
% mode auteur--ann�e.
% 
% Il y a certains styles �~num�riques~� sp�ciaux, comme celui du standard \texttt{alpha.bst},
% qui incluent un label non num�rique � la place du num�ro, sous la forme
% \begin{quote} \verb|\bibitem[ABC95]{able95}| \end{quote}
% En ce qui concerne \thestyle, ce label n'est pas conforme aux possibilit�s
% auteur--ann�e et est en cons�quence consid�r� comme �tant num�rique. Le mode de citation
% devient num�rique, et \verb|\cite{able95}| imprime [ABC95].
% 
% Voir cependant la fin de la section~\ref{sec:yearless} pour une autre possibilit�.
% Le r�sultat ci-dessus peut �tre obtenu avec
% \begin{quote} \verb|\bibitem[ABC95()]{able95}| \end{quote}
%
% \section{Configuration locale}
% Avec \LaTeXe, il est possible d'ajouter un fichier local de configuration
% \thestyle\texttt{.cfg}, qui est lu, s'il existe, � la fin du package. Il peut
% donc contenir du code qui supplante celui qui est dans le package, bien que son but
% principal soit de permettre � l'usager d'ajouter ses propres d�finitions \verb|bibstyle@|\textit{bst} 
% pour coupler la ponctuation de citation avec les styles bibliographiques locaux.
%
% \iffalse
%<*notes>
\head{Configuration locale}
Toutes d�finitions ou codes locaux peuvent �tre plac� dans \thestyle\texttt{.cfg} 
qui est lu apr�s le package principal.

%</notes>
% \fi
% 
% \section{Options avec \LaTeXe}\label{sec:opts}
% Une des possibilit�s nouvelles de \LaTeXe{} est la pr�sence d'\emph{options} pour les
% packages, de la m�me mani�re que les styles principaux de documents (maintenant 
% appel�s \emph{classes}). Ce package est maintenant appel� par:
% \begin{quote}
% |\documentclass[..]{...}|\\
% |\usepackage[|\emph{options}|]{|\thestyle|}|
% \end{quote}
% \iffalse
%<*notes>
\head{Options qui peuvent �tre ajout�es � \texttt{\char`\\ usepackage}}
% \fi
% Les options disponibles offrent une autre m�thode pour sp�cifier la ponctuation pour les
% citations:
\begin{description}
\item[\ttfamily round](d�faut) pour des parenth�ses rondes \verb|()|;
\item[\ttfamily square] pour des crochets droits \verb|[]|;
\item[\ttfamily curly] pour des accolades \verb|{}|;
\item[\ttfamily angle] pour des chevrons $<{}>$;
\item[\ttfamily colon] (d�faut) pour s�parer des citations multiples par des deux-points;
\item[\ttfamily comma] pour utiliser des virgules comme s�parateurs;
\item[\ttfamily authoryear] (d�faut) pour avoir des citations auteur--ann�e;
\item[\ttfamily numbers] pour avoir des citations num�riques;
\item[\ttfamily super] pour avoir des citations num�riques en exposant comme dans \textsl{Nature};
\item[\ttfamily sort] trie les citations multiples selon l'ordre de leur apparition dans la
 liste des r�f�rences;
\item[\ttfamily sort\&compress] comme \texttt{sort} mais de plus les citations num�riques
 multiples sont compress�es si possible (comme dans (3--6, 15);
\item[\ttfamily longnamesfirst] fait que la premi�re citation d'une r�f�rence quelconque sera
trait�e comme la forme �toil�e (liste compl�te des auteurs) et les citations suivantes comme la
forme normale (liste abr�g�e);
\item[\ttfamily sectionbib] red�finit \verb|\thebibliography| pour obtenir \verb|\section*| au
 lieu de \verb|\chapter*|; n'est valide que pour les classes de document ayant une commande
 \verb|\chapter|; � utiliser avec le package \texttt{chapterbib};
\item[\ttfamily nonamebreak] garde tous les noms d'auteurs dans une citation sur une seule
 ligne; provoque des bo�tes trop pleines (lignes qui d�bordent)  mais r�soud certains
 probl�mes avec \texttt{hyperref}.
\end{description}
% \iffalse
%</notes>
% \fi
% 
% Si l'une de ces options de mise en forme est s�lectionn�e, les styles de citation pr�d�finis dans les commandes
% \verb|\bibstyle@|\textit{bst} ne seront plus effectifs. Si \verb|\bibpunct| ou \verb|\citestyle|
% sont appel�es dans le pr�ambule, les options de ponctuation ci-dessus ne seront plus valables.
% 
% \section{Comme module de styles sp�cifiques de journaux}
% Bien que \thestyle{} soit con�u pour �tre un \emph{package} de style bibliographique universel,
% il peut aussi �tre incorpor� comme module dans d'autres packages pour des journaux
% sp�cifiques. Dans ce cas, plusieurs des possibilit�s g�n�rales peuvent �tre laiss�es de c�t�.
% Ceci est permis gr�ce � des options de \texttt{docstrip} qui non seulement laissent de c�t�
% certaines lignes de code, mais aussi en incluent des suppl�mentaires. � l'heure actuelle, des
% options existent pour
% \begin{description}
% \item[\ttfamily subpack] produit une version basique avec le mode auteur--ann�e seulement, une
% ponctuation de citation fix�e, pas de commandes \verb|\bibpunct| ni \verb|\citestyle| ni de
% styles pr�d�finis;
% \item[\ttfamily subpack,egs] pour les journaux de la \textsl{European Geophysical Society},
% en particulier \textsl{Nonlinear Processes in Geophysics};
% \item[\ttfamily subpack,agu] pour les journaux de l'\textsl{American Geophysical Union}.
% \end{description}
% L'option \texttt{subpack} doit toujours �tre utilis�e avec \texttt{package}.
% 
% Les anciennes options \texttt{jgr} et \texttt{grl} sont devenues obsol�tes � cause de
% changements dans ces journaux; elles ont �t� remplac�es par l'option plus g�n�rale \texttt{agu}.
% 
% \section{R�sum�}
% 
% Un r�sum� rapide des points principaux concernant l'utilisation de \thestyle\ peut �tre obtenu en
% ex�cutant \LaTeX{} sur le fichier \texttt{natnotes.tex}, qui est extrait du fichier source principal 
% \thestyle\texttt{.dtx} � l'aide de l'option \texttt{notes} de \texttt{docstrip}. 
% Il est cens� constituer une r�f�rence facilement manipulable.
% 
% Ce fichier devrait �tre automatiquement extrait par le fichier d'installation fourni \thestyle\texttt{.ins}.
% 
%^^A The following is a summary that goes into the .sty file
%^^A It is not printed in the documentation, since the Reference Sheet exists
% \iffalse  
%<*package&!subpack>
 % 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}...
%<*apalike|all>
 %   \bibitem[Jones et al., 1990]{key}...
%</apalike|all>
%<*newapa|chicago|all>
 %   \bibitem[\protect\citeauthoryear{Jones, Baker, and Williams}{Jones
 %       et al.}{1990}]{key}...
 %   \bibitem[\protect\citeauthoryear{Jones et al.}{1990}]{key}...
%</newapa|chicago|all>
%<*astron|all>
 %   \bibitem[\protect\astroncite{Jones et al.}{1990}]{key}...
%</astron|all>
%<*authordate|all>
 %   \bibitem[\protect\citename{Jones et al., }1990]{key}...
%</authordate|all>
%<*harvard|all>
 %   \harvarditem[Jones et al.]{Jones, Baker, and Williams}{1990}{key}...
%</harvard|all>
 %   
 % 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
 %   \citealp{key}          ==>> Jones et al., 1990
 %   \citealp*{key}         ==>> Jones, Baker, and Williams, 1990
 % Additional citation possibilities (both author-year and numerical modes)
 %   \citeauthor{key}       ==>> Jones et al.
 %   \citeauthor*{key}      ==>> Jones, Baker, and Williams
 %   \citeyear{key}         ==>> 1990
 %   \citeyearpar{key}      ==>> (1990)
 %   \citetext{priv. comm.} ==>> (priv. comm.)
 % Note: full author lists depends on whether the bib style supports them;
 %       if not, the abbreviated list is printed even when full requested.
 %
 % For names like della Robbia at the start of a sentence, use
 %   \Citet{dRob98}         ==>> Della Robbia (1998)
 %   \Citep{dRob98}         ==>> (Della Robbia, 1998)
 %   \Citeauthor{dRob98}    ==>> Della Robbia
 %
%<*!209>
 % 
 % Citation aliasing is achieved with
 %   \defcitealias{key}{text}
 %   \citetalias{key}  ==>> text
 %   \citepalias{key}  ==>> (text)
%</!209>
 %
 % Defining the citation style of a given bib style:
%<!nopreonly> % Use \bibpunct (in the preamble only) with 6 mandatory arguments:
%<nopreonly> % Use \bibpunct (anywhere in the text) 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 (or numbers) 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).
 %
%<!nopreonly> % Such preprogrammed definitions may be invoked in the text (preamble only)
%<nopreonly> % Such preprogrammed definitions may be invoked anywhere in the text
 %  by calling \citestyle{newbib}. This is only useful if the style specified
 %  differs from that in \bibliographystyle.
 %
%<*!209>
 % 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 multiple citations according to order in ref. list
 %   sort&compress   -  like sort, but also compresses numerical citations
 %   longnamesfirst  -  makes first citation full author list
 %   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}
%</!209>
 % LaTeX the source file natbib.dtx to obtain more details
%<!209> % or the file natnotes.tex for a brief reference sheet.
 %-----------------------------------------------------------
%</package&!subpack>
% \fi
% 
% \section{Options avec \texttt{docstrip}}
% Le fichier source \texttt{natbib.dtx} est destin� � �tre trait� avec \texttt{docstrip}, pour
% lequel un certain nombre d'options sont disponibles:
% \begin{description}
% \item[\ttfamily all] inclut toutes les autres interfaces;
%
% \item[\ttfamily apalike] permet l'interpr�tation d'une forme \texttt{apalike} minimale de
% \verb|\bibitem|;
%
% \item[\ttfamily newapa] permet que \verb|\citeauthoryear| soit dans l'argument optionnel de
% \verb|\bibitem| avec les commandes de ponctuation de \texttt{newapa.sty};
%
% \item[\ttfamily chicago] est identique � \texttt{newapa};
%
% \item[\ttfamily harvard] inclut l'interpr�tation de \verb|\harvarditem|;
%
% \item[\ttfamily astron] permet que \verb|\astroncite| apparaisse dans l'argument optionnel
% de \verb|\bibitem|;
%
% \item[\ttfamily authordate] ajoute la syntaxe de la commande \verb|\citename|.
%
% \end{description}
%
% Ce package est con�u pour agir comme module pour d'autres fichiers de classes �crits
% pour des journaux sp�cifiques, auxquels cas les commandes souples \verb|\bibstyle@|{\em bst\/} ne
% sont plus souhait�es. Ponctuation et autres dispositifs de styles doivent �tre �tablis de
% mani�re rigide. Ces options pour journaux sont
% \begin{description}
% \item[\ttfamily agu] pour les journaux de l'\textsl{American Geophysical Union};
%
% \item[\ttfamily egs] pour les journaux de l'\textsl{European Geophysical Society}, en
% particulier \textsl{Nonlinear Processes in Geophysics}.
%
% \end{description}
%
% Les options restantes sont~:
% \begin{description}
% \item[\ttfamily package] pour produire un fichier paquetage \texttt{.sty} avec la plupart des
% commentaires retir�s;
% 
% \item[\ttfamily 209] (associ�e avec \texttt{package}) pour une option de style qui fonctionnera
% sous l'antique \LaTeX~2.09;
% 
% \item[\ttfamily subpack] (associ�e avec \texttt{package}) pour un codage qui devra �tre inclus
% dans un package plus vaste; encore plus de commentaires sont retir�s, ainsi que le
% traitement \LaTeXe{} des options et le code d'identification; produit un package
% \thestyle\ basique pour seulement le mode auteur--ann�e et un style de citation fix�
% (ponctuation);
%
% \item[\ttfamily notes] extrait un r�sum� d'utilisation destin� � servir de feuille de
% r�f�rence; le fichier r�sultant, \texttt{natnotes.tex}, peut �tre trait� par \LaTeX.
%
% \item[\ttfamily nopreonly] permet que les commandes \verb|\citestyle| et \verb|\bibpunct|
soient appel�es n'importe o� dans le texte (et pas seulement dans le pr�ambule); ceci est
consid�r� utile avec le package \texttt{chapterbib} car alors des chapitres diff�rents
peuvent avoir des styles de bibliographie et de citation diff�rents; n'est fournie qu'au cas
o� je changerait d'avis � ce propos, mais pour le moment je me refuse � l'impl�menter;
%
% \item[\ttfamily driver] pour produire un fichier pilote \texttt{.drv} qui imprimera la
% documentation sous \LaTeXe. La documentation ne peut pas �tre imprim�e sous \LaTeX~2.09.
% 
% \end{description}
% Le fichier source \texttt{\filename.dtx} est lui-m�me un fichier pilote et peut �tre trait�
% directement par \LaTeXe.
%
% \iffalse
%<notes>\end{document}
% \fi
%
% \StopEventually{\PrintIndex\PrintChanges}
% 
% \section{The Coding}
% This section presents and explains the actual coding of the macros.
% It is nested between |%<*package>| and |%</package>|, which
% are indicators to \texttt{docstrip} that this coding belongs to the package 
% file.
%
% The \texttt{docstrip} option |<subpack>| should only be called if the
% coding is to be included as part of another package, in which case the 
% announcement text and \LaTeXe{} options are suppressed.
%
% An alternative version of this coding is provided for running as a 
% style file under \LaTeX~2.09. Code lines belonging to this are
% indicated with guard |<209>|; those for LaTeXe{} only with |<!209>|.
%
% With \LaTeX\ release from \texttt{1995/12/01}, |\cite| is made robust, 
% something that I have adopted as well.
% 
% Another change in the above release is that 
% |\G@refundefinedtrue|\footnote{In fact, it was only proposed to be 
%    removed, but because several packages, including this one, were 
%    adversely affected, the name was retained for the new coding.}
% and the |\if@openbib| flag have been removed.
% New, more effective, and compact, coding has replaced them. Rather than
% relying on the kernel coding, I make \thestyle\ more
% self-reliant. 
% 
% \subsection{Test for Specific Journals}
% This package should not be loaded with the specific journal packages that
% already include it; it is superfluous and can lead to contradictions.
%    \begin{macrocode}
%<*package>
%<*!209&!subpack>
\@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}{}
%</!209&!subpack>
%    \end{macrocode}
%
% \subsection{Selecting Citation Punctuation and Other Modifications}
% \begin{macro}{\bibstyle@xxx}
% \changes{5.3}{1994 Sep 13}{Add \texttt{agsm} and \texttt{dcu} punctuation 
%    styles from \texttt{harvard} series}
% We begin by defining a number of punctuation styles for specific
% author--year \texttt{.bst} files that I use. 
% They are placed here, near the beginning, so that another
% user can easily find them to add his own. Some comments remain in the
% stripped version too.
%    \begin{macrocode}
%<*!subpack>
 % Define citation punctuation for some author-year styles
 % One may add and delete at this point
%<!209> % 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.
%<*all|harvard>
\newcommand\bibstyle@agsm{\bibpunct{(}{)}{,}{a}{}{,}\gdef\harvardand{\&}}
\newcommand\bibstyle@kluwer{\bibpunct{(}{)}{,}{a}{}{,}\gdef\harvardand{\&}}
\newcommand\bibstyle@dcu{\bibpunct{(}{)}{;}{a}{;}{,}\gdef\harvardand{and}}
%</all|harvard>
%    \end{macrocode}
% 
% Here give the explicit punctuation for the specific journals; their
% coding need not contain the punctuation macros |\bibpunct| and
% |\bibstyle@xxx| since the punctuation is fixed for them.
%
% Activate citation sorting for the journals.
% \changes{6.8b}{1998 July 2}{Turn off sorting for AGU and EGS}
%    \begin{macrocode}
\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.
%</!subpack>
%<agu>\newcommand\NAT@open{[} \newcommand\NAT@close{]} 
%<agu>\newcommand\NAT@sep{;} \newcommand\NAT@cmt{, }
%<agu>\newcommand\NAT@aysep{,} \newcommand\NAT@yrsep{,~}
%<agu|egs>\def\NAT@sort{0}
%<egs>\newcommand\NAT@open{(} \newcommand\NAT@close{)} 
%<egs>\newcommand\NAT@sep{;} \newcommand\NAT@cmt{, }
%<egs>\newcommand\NAT@aysep{,} \newcommand\NAT@yrsep{,}
%    \end{macrocode}
% 
% \changes{6.5}{1997 Jan 30}{Fix \texttt{esa} style for new note system}
% \changes{7.0}{1999 May 7}{Fix \texttt{esa} style again}
% Next, the same thing is done for some numerical styles. A major
% difference here is that the |\@biblabel| and |\@cite| commands must also
% be redefined in many cases. These redefinitions must be made with the
% |\gdef| (global definition) command.
%    \begin{macrocode}
%<*!subpack>
 % Define citation punctuation for some numerical styles
\newcommand\bibstyle@cospar{\bibpunct{/}{/}{,}{n}{}{}%
     \gdef\NAT@biblabelnum##1{##1.}}
\newcommand\bibstyle@esa{\bibpunct{(Ref.~}{)}{,}{n}{}{}%
     \gdef\NAT@biblabelnum##1{##1.\hspace{1em}}}
\newcommand\bibstyle@nature{\bibpunct{}{}{,}{s}{}{\textsuperscript{,}}%
     \gdef\NAT@biblabelnum##1{##1.}}
%    \end{macrocode}
% 
% Finally, the standard \LaTeX{} (numerical) citation styles are included
%  along with their \thestyle\ modifications (author--year).
%    \begin{macrocode}
 % 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
%    \end{macrocode}
% \end{macro}
% 
% \subsection{\LaTeXe{} Options}
% \begin{macro}{\ifNAT@numbers}
% \changes{5.5}{1995 Mar 21}{Add flag for switching between cite styles}
% \begin{macro}{\ifNAT@super}
% \changes{5.5}{1995 Mar 21}{Add flag for switching between cite styles}
% Two flags are used to keep track of the citation style. The flag
% |\ifNAT@numbers| is \meta{false} by default (author--year) and switches
% to \meta{true} for numerical citations. The flag |\ifNAT@super| indicates
% if the numerical citation is to be done with superscripts.
%    \begin{macrocode}
\newif\ifNAT@numbers \NAT@numbersfalse
\newif\ifNAT@super \NAT@superfalse
%</!subpack>
%    \end{macrocode}
% \end{macro}\end{macro}
%
% \begin{macro}{\DeclareOption}
% \changes{5.0}{1994 May 18}{Add \LaTeXe{} options.}
% \changes{5.3}{1994 Sep 13}{Add options \texttt{angle} and \texttt{curly}}
% \changes{6.0}{1995 Sep 6}{Add option \texttt{bibstyle}}
% \changes{6.0}{1995 Sep 6}{Execute \texttt{nobibstyle} with all options}
% \changes{6.1}{1995 Nov 27}{Add option \texttt{openbib}}
% \changes{6.4}{1996 Sep 1}{Add option \texttt{sectionbib}}
% \changes{6.4}{1996 Sep 13}{Add option \texttt{sort}}
% \changes{6.7}{1997 Jul 14}{Add option \texttt{longnamesfirst}}
% \changes{6.8c}{1998 Jul 14}{Add option \texttt{nonamebreak}}
% For \LaTeXe, we can define some options to be used with the |\usepackage|
% command that loads the \thestyle{} package. These are an additional means
% of specifying the citation punctuation and scheme.
% 
% The standard option \texttt{openbib} is also defined here so that its
% behaviour is entirely under my control. Relying on the standard classes
% can lead to trouble.
%    \begin{macrocode}
%<*!subpack&!209>
\DeclareOption{numbers}{\NAT@numberstrue
   \ExecuteOptions{square,comma,nobibstyle}}
\DeclareOption{super}{\NAT@supertrue\NAT@numberstrue
   \renewcommand\NAT@open{}\renewcommand\NAT@close{}
   \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}}
\DeclareOption{sort&compress}{\def\NAT@sort{2}}
\@ifpackageloaded{cite}{\PackageWarningNoLine{natbib}
  {The `cite' package should not be used\MessageBreak
   with natbib. Use option `sort' instead}\ExecuteOptions{sort}}{}
\newif\ifNAT@longnames\NAT@longnamesfalse
\DeclareOption{longnamesfirst}{\NAT@longnamestrue}
\DeclareOption{nonamebreak}{\def\NAT@nmfmt#1{\mbox{\NAT@up#1}}}
%</!subpack&!209>
\def\NAT@nmfmt#1{{\NAT@up#1}}
%    \end{macrocode}
% Before version~6.0, the punctuation options had the lowest priority,
% being overridden by any |\bibstyle@|\textit{bst} command. It was necessary
% to add the option \texttt{nobibstyle} to make them effective. Now this
% option is automatically executed whenever a punctuation option is chosen.
% The reason is that \texttt{nobibstyle} is either superfluous (no
% predefined citation style is present) or always necessary to make the
% other options meaningful. 
% 
% It seems to be better practice to make any explicit choices to have
% higher priority over implicit ones.
% 
% The option \texttt{bibstyle} reactivates the predefined commands, just in
% case this is needed, as it is for the option \texttt{authoryear}. This
% leaves the predefined styles functioning, since it does not really
% determine the citation style, but rather establishes a default which may
% be overwritten by a prestored one.  For this reason, this option must be
% defined very early so that any explicit punctuation options overwrite the
% defaults. (Options are executed in the order defined.)
% 
% \end{macro}
%
% \subsection{Selecting Citation Punctuation and Other Modifications}
% \begin{macro}{\bibstyle}
% \changes{5.4}{1994 Nov 24}{Move \cs{ProcessOptions} to after definition
%    of \cs{bibstyle}}
% The pre-defined punctuation styles are associated with particular
% \texttt{.bst} files. This is implemented by means of the standard
% |\bibliographystyle| command that specifies the name of the \texttt{.bst}
% file that is to be used by \btx. Some \LaTeX{} manuals erroneously state
% that this command must be issued prior to any |\cite| commands. If that
% were the case, the task of invoking the style definitions would be much
% easier, for they certainly must be issued before the first |\cite|.
% However, I have always called |\bibliographystyle| together with
% |\bibliography|, well after all |\cite| commands. 
% 
% In fact, all that |\bibliographystyle|\marg{bst} does is to write
% |\bibstyle|\marg{bst} to the auxiliary file. This file, and all its
% contents, will be read in at the beginning of the next \LaTeX{} run; to
% be precise, it is read in by |\begin{document}|. The command |\bibstyle| is
% then executed at that point on the next run. However, it is 
% defined to do nothing more than to swallow up its argument! In other
% words, the combination |\bibliographystyle| and |\bibstyle| do absolutely
% nothing to the \LaTeX{} runs. In fact, |\bibstyle| is a command for
% \btx{} alone.
% 
% I have taken advantage of this to redefine |\bibstyle| to execute the
% \texttt{bst}-specific definitions. This definition is made here before
% |\ExecuteOptions| so that options may make use of it; the option
% \texttt{nobibstyle} turns it off, for example.
%    \begin{macrocode}
%<*!subpack>
\renewcommand\bibstyle[1]{\@ifundefined{bibstyle@#1}{\relax}
     {\csname bibstyle@#1\endcsname}}
%    \end{macrocode}
% This is executed only when the auxiliary file is read in, and that is
% when |\begin{document}| is issued. Thus this is well before any |\cite|
% commands. It is for this reason that any definitions in the
% |\bibstyle@xxx| commands must be global.
% 
% A minor problem arises in that the auxiliary file is read in a second
% time, at the end of the run, to check whether any labels have changed. 
% Sometimes, re-executing the |\bibstyle@xxx| command at this point
% produces error messages. To avoid this, |\bibstyle| is reset to its
% normal, do-nothing, definition after |\begin{document}|.
% 
% \LaTeXe{} provides a better way of adding commands to |\document|,
% which is then exploited here. Paradoxically, the problem with re-reading
% the auxiliary file does not seem to arise for this version.
% 
% (|\NAT@set@cites| must also be executed at the start of the document; for
% \LaTeXe, this is added later when the macro is defined.)
%    \begin{macrocode}
%<*209>
\let\ori@document=\document
\renewcommand\document{\ori@document\global\let\bibstyle=\@gobble 
  \NAT@set@cites}
%</209>
%<!209>\AtBeginDocument{\global\let\bibstyle=\@gobble}
%    \end{macrocode}
% \end{macro}
% 
% \begin{macro}{\citestyle}
% \changes{5.4}{1995 Feb 03}{Add macro}
% \changes{5.5}{1995 Mar 24}{Make preamble only}
% To allow one to invoke preprogrammed punctuation styles that are
% different from the name of the bibliography style specified by
% |\bibliographystyle|, call |\citestyle| in the preamble. This then
% deactivates |\bibstyle| so that any preprogrammed punctuations become
% ineffective.
% 
% This, and all other punctuation (citation style) declarations, may only
% be used in the preamble, as of version 5.5. (Previously they could only
% be used after the preamble, but the preamble is more logical.)
%    \begin{macrocode}
\let\@citestyle\bibstyle
\newcommand\citestyle[1]{\@citestyle{#1}\let\bibstyle\@gobble}
%<!209&!nopreonly>\@onlypreamble{\citestyle}\@onlypreamble{\@citestyle}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\bibpunct}
% \changes{5.4}{1994 Nov 24}{Add superscript style of citations}
% \changes{5.5}{1995 Mar 21}{Use flags to select citation style}
% \changes{5.5}{1995 Mar 24}{Make preamble only}
% \changes{6.0}{1995 Sep 6}{Sets \cs{bibstyle} to \cs{@gobble}}
% \changes{6.0}{1995 Sep 6}{Declare \cs{NAT@numbersfalse} before testing 4th
%      argument}
% \changes{6.0}{1995 Sep 19}{Add optional argument for \cs{NAT@cmt}}
% \changes{7.0}{1999 May 7}{Add blank to default of first argument}
% Now |\bibpunct| is defined. It sets various punctuation commands equal to
% its arguments. It also switches to numerical style if that is specified
% by the fourth argument. This is done by setting the citation style
% flag |NAT@numbers| accordingly. The internal cite macros are later
% set to the style-dependent definitions by calling |\NAT@set@cites|.
% 
% The fourth argument can also be \texttt{s} for superscript, which
% sets both the numerical and the |\NAT@super| flags.
% 
% An optional argument has been added to determine the punctuation that
% precedes a trailing note. This makes the counting of mandatory arguments
% somewhat confused, since the fourth argument is now |#5|.
% 
%    \begin{macrocode}
%<!209>\newcommand\bibpunct[7][, ]%
%<209>\newcommand\bibpunct{\@ifnextchar[{\@bibpunct}{\@bibpunct[, ]}}
%<209>\def\@bibpunct[#1]#2#3#4#5#6#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
%<nopreonly>   \NAT@set@cites
  }
%<*!nopreonly>
%<!209>\@onlypreamble{\bibpunct}
%<209>\def\do{\noexpand\do\noexpand}
%<209>\edef\@preamblecmds{\@preamblecmds \do\bibpunct \do\citestyle}
%</!nopreonly>
%</!subpack>
%    \end{macrocode}
% The command turns off |\bibstyle| so that the predefined
% |\bibstyle@|\textit{bst} commands no longer work. Thus |\bibpunct| has
% priority over the predefined styles.
% \end{macro}
% 
% \subsection{Setting the Defaults}
% For \LaTeXe, the defaults (punctuation and scheme type) are set with the
% |\ExecuteOptions| command. For \LaTeX~2.09, the default scheme is
% author--year, and punctuation can only be set with |\bibpunct|.
%
% \begin{macro}{\NAT@open}
% \changes{5.5}{1995 May 14}{Renamed from \cs{@citebegin}}
% \begin{macro}{\NAT@close}
% \changes{5.5}{1995 May 14}{Renamed from \cs{@citeend}}
% \begin{macro}{\NAT@sep}
% \changes{5.5}{1995 May 14}{Renamed from \cs{@citesep}}
% \begin{macro}{\NAT@aysep}
% \changes{5.5}{1995 May 14}{Renamed from \cs{@auyrsep}}
% \begin{macro}{\NAT@yrsep}
% \changes{5.5}{1995 May 14}{Renamed from \cs{@yrsep}}
% \begin{macro}{\NAT@cmt}
% \changes{6.0}{1995 Sep 19}{Add macro}
% \changes{6.9}{1999 Feb 25}{Remove hardwired spaces after \cs{NAT@cmt}, 
%      adding them to default definition instead}
% The five punctuation characters for citations are the start and stop
% brackets, the character between multiple citations, the character between
% the authors and year (parenthetical only), and the character between
% adjacent years when the common author list is omitted. 
% A sixth one has been added: the character preceding post-notes,
% including any possible space.
% Define their default values. 
%    \begin{macrocode}
%<!agu&!egs>\newcommand\NAT@open{(} \newcommand\NAT@close{)} 
%<!agu&!egs>\newcommand\NAT@sep{;} 
%    \end{macrocode}
% \end{macro}\end{macro}\end{macro}\end{macro}\end{macro}\end{macro}
% \changes{6.0}{1995 Sep 19}{Remove \cs{ExecuteOptions} since default
%        style determined by definitions}
% The option \texttt{authoryear} was originally provided to serve as the
% default; hence its definition includes \texttt{bibstyle}. However, this
% is not necessary since all the appropriate parameters are set to these
% values anyway. (One could consider removing \texttt{bibstyle}.)
%    \begin{macrocode}
%<*!subpack&!209>
%\ExecuteOptions{authoryear}
\ProcessOptions
%</!subpack&!209>
%<!agu&!egs>\newcommand\NAT@aysep{,} \newcommand\NAT@yrsep{,}
%<!agu&!egs>\newcommand\NAT@cmt{, }
%    \end{macrocode}
%
% \subsection{Internal Citing Macros}
% A number of internal macros (|\@citex|, |\@cite|, |\@biblabel|, and
% |\@bibsetup|) need to have different definitions for author--year and
% numerical schemes. They are defined here for the two different styles,
% with different names, and which ones become active depend on the citation
% style flags |\ifNAT@numbers| and |\ifNAT@super|.
% 
% The coding for the journals always defines the internal macros directly
% as the author--year version, since they can never do any switching.
% 
% \begin{macro}{\@cite}
% \changes{5.5}{1995 Mar 21}{Is \cs{let} equal to the numerical or
%      author--year definition}
% \begin{macro}{\NAT@cite}
% \changes{4.2}{1993 Dec 2}{Reversed optional text no longer needs to include
%       a trailing blank}
% \changes{5.0}{1994 May 18}{Add optional notes after as well as before
%      citation.}
% \changes{5.5}{1995 Mar 13}{Add command space in place of space}
% \changes{5.5}{1995 Mar 13}{Use \cs{if}\cs{relax}\texttt{\#2}\cs{relax}
%    in place of \cs{if}\texttt{\#2}\cs{@empty}}
% \changes{5.5}{1995 Mar 21}{Renamed from \cs{@cite}}
% \changes{6.6}{1997 May 26}{Use flag \cs{ifNAT@par} to suppress braces 
%     optionally}
% \changes{6.8}{1998 Feb 19}{Add \cs{endgroup} to terminate group}
% \changes{6.9a}{1999 Apr 20}{Change test for empty notes to asterix, not \cs{relax}}
% \begin{macro}{\NAT@citenum}
% \changes{5.0}{1994 May 18}{Add optional notes after as well as before
%      citation.}
% \changes{5.5}{1995 Mar 13}{Add command space in place of space}
% \changes{5.5}{1995 Mar 13}{Use \cs{if}\cs{relax}\texttt{\#2}\cs{relax}
%    in place of \cs{if}\texttt{\#2}\cs{@empty}}
% \changes{5.5}{1995 Mar 21}{Renamed from \cs{@citenum}}
% \changes{6.5}{1997 Jan 30}{Numericals always print notes if present, do not
%    test for any flag first}
% \changes{6.6}{1997 May 27}{Can be textual or parenthetical}
% \changes{6.8}{1998 Feb 19}{Add \cs{endgroup} to terminate group}
% \changes{6.8}{1998 Feb 19}{Use \cs{NAT@@open} and \cs{NAT@@close} instead
%    of \cs{NAT@open} and \cs{NAT@close}}
% \begin{macro}{\NAT@citesuper}
% \changes{5.4}{1994 Nov 24}{Add macro for superscripts}
% \changes{5.5}{1995 Mar 21}{Renamed from \cs{@citesuper}}
% \changes{5.5}{1995 Mar 27}{Prints post-note only if present}
% \changes{6.2}{1995 Feb 2}{Get superscript font size right; use
%       \cs{textsuperscript}}
% \changes{6.6}{1997 Jun 4}{Modify for new \cs{NAT@citexnum}}
% \changes{6.8}{1998 Feb 19}{Add \cs{endgroup} to terminate group}
% \changes{7.0}{1999 May 7}{Add \cs{citenumfont} for numbers}
% Define the internal |\@cite| commands that prints the assembled string of 
% citation label texts, plus possible optional notes, before and after. The 
% numerical version (now) the same, where previously (before 6.8) it used 
% |\NAT@open| and |\NAT@close| so that braces were always present. (Keep the 
% separate definitions anyway in case a difference should arise later.) In both 
% cases, the notes are included (if present) only for parenthetical citations 
% (|\ifNAT@swa| is \meta{true}) while for textual citations, they are printed 
% by |\@citex|. The flag |\ifNAT@par| suppresses parentheses if \meta{false}, 
% which is used with |\citealt|, |\citealp|, |\citeyear|, and |\citeauthor| 
% (both numerical and author--year modes). 
% 
% The superscript citation prints only the following, not the preceding,
% note, and then only if it is present.
% 
% Use the construction |\if*#2*| to test for empty note argument. Previously 
% used |\relax| in place of |*| but then it turned out that if the text began 
% with a robust command (like |\S|) the |\protect| command implicit here is 
% equal to |\relax| so the condition is \meta{true}. Now any notes beginning 
% with an asterix will give trouble.
% 
%    \begin{macrocode}
%<subpack>\renewcommand\@cite%
%<!subpack>\newcommand\NAT@cite%
    [3]{\ifNAT@swa\NAT@@open\if*#2*\else#2\ \fi
        #1\if*#3*\else\NAT@cmt#3\fi\NAT@@close\else#1\fi\endgroup}
%<*!subpack>
\newcommand\NAT@citenum%
    [3]{\ifNAT@swa\NAT@@open\if*#2*\else#2\ \fi
        #1\if*#3*\else\NAT@cmt#3\fi\NAT@@close\else#1\fi\endgroup}
\newcommand\NAT@citesuper[3]{\ifNAT@swa
\unskip\hspace{1\p@}\textsuperscript{#1}%
   \if*#3*\else\ (#3)\fi\else #1\fi\endgroup}
%<!209>\providecommand
%<209>\@ifundefined{textsuperscript}{\newcommand
  \textsuperscript[1]{\mbox{$^{\mbox{\scriptsize#1}}$}}
%<209>}{}
%</!subpack>
%    \end{macrocode}
% \end{macro}\end{macro}\end{macro}\end{macro}
% 
% \begin{macro}{\@citex}
% \changes{5.5}{1995 Mar 21}{Is \cs{let} equal to the numerical or
%      author--year definition}
% \changes{6.1}{1995 Nov 22}{Use \cs{NAT@citeundefined}}
% \changes{6.6}{1997 May 17}{Add \cs{NAT@ctype} for author, year, or both}
% \begin{macro}{\NAT@citexnum}
% \changes{5.4}{1994 Nov 24}{Make like \LaTeXe{} definition instead of 2.09}
% \changes{5.5}{1995 Mar 21}{Renamed from \cs{@citexnum}}
% \changes{6.0}{1995 Sep 4}{Prints \cs{NAT@num} instead of \cs{b@citeb}}
% \changes{6.4}{1996 Sep 12}{Add \cs{NAT@space} for variable spacing between
%        numericals and superscripts}
% \changes{6.4}{1996 Oct 2}{Add dummy macros for \texttt{hyperref.sty}}
% \changes{6.6}{1997 May 17}{Add \cs{NAT@ctype} for author, year, or number;
%     can be textual or parethetical}
% \changes{6.6}{1997 Jun 3}{Re-write for sorting and compression}
% \changes{6.6}{1997 Jun 25}{Improve \texttt{hyperref} support}
% \changes{6.7}{1997 Jul 14}{Suppress repeated authors with numerical 
%     \cs{citet}}
% \changes{6.7}{1997 Jul 16}{Add \cs{ifNAT@longnames} test}
% The original definition of |\@citex| is used as basis for |\NAT@citexnum|,
% the version for numerical citations. What it does is to write a
% |\citation| command to the auxiliary file (for \btx), and then parses the
% second argument, the list of citation keys. These keys have to be decoded
% into the actual label text contained in |\b@|\emph{key} (a number or
% author--year), and put together as the argument of |\@cite|.
% For a textual citation (|\ifNAT@swa| \meta{false}), the authors are printed 
% and then the number in parentheses. For multiple citations (silly thing) each 
% number is in separate parentheses preceded by authors.
% 
% The temporary command |\@citeb| takes on the value of each of the keys in
% turn; |\@citea| is the separator between multiple citations, initially
% set to nothing, becoming |\NAT@sep| plus line-break suppression
% afterwards. The |\@firstofone| macro removes any leading blanks in
% |\@citeb|, making |\cite{key1, key2}| possible. If |\b@|\emph{key} is
% not defined (as on the first run, for example), a warning is printed, and
% a question mark inserted. Finally, the decoded label text is placed into
% an |\hbox| to prevent it from being split.
%  
% As of version 6.0, the numerical label text is to be found in |\NAT@num|,
% whereas previously it was the entire label, |\b@|\emph{key}.
% 
% Note that here, and in later coding, internal names beginning with
% |\@cite..| are employed; these names are used in the original \LaTeX{}
% coding for the same functions. Therefore, if there are other packages
% that have name conflicts with \thestyle, they will also have conflicts with
% standard \LaTeX\ too.
% 
% The number |\NAT@ctype| controls whether author (1), year (2), or number (0) 
% is output by this macro. A value of 4 produces the cite alias.
% 
% For compatibility with the \texttt{chapterbib} package of Donald Arseneau,
% add |\@extra@b@citeb| to the cite key; this contains the number of the 
% included file in order to distinguish the same citation in separate files
% which then belong to different bibliography listings.
% 
% The list of citation keys is in |#3|; this is sorted by |\NAT@sort@cites| 
% and returned in |\NAT@cite@list|. If sorting is turned off, this list is 
% the same as the input. If compression of numerical lists is active 
% (|NAT@sort|=2) only the parenthetical output is affected.
% \begin{macrocode} 
%<209>\let\@firstofone\@iden
%<!209>\providecommand\@firstofone[1]{#1}
%<*!subpack>
\newcommand\NAT@citexnum{}
\def\NAT@citexnum[#1][#2]#3{%
%<!209> \NAT@sort@cites{#3}%
 \let\@citea\@empty
  \@cite{\def\NAT@num{-1}\let\NAT@last@yr\relax\let\NAT@nm\@empty
%<!209>    \@for\@citeb:=\NAT@cite@list\do
%<209>    \@for\@citeb:=#3\do
    {\edef\@citeb{\expandafter\@firstofone\@citeb}%
     \if@filesw\immediate\write\@auxout{\string\citation{\@citeb}}\fi
     \@ifundefined{b@\@citeb\@extra@b@citeb}{%
%<209>       {\reset@font\bf ?}\@warning
%<!209>       {\reset@font\bfseries?}
%<!209>        \NAT@citeundefined\PackageWarning{natbib}%
       {Citation `\@citeb' on page \thepage \space undefined}}%
     {\let\NAT@last@num\NAT@num\let\NAT@last@nm\NAT@nm
      \NAT@parse{\@citeb}%
%<*!subpack&!209>
      \ifNAT@longnames\@ifundefined{bv@\@citeb\@extra@b@citeb}{%
        \let\NAT@name=\NAT@all@names
        \global\@namedef{bv@\@citeb\@extra@b@citeb}{}}{}%
      \fi
%</!subpack&!209>
      \ifNAT@full\let\NAT@nm\NAT@all@names\else
        \let\NAT@nm\NAT@name\fi
%    \end{macrocode}
% For compression of numerical citations, we need to save the last number; 
% use |\NAT@last@num| for this purpose. Use |\NAT@last@nm| to save last 
% names to check for repetitions.
% 
% For parenthetical (\LaTeX\ standard) produce only the number (exception: 
% year is allowed for |\citeyearpar|, but without sorting); any notes are 
% added in the |\@cite| macro. For textual, print the authors and then the 
% number in parentheses. This is done for each citation of a multiple set, 
% unlike the parenthetical version where all citations appear in a single pair 
% of parentheses. 
% 
% The hyperlink start and end are to bracket only the number; however, if 
% only the authors or only the year are printed, then these are bracketed.
% Numbers are not compressed if \texttt{hyperref} is loaded, since every
% reference must be present.
%    \begin{macrocode}
      \ifNAT@swa
       \ifnum\NAT@ctype>1\relax\@citea
        \hyper@natlinkstart{\@citeb\@extra@b@citeb}%
            \ifnum\NAT@ctype=2\relax\NAT@test{\NAT@ctype}%
%<!209>            \else\NAT@alias
            \fi\hyper@natlinkend\else
%<*!209>
       \ifnum\NAT@sort>1 
         \begingroup\catcode`\_=8
            \ifcat _\ifnum\z@<0\NAT@num _\else A\fi
              \global\let\NAT@nm=\NAT@num \else \gdef\NAT@nm{-2}\fi
            \ifcat _\ifnum\z@<0\NAT@last@num _\else A\fi
              \global\@tempcnta=\NAT@last@num \global\advance\@tempcnta by\@ne 
              \else \global\@tempcnta\m@ne\fi
         \endgroup
         \ifnum\NAT@nm=\@tempcnta
           \ifx\NAT@last@yr\relax 
             \edef\NAT@last@yr{\@citea \mbox{\noexpand\citenumfont\NAT@num}}%
           \else
             \edef\NAT@last@yr{--\penalty\@m\mbox{\noexpand\citenumfont\NAT@num}}%
           \fi
         \else
           \NAT@last@yr \@citea \mbox{\citenumfont\NAT@num}%
           \let\NAT@last@yr\relax
         \fi
       \else 
%</!209>
         \@citea \mbox{\hyper@natlinkstart{\@citeb\@extra@b@citeb}%
           {\citenumfont\NAT@num}\hyper@natlinkend}%
%<!209>       \fi 
       \fi 
       \def\@citea{\NAT@sep\penalty\@m\NAT@space}%
%    \end{macrocode}
% For textual citations, test what the output is to be (number, year, 
% author) and also test for comments.
%    \begin{macrocode}
      \else 
        \ifcase\NAT@ctype\relax
          \ifx\NAT@last@nm\NAT@nm \NAT@yrsep\penalty\@m\NAT@space\else
          \@citea \NAT@test{1}\ \NAT@@open
          \if*#1*\else#1\ \fi\fi \NAT@mbox{%
          \hyper@natlinkstart{\@citeb\@extra@b@citeb}%
          {\citenumfont\NAT@num}\hyper@natlinkend}%
          \def\@citea{\NAT@@close\NAT@sep\penalty\@m\ }%
        \or\@citea
          \hyper@natlinkstart{\@citeb\@extra@b@citeb}%
           \NAT@test{\NAT@ctype}\hyper@natlinkend
          \def\@citea{\NAT@sep\penalty\@m\ }%
        \or\@citea
          \hyper@natlinkstart{\@citeb\@extra@b@citeb}%
           \NAT@test{\NAT@ctype}\hyper@natlinkend
          \def\@citea{\NAT@sep\penalty\@m\ }%
%<*!209>
        \or\@citea
          \hyper@natlinkstart{\@citeb\@extra@b@citeb}%
           \NAT@alias\hyper@natlinkend
          \def\@citea{\NAT@sep\penalty\@m\ }%
%</!209>
        \fi
      \fi 
      }}%
%<!209>      \ifnum\NAT@sort>1\relax\NAT@last@yr\fi
      \ifNAT@swa\else\ifnum\NAT@ctype=0\if*#2*\else
      \NAT@cmt#2\fi \NAT@@close\fi\fi}{#1}{#2}}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\NAT@test}
% \changes{6.6}{1997 May 29}{Add macro}
% For numerical mode, need to test if there really is a name or date; if a 
% numerical \texttt{.bst} file is being used, there will not be any names or
% dates. This macro tests and writes |\NAT@nm| or |\NAT@date| according to 
% its argument being 1 or 2.
%    \begin{macrocode}
\newcommand\NAT@test[1]{\ifnum#1=1 \ifx\NAT@nm\NAT@noname
%<209>  {\reset@font\bf(author?)}\@warning
%<!209>  {\reset@font\bfseries(author?)}\PackageWarning{natbib}
  {Author undefined for citation`\@citeb'
%<209>   ^^J
%<!209>   \MessageBreak
   on page \thepage}\else \NAT@nm \fi
  \else \if\relax\NAT@date\relax
%<209>  {\reset@font\bf(author?)}\@warning
%<!209>  {\reset@font\bfseries(year?)}\PackageWarning{natbib}
  {Year undefined for citation`\@citeb'
%<209>   ^^J
%<!209>   \MessageBreak
   on page \thepage}\else \NAT@date \fi \fi}
%</!subpack>
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\citenumfont}
% \changes{7.0}{1999 May 7}{Add macro to format numerical citations}
% To set the numerical citations in a different font, define |\citenumfont|.
%    \begin{macrocode}
\let\citenumfont=\relax
%    \end{macrocode}
% \end{macro}
% 
% \begin{macro}{\NAT@citex}
% \changes{5.2}{1994 Aug 25}{Make like \LaTeXe{} definition instead of 2.09}
% \changes{5.4}{1994 Nov 24}{Change space to command space for text cites}
% \changes{5.4}{1995 Feb 6}{Add test for adjacent citations having equal
%   authors and years}
% \changes{5.5}{1995 Mar 21}{Renamed from \cs{@citex}}
% \changes{6.0}{1995 Sep 21}{Move \cs{ifNAT@full} test from
%          \cs{NAT@parse} to here}
% \changes{6.4}{1996 Oct 2}{Add dummy macros for \texttt{hyperref.sty}}
% \changes{6.6}{1997 Jun 3}{Add sorting of citations}
% \changes{6.7}{1997 Jul 16}{Add \cs{ifNAT@longnames} test}
% \changes{7.0}{1999 May 7}{Suppress years when empty}
% The author--year version of |\@citex| is now defined. It wants the authors 
% and year for each decoded label text to be separated into |\NAT@nm| and 
% |\NAT@date|. This is done by the routine |\NAT@parse|. The names of the 
% authors in the previous key are stored in |\NAT@last@nm|, and if that is the 
% same as the current names, it is not printed again. The output citation text 
% is not put into an |\hbox| since line division may occur within the 
% author--year citation. The output is formatted differently for parenthetical 
% (|\NAT@swa| \meta{true}) and textual (|\NAT@swa| \meta{false}) cases. 
% 
% The citation keys are in |#3|; these are sorted by |\NAT@sort@cites| and 
% stored in |\NAT@cite@list|. If sorting is turned off, this list is the same 
% as the original one.
% 
% |\NAT@nm| will contain either |\NAT@name| or |\NAT@all@names| depending
% on the state of |\ifNAT@full|.
% 
% With the option \texttt{longnamesfirst}, the flag |\ifNAT@longnames| is 
% set; this makes the first citation of any reference use the long list of 
% names. The flag |\bv@|\meta{key} is defined after the first citation so 
% that short lists are used afterwards.
%
% When the year (|\NAT@date|) is empty, no year is printed, nor is the 
% preceding punctuation there; for textual citations, the brackets are also 
% suppressed. This is to allow to citations with a code designation without a 
% year.
% 
%    \begin{macrocode}
%<subpack>\def\@citex%
%<!subpack>\newcommand\NAT@citex{}
%<!subpack>\def\NAT@citex%
  [#1][#2]#3{%
%<!209>  \NAT@sort@cites{#3}%
  \let\@citea\@empty
  \@cite{\let\NAT@nm\@empty\let\NAT@year\@empty
%<!209>    \@for\@citeb:=\NAT@cite@list\do
%<209>    \@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%
%<209>       {\reset@font\bf ?}\@warning
%<!209>       {\reset@font\bfseries ?}\NAT@citeundefined
%<!209>                 \PackageWarning{natbib}%
       {Citation `\@citeb' on page \thepage \space undefined}\def\NAT@date{}}%
     {\let\NAT@last@nm=\NAT@nm\let\NAT@last@yr=\NAT@year
     \NAT@parse{\@citeb}%
%<*!subpack&!209>
      \ifNAT@longnames\@ifundefined{bv@\@citeb\@extra@b@citeb}{%
        \let\NAT@name=\NAT@all@names
        \global\@namedef{bv@\@citeb\@extra@b@citeb}{}}{}%
      \fi
%</!subpack&!209>
     \ifNAT@full\let\NAT@nm\NAT@all@names\else
       \let\NAT@nm\NAT@name\fi
%    \end{macrocode}
% Begin parenthetical citation. Check if author names the same as in the
% previous citation, and if so, also check if the years are the same.
% \changes{5.4}{1995 Feb 8}{Add \cs{unskip} to avoid double spacing
%     between years}
% \changes{6.5}{1997 Jan 30}{Add optional notes for textual citations}
% If so, citations are printed `1994a,b'; if a space is wanted between
%  the letters, as `1994a,~b', then give |\NAT@yrsep| as |{,~}|. For this
%  reason, the |\unskip| is needed when the space between years is printed
%  to avoid two spaces.
%
% \changes{6.6}{1997 May 17}{Add \cs{NAT@ctype} for author, year, or both}
% This macro is to be used to define |\citep|, |\citet|, |\citeyear|, and 
% |\citeauthor|, controlled by various flags. The |\NAT@ctype| is a number 
% equal to 0 for author and year, 1 for author only, 2 for year only.
% \changes{6.9}{1999 Jan 22}{Add citation alias feature}
% A value of 3 is for the citation alias defined by |\defcitealias|.
%
% \changes{6.6}{1997 Jun 25}{Improve \texttt{hyperref} support}
% \changes{6.6}{1997 Jun 30}{Add missing \cs{NAT@close} to \cs{@citea}}
% \changes{6.7}{1997 Jul 14}{Put hyperlink brackets snuggly around 
%       \cs{NAT@exlab} and \cs{NAT@date}}
% \changes{6.8}{1998 Feb 19}{Remove superfluous \cs{hyper@natlinkstart}}
% \changes{6.8b}{1998 July 2}{Add \cs{hyper@natlinkbreak}}
% \changes{6.8c}{1998 July 14}{Remove opening brace and notes from link}
% \changes{6.8c}{1998 July 14}{Add \cs{NAT@nmfmt}}
% The hyperlinks are to bracket each reference completely, or at least that 
% part that is present. The author names and year are made into separate links 
% with the help of |\hyper@natlinkbreak|. Excluded from the link are 
% punctuation and space between names and year, as well as notes and braces. 
% Everything to be excluded is put into the first argument of |\hyper@natlinkbreak|.
% (This needs \texttt{hyperref.sty} version~6.32.)
%
% Another aid to keeping links on one page is the |\NAT@nmfmt| function for 
% formatting names: normally this is nothing, but with the \texttt{nonamebreak} 
% option, it becomes |\mbox|. This was a special request.
%    \begin{macrocode}
     \ifNAT@swa\ifcase\NAT@ctype
       \if\relax\NAT@date\relax
         \@citea\hyper@natlinkstart{\@citeb\@extra@b@citeb}%
         \NAT@nmfmt{\NAT@nm}\NAT@date\hyper@natlinkend
       \else
         \ifx\NAT@last@nm\NAT@nm\NAT@yrsep
            \ifx\NAT@last@yr\NAT@year 
              \hyper@natlinkstart{\@citeb\@extra@b@citeb}\NAT@exlab
              \hyper@natlinkend
            \else\unskip\ 
              \hyper@natlinkstart{\@citeb\@extra@b@citeb}\NAT@date
              \hyper@natlinkend
            \fi
         \else\@citea\hyper@natlinkstart{\@citeb\@extra@b@citeb}%
           \NAT@nmfmt{\NAT@nm}%
           \hyper@natlinkbreak{\NAT@aysep\ }{\@citeb\@extra@b@citeb}%
           \NAT@date\hyper@natlinkend 
         \fi 
       \fi
     \or\@citea\hyper@natlinkstart{\@citeb\@extra@b@citeb}%
         \NAT@nmfmt{\NAT@nm}\hyper@natlinkend
     \or\@citea\hyper@natlinkstart{\@citeb\@extra@b@citeb}%
         \NAT@date\hyper@natlinkend
%<*!209>
     \or\@citea\hyper@natlinkstart{\@citeb\@extra@b@citeb}%
         \NAT@alias\hyper@natlinkend
%</!209>
     \fi \def\@citea{\NAT@sep\ }%
%    \end{macrocode}
% Begin textual citation. Do same checks for repeated names and years.
% Optional notes are added here, not in |\NAT@cite|, which means for 
% multiple citations, each one will receive the notes in the year part.
% (Pre-notes are questionable for this, but include them anyway.)
% \changes{6.6}{1997 July 5}{Fix closing brace bug}
%    \begin{macrocode}
     \else\ifcase\NAT@ctype
        \if\relax\NAT@date\relax
          \@citea\hyper@natlinkstart{\@citeb\@extra@b@citeb}%
          \NAT@nmfmt{\NAT@nm}\hyper@natlinkend
        \else
         \ifx\NAT@last@nm\NAT@nm\NAT@yrsep
            \ifx\NAT@last@yr\NAT@year 
              \hyper@natlinkstart{\@citeb\@extra@b@citeb}\NAT@exlab
              \hyper@natlinkend
            \else\unskip\ 
              \hyper@natlinkstart{\@citeb\@extra@b@citeb}\NAT@date
              \hyper@natlinkend
            \fi
         \else\@citea\hyper@natlinkstart{\@citeb\@extra@b@citeb}%
           \NAT@nmfmt{\NAT@nm}%
           \hyper@natlinkbreak{\ \NAT@@open\if*#1*\else#1\ \fi}%
              {\@citeb\@extra@b@citeb}%
           \NAT@date\hyper@natlinkend\fi
        \fi
       \or\@citea\hyper@natlinkstart{\@citeb\@extra@b@citeb}%
         \NAT@nmfmt{\NAT@nm}\hyper@natlinkend
       \or\@citea\hyper@natlinkstart{\@citeb\@extra@b@citeb}%
         \NAT@date\hyper@natlinkend
%<*!209>
       \or\@citea\hyper@natlinkstart{\@citeb\@extra@b@citeb}%
         \NAT@alias\hyper@natlinkend
%</!209>
       \fi \if\relax\NAT@date\relax\def\@citea{\NAT@sep\ }%
           \else\def\@citea{\NAT@@close\NAT@sep\ }\fi
     \fi 
     }}\ifNAT@swa\else\if*#2*\else\NAT@cmt#2\fi
     \if\relax\NAT@date\relax\else\NAT@@close\fi\fi}{#1}{#2}}
%    \end{macrocode}
%
% \end{macro}\end{macro}
%
% \begin{macro}{\NAT@@open}
% \changes{6.6}{1997 May 26}{Add macro}
% \begin{macro}{\NAT@@close}
% \changes{6.6}{1997 May 26}{Add macro}
% To allow the opening and closing braces to be suppressed for |\citealt|, use 
% the flag |\ifNAT@par| in these macros. This only applies for author--year 
% mode.
%    \begin{macrocode}
\newif\ifNAT@par \NAT@partrue
\newcommand\NAT@@open{\ifNAT@par\NAT@open\fi}
\newcommand\NAT@@close{\ifNAT@par\NAT@close\fi}
%    \end{macrocode}
% \end{macro}\end{macro}
%
% \begin{macro}{\NAT@alias}
% \changes{6.9}{1999 Jan 22}{Add macro}
% When |\NAT@ctype| is 3, the citation alias previously defined with 
% |\defcitealias| is printed as the citation. This is a \LaTeXe\ feature only.
%    \begin{macrocode}
%<*!209>
\newcommand\NAT@alias{\@ifundefined{al@\@citeb\@extra@b@citeb}{%
  {\reset@font\bfseries(alias?)}\PackageWarning{natbib}
  {Alias undefined for citation `\@citeb'
  \MessageBreak on page \thepage}}{\@nameuse{al@\@citeb\@extra@b@citeb}}}
%</!209>
%    \end{macrocode}
% \end{macro}
% 
% \begin{macro}{\NAT@up}
% \changes{7.0}{1999 May 10}{Add macro}
% \begin{macro}{\NAT@Up}
% \changes{7.0}{1999 May 10}{Add macro}
% If a textual citation comes at the beginning of a sentence, and the first 
% author's name is with a von part, we want to be able to capitalize it. The 
% function |\NAT@up| precedes all names and is normally |\relax|, but can be 
% set to |\NAT@Up|, which capitalizes the first letter encountered. This even 
% works with old style font commands like |{\it van Burg}| but not with NFSS 
% commands like |\textit{van Burg}|. This is for use with the |\Citet| 
% command.
%    \begin{macrocode}
\let\NAT@up\relax
\newcommand\NAT@Up[1]{{\let\protect\@unexpandable@protect\let~\relax
  \expandafter\NAT@deftemp#1}\expandafter\NAT@UP\NAT@temp}
\newcommand\NAT@deftemp[1]{\xdef\NAT@temp{#1}}
\newcommand\NAT@UP[1]{\let\@tempa\NAT@UP\ifcat a#1\MakeUppercase{#1}%
  \let\@tempa\relax\else#1\fi\@tempa}
%    \end{macrocode}
% \end{macro}\end{macro}
% 
% \begin{macro}{\shortcites}
% \changes{6.7}{1997 Jul 16}{Add macro}
% In order to force selected citations to use short author lists even when 
% the |\ifNAT@longnames| flag is set, call this macro with a list of keys as 
% argument. It then defines the |\bv@| flags so that these citations do not 
% appear as `virginal'.
%    \begin{macrocode}
%<*!subpack&!209>
\newcommand\shortcites[1]{%
  \@bsphack\@for\@citeb:=#1\do
  {\edef\@citeb{\expandafter\@firstofone\@citeb}%
   \global\@namedef{bv@\@citeb\@extra@b@citeb}{}}\@esphack}
%</!subpack&!209>
%    \end{macrocode}
% \end{macro}   
%
% \begin{macro}{\@biblabel}
% \changes{5.5}{1995 Mar 21}{Is \cs{let} equal to the numerical or
%      author--year definition}
% \changes{6.8}{1997 Dec 1}{Undefine original \cs{@biblabel}}
% \begin{macro}{\NAT@biblabel}
% \changes{5.5}{1995 Mar 21}{Renamed from \cs{@biblabel}}
% \begin{macro}{\NAT@biblabelnum}
% \changes{5.5}{1995 Mar 21}{Renamed from \cs{@biblabelnum}}
% \begin{macro}{\bibnumfmt}
% \changes{7.0}{1999 May 7}{Add macro}
% Similarly for the |\@biblabel| command, that is used to format the
% citation label in the list of references, define the author--year 
% and the numerical versions. For the former, no labels are
% printed in the list of references.
%
% Suggestion by Donald Arseneau: undefined |\@biblabel| and have it set
% to the predefined variants only if it is still undefined. This allows
% users to redefine it themselves in the preamble using the standard
% name. (They could redefine the |\NAT@biblabel|s but Arseneau figures
% they should be able use the standard name too.)
% The undefining is achieved by setting it to |\@empty|, not |\relax|
% so that the user may still use |\renewcommand|. If the definition has
% already been changed from the standard one, then leave it.
%
% And to simplify things for people who do not know about |\makeatletter|,
% define |\NAT@biblabelnum| in terms of |\bibnumfmt|. One can still 
% redefine |\@biblabel| or even |\NAT@biblabelnum| if one wishes.
%
%    \begin{macrocode}
%<subpack>\renewcommand\@biblabel[1]{\hfill}
%<*!subpack>
\newcommand\NAT@biblabel[1]{\hfill}
\newcommand\NAT@biblabelnum[1]{\bibnumfmt{#1}}
\newcommand\bibnumfmt[1]{[#1]}
\def\@tempa#1{[#1]}
\ifx\@tempa\@biblabel\let\@biblabel\@empty\fi
%</!subpack>
%    \end{macrocode}
% \end{macro}\end{macro}\end{macro}\end{macro}
% 
% \begin{macro}{\@bibsetup}
% \changes{5.5}{1995 Mar 21}{Is \cs{let} equal to the numerical or
%      author--year definition}
% \begin{macro}{\NAT@bibsetup}
% \changes{5.5}{1995 Mar 13}{Add \cs{bibhang} for variable hanging
%          indentation}
% \changes{5.5}{1995 Mar 21}{Renamed from \cs{@bibsetup}}
% \begin{macro}{\NAT@bibsetnum}
% \changes{5.1}{1994 Jun 22}{Add \cmd{\if@openbib} as in \LaTeXe}
% \changes{5.5}{1995 Mar 21}{Renamed from \cs{@bibsetnum}}
% \changes{6.1}{1995 Nov 22}{Use \cs{ifNAT@openbib}}
% \changes{6.2}{1996 Mar 05}{Add \cs{bibsep} for linespacing between
%               references}
% \changes{6.5}{1997 Jan 10}{Set \cs{bibsep} to 0 for EGS}
% The macro |\@bibsetup| is called by |\thebibliography| and contains any
% coding for formatting the list of references that may be different for
% numerical and author--year schemes.  For numerical citations, the
% |\labelwidth| must be set to the size of the longest label (the argument
% of |\thebibliography|), and the |\leftmargin| adjusted accordingly. For
% author--year, there are no labels, so |\labelwidth| is zero, all lines
% after the first are indented by 1~em.
% 
% Since |\thebibliography| is not included in the \textsl{AGU} package,
% this macro is left off here too.
%    \begin{macrocode}
%<*!agu>
%<*!egs>
%<*!subpack>
\newcommand\NAT@bibsetnum[1]{\settowidth\labelwidth{\@biblabel{#1}}%
   \setlength{\leftmargin}{\labelwidth}\addtolength{\leftmargin}{\labelsep}%
   \setlength{\itemsep}{\bibsep}\setlength{\parsep}{\z@}%
%<*!209>
   \ifNAT@openbib
     \addtolength{\leftmargin}{\bibindent}%
     \setlength{\itemindent}{-\bibindent}%
     \setlength{\listparindent}{\itemindent}%
     \setlength{\parsep}{0pt}%
   \fi
%</!209>
}
%</!subpack>
%</!egs>
\newlength{\bibhang}
\setlength{\bibhang}{1em}
%    \end{macrocode}
%
% The length |\bibsep| is to be the spacing between listed references.
% This is normally the regular line spacing between |\item|s in a
% \texttt{list} environment, which is |\itemsep| + |\parsep|. These are set
% by |\@listi|. Therefore, in order to set |\bibsep| to the default value,
% call |\@listi| locally and globally set it.
%
%    \begin{macrocode}
\newlength{\bibsep}
%<!egs>{\@listi \global\bibsep\itemsep \global\advance\bibsep by\parsep}
%<egs>\setlength{\bibsep}{\z@}

%<subpack>\newcommand\@bibsetup%
%<!subpack>\newcommand\NAT@bibsetup%
   [1]{\setlength{\leftmargin}{\bibhang}\setlength{\itemindent}{-\leftmargin}%
       \setlength{\itemsep}{\bibsep}\setlength{\parsep}{\z@}}
%</!agu>
%    \end{macrocode}
% \end{macro}\end{macro}\end{macro}
% 
% \begin{macro}{\NAT@set@cites}
% \changes{5.5}{1995 Mar 21}{New macro to set the internal macros to
%         numerical or author--year}
% \changes{6.3}{1996 Jun 17}{Add \cs{natexlab}}
% \changes{6.4}{1996 Sep 12}{Remove \cs{global} from definitions and \cs{let}}
% \changes{6.4}{1996 Sep 12}{Define \cs{NAT@space} differently for 
%        numericals and superscripts}
% \changes{6.6}{1997 Jun 4}{Define \cs{NAT@mbox} for superscripts}
% \changes{6.8}{1997 Dec 1}{Allow user redefinition of \cs{@biblabel}}
% \changes{6.8a}{1998 May 14}{\cs{@biblabel} redefined only for numericals}
% The four internal macros that have different definitions depending on the
% citation style have been defined with different names; now set the macros
% to be executed to that set that is actually wanted. This is determined by
% the flags |\ifNAT@numbers| and |\ifNAT@super|. The setting command 
% |\NAT@set@cites| is executed by |\begin{document}|, after which point,
% the citation style should be frozen.
%
% The command |\natexlab| is used in the \texttt{.bst} files to enclose the
% extra labels (the letters added to the dates); these are to be suppressed
% for numerical citations.
%    \begin{macrocode}
%<*!subpack>
\newcommand\NAT@set@cites{\ifNAT@numbers
  \ifNAT@super \let\@cite\NAT@citesuper
     \def\NAT@mbox##1{\unskip\nobreak\hspace{1\p@}\textsuperscript{##1}}%
     \let\citeyearpar=\citeyear
     \let\NAT@space\relax\else
     \let\NAT@mbox=\mbox
     \let\@cite\NAT@citenum \def\NAT@space{ }\fi
  \let\@citex\NAT@citexnum
  \ifx\@biblabel\@empty\let\@biblabel\NAT@biblabelnum\fi
  \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}
%<!209>\AtBeginDocument{\NAT@set@cites}
%</!subpack>
%    \end{macrocode}
% \end{macro}
%
% \changes{6.5}{1997 Jan 30}{Add \texttt{showkeys} coding for \cs{@citex}}
% Since |\citep|, |\citet|, and |\citealt| are all ultimately defined in 
% terms of the |\@citex| command, the best way to get the \texttt{showkeys}
% package to handle these is to let it accommodate only |\@citex|. David
% Carlisle has allowed for \thestyle, but only for |\cite| with variable number
% of arguments, |\citeauthor|, |\citefullauthor|, and |\citeyear|. Add the
% necessary coding at the beginning, after we know if \texttt{showkeys}
% has been loaded or not, and |\@citex| has its final definition.
%
% \changes{6.6}{1997 May 27}{Allow \texttt{notcite} option with 
%    \texttt{showkeys} package; turn off special coding}
% Paradoxically, with version~6.6 it is necessary to remove the special coding 
% in \texttt{showkeys} for \thestyle. Now all |\cite..| commands are defined in 
% terms of |\@citex|, so that is sufficient, and the special coding is now 
% incorrect. This means resetting special coding for |\citeauthor|, 
% |\citefullauthor|, |\citeyear|. Alternatively, define |\HAR@checkdef|
% which then also skips special \thestyle\ coding. It is just a question of 
% which package is loaded first. 
% 
% There is no point asking Carlisle to add |\@citex| to \texttt{showkeys} 
% because \thestyle\ fixes this macro with |\begin{document}|; thus 
% \texttt{showkeys} would have to be loaded \emph{after} \thestyle. By 
% including the recoding of |\@citex| here, it is not dependent on the order of 
% the two packages.
% 
% \changes{6.7}{1997 Sep 12}{Replace \cs{@ifpackageloaded} for 
% \texttt{showkeys}}
% If the \texttt{showkeys} package is loaded with option \texttt{final}, its
% coding is not loaded. This is meant to shutoff the package after the draft
% version. However, \thestyle\ (version~6.6 and earlier) was confused by this,
% because it only tested if the package was loaded, not if its coding was active. 
% Version~6.7 no longer uses |\@ifpackageloaded{showkeys}| for this test, but
% tests if |\SK@def| exists (suggestion by David Carlisle).\label{SKdef}
% 
%    \begin{macrocode}
%<*!209>
\AtBeginDocument{\ifx\SK@def\@undefined\else
\ifx\SK@cite\@empty\else
  \SK@def\@citex[#1][#2]#3{\SK@\SK@@ref{#3}\SK@@citex[#1][#2]{#3}}\fi
\ifx\SK@citeauthor\@undefined\def\HAR@checkdef{}\else
  \let\citeauthor\SK@citeauthor
  \let\citefullauthor\SK@citefullauthor
  \let\citeyear\SK@citeyear\fi
\fi}
%    \end{macrocode}
% 
% With the \texttt{hyperref} package, compression of numerical citations 
% must be turned off.
%    \begin{macrocode}
%<*!subpack>
\AtBeginDocument{\@ifpackageloaded{hyperref}{%
  \ifnum\NAT@sort=2\def\NAT@sort{1}\fi}{}}
%</!subpack>
%</!209>
%    \end{macrocode}
%
% \subsection{The Citations}
%
% \begin{macro}{\citet}
% \changes{6.2}{1996 Jan 11}{Add macro for textual cite in numerical mode}
% \changes{6.5}{1997 Jan 30}{Make this standard textual citation, with notes}
% \changes{6.6}{1997 May 26}{Define with \cs{ifNAT@par} on}
% \changes{6.6}{1997 May 27}{Redefine for new coding of \cs{@citex}}
% \changes{6.8}{1998 Feb 19}{Place inside a group}
% Textual citations are made with the |\citet| command, which has a starred
% form for full authors, and may have one or two optional arguments for notes.
%
% This command is equivalent to the older syntex |\cite|\marg{key} without
% optional arguments, at least in author--year mode. In numerical mode,
% it prints the authors and then the numerical reference, whereas |\cite|
% will only print the number. This simplifies the switching between the two
% modes with minimal changes in text. One wants to replace ``as shown by Jones
% et~al.\ (1990)'' with ``as shown by Jones et~al.\ [21]''; with |\cite|,
% one would get ``as shown by [21]''. 
%
% This is such a practical idea, that I have decided to make it the standard
% means of textual citing. It now even allows optional notes in textual cites,
% something that I have been asked to provide, and which is impossible under 
% the old syntex with |\cite|.
%
% Note that the flag |\ifNAT@swa| determines if the citation is textual or
% parenthetical, and |\ifNAT@full| whether abbreviated or full author names
% are to be printed.
% The flag |\ifNAT@par| enables the opening and closing parentheses; this is 
% used only to suppress these for |\citealt| below.
% 
% The flag |\NAT@ctype| controls what |\@citex| actually outputs: author and 
% year (0), author only (1), year only (2). (For numerical mode, 0 yields 
% author [number].)
%
% All the citation commands are placed inside a group; they start
% with |\begingroup|, with the corresponding |\endgroup| added to 
% the |\@cite| command. This localizes the flag settings so that cites may
% be contained with cites, as 
% \begin{quote}
%    |\citep[cited in \citealp{xx}]{yy}|
% \end{quote}
% (Without the localization, the |\citealp| turns off the brackets before
%   |\citep| comes to an end.)
%    \begin{macrocode}
\newif\ifNAT@full\NAT@fullfalse
\newif\ifNAT@swa
%<209>\newcommand\citet
%<!209>\DeclareRobustCommand\citet
   {\begingroup\NAT@swafalse\def\NAT@ctype{0}\NAT@partrue
     \@ifstar{\NAT@fulltrue\NAT@citetp}{\NAT@fullfalse\NAT@citetp}}
\newcommand\NAT@citetp{\@ifnextchar[{\NAT@@citetp}{\NAT@@citetp[]}}
\newcommand\NAT@@citetp{}
\def\NAT@@citetp[#1]{\@ifnextchar[{\@citex[#1]}{\@citex[][#1]}}
%    \end{macrocode}
% \end{macro}
% 
% \begin{macro}{\citep}
% \changes{5.5}{1995 Mar 27}{Add macro as shorthand for \cs{cite[]}}
% \changes{6.5}{1997 Jan 30}{Make this standard parenthetical citation, 
%        with notes}
% \changes{6.6}{1997 May 26}{Define with \cs{ifNAT@par} on}
% \changes{6.6}{1997 May 27}{Redefine for new coding of \cs{@citex}}
% \changes{6.8}{1998 Feb 19}{Place inside a group}
% Parenthetical citations are made with the |\citep| command, which has a 
% starred form for full authors, and may have one or two optional arguments for 
% notes. 
%
% This command was originally added by special request to be a simplification
% for |\cite[]|\marg{key}, and I added it grudgingly. After I reprogrammed 
% \thestyle\ to handle author--year and numerical citations with the same
% \texttt{.bst} file, I needed to add the |\citet| command, and this one
% became an obvious companion for parenthetical citations. I have now altered
% its coding to be the standard, being fully equivalent in functionality
% to the older syntax |\cite|\oarg{pre}\oarg{post}\marg{key}.
%    \begin{macrocode}
%<209>\newcommand\citep
%<!209>\DeclareRobustCommand\citep
   {\begingroup\NAT@swatrue\def\NAT@ctype{0}\NAT@partrue
         \@ifstar{\NAT@fulltrue\NAT@citetp}{\NAT@fullfalse\NAT@citetp}}
%    \end{macrocode}
% \end{macro}
% 
% \begin{macro}{\cite}
% \changes{5.0}{1994 May 18}{Add a second optional argument.}
% \changes{5.3}{1994 Sep 19}{Add starred version to print full author list.}
% \changes{5.4}{1994 Nov 24}{Replace \cmd{\if@tempswa} with \cmd{\ifNAT@swa}.}
% \changes{6.5}{1997 Jan 30}{Declare obsolete, retained for compatibility}
% \changes{6.6}{1997 May 27}{Redefine for new coding of \cs{@citex}}
% \changes{6.8}{1998 Feb 19}{Place inside a group}
% The |\cite| command was originally used to produce both textual and
% parenthetical citations; with an option argument, even an empty one,
% the citation was parenthical. I now recommend the use of |\citet| and 
% |\citep| instead, retaining |\cite| only for compatibility.
%
% In numerical mode, it must be parenthetical (|ifNAT@swa| \meta{true}) both 
% with and without notes, so that it emulates the standard \LaTeX\ usage. In 
% author--year mode, this flag depends on presence or absence of notes.
%    \begin{macrocode}
%<209>\renewcommand\cite
%<!209>\DeclareRobustCommand\cite
    {\begingroup\def\NAT@ctype{0}\NAT@partrue\NAT@swatrue
      \@ifstar{\NAT@fulltrue\NAT@cites}{\NAT@fullfalse\NAT@cites}}
\newcommand\NAT@cites{\@ifnextchar [{\NAT@@citetp}{%
%<!subpack>     \ifNAT@numbers\else
     \NAT@swafalse
%<!subpack>     \fi
    \NAT@@citetp[]}}
%    \end{macrocode}
% \end{macro}
% 
% \begin{macro}{\citealt}
% \changes{5.5}{1995 Mar 16}{Add macro}
% \changes{6.5}{1997 Jan 30}{Uses \cs{citet} instead of \cs{cite}}
% \changes{6.6}{1997 May 26}{Define as \cs{citet} but with \cs{NAT@par} off}
% \changes{6.8}{1998 Feb 19}{Place inside a group}
% \changes{7.0}{1999 May 21}{Include in subpack}
% \begin{macro}{\citealp}
% \changes{6.6}{1997 Jun 23}{Add macro, like \cs{citep} without parentheses}
% \changes{6.8}{1998 Feb 19}{Place inside a group}
% \changes{7.0}{1999 May 21}{Include in subpack}
% An alternative form of citation is one in which the parentheses are not 
% printed. This was originally requested by Alexander Holt, who wanted it to be 
% the same as |\citet| but without any braces; since then James Bednar has asked 
% that it behave exactly as the other |\cite|\emph{xxx}, including notes, to 
% allow easy switching between the two possibilities. It is now defined with the 
% help of the flags |\ifNAT@swa| and |\ifNAT@par| to be the same as |\citet|;
% to accommodate the more sensible |\citep| without parentheses, I now provide 
% |\citealp|. 
% 
% I can see using |\citealp| where one wants to construct a complex
% parenthetical reference by hand, explicitly adding the braces. Thus
% it makes sense to have this feature work in numerical mode too.
% As of version~6.8, this is possible. The two macros |\NAT@cite| and
% |\NAT@citenum| are identical, but kept anyway just in case a difference
% should be added later.
%    \begin{macrocode}
%<209>\newcommand\citealt
%<!209>\DeclareRobustCommand\citealt
   {\begingroup\NAT@swafalse\def\NAT@ctype{0}\NAT@parfalse
         \@ifstar{\NAT@fulltrue\NAT@citetp}{\NAT@fullfalse\NAT@citetp}}
%<209>\newcommand\citealp
%<!209>\DeclareRobustCommand\citealp
   {\begingroup\NAT@swatrue\def\NAT@ctype{0}\NAT@parfalse
         \@ifstar{\NAT@fulltrue\NAT@citetp}{\NAT@fullfalse\NAT@citetp}}
%    \end{macrocode}
% \end{macro}\end{macro}
%
% \begin{macro}{\citeauthor}
% \changes{5.0}{1994 May 18}{Add means to cite authors only.}
% \changes{5.2}{1994 Aug 25}{Enclose \cs{@citenm} in braces.}
% \changes{5.2}{1994 Aug 25}{Add auxiliary file entry.}
% \changes{6.0}{1995 Sep 4}{Check for empty author}
% \changes{6.4}{1996 Oct 2}{Add dummy macros for \texttt{hyperref.sty}}
% \changes{6.6}{1997 May 27}{Define with \cs{@citex} and \cs{NAT@ctype}}
% \changes{6.8}{1998 Feb 19}{Place inside a group}
% In order to refer to the authors without year or number, provide 
% |\citeauthor| and |\citeauthor*|; for historical reasons, keep 
% |\citefullauthor|.
%    \begin{macrocode}
%<209>\newcommand\citeauthor
%<!209>\DeclareRobustCommand\citeauthor
   {\begingroup\NAT@swafalse\def\NAT@ctype{1}\NAT@parfalse
    \@ifstar{\NAT@fulltrue\NAT@citetp}{\NAT@fullfalse\NAT@citetp}}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\Citet}
% \changes{7.0}{1999 May 10}{Add macro}
% \begin{macro}{\Citep}
% \changes{7.0}{1999 May 10}{Add macro}
% \begin{macro}{\Citealt}
% \changes{7.0}{1999 May 10}{Add macro}
% \begin{macro}{\Citealp}
% \changes{7.0}{1999 May 10}{Add macro}
% \begin{macro}{\Citeauthor}
% \changes{7.0}{1999 May 10}{Add macro}
% When a textual citation occurs at the beginning of a sentence and the first 
% name is something like ``de la Maire'', it needs to be capitalized. This is 
% done with the |\NAT@up| command that is redefined to be |\NAT@Up|.
%
% Provide other variations too for completeness. If I do not, someone will
% eventually ask for it, so do it now.
%    \begin{macrocode}
%<209>\newcommand\Citet
%<!209>\DeclareRobustCommand\Citet
   {\begingroup\NAT@swafalse\def\NAT@ctype{0}\NAT@partrue
     \let\NAT@up\NAT@Up
     \@ifstar{\NAT@fulltrue\NAT@citetp}{\NAT@fullfalse\NAT@citetp}}
%<209>\newcommand\Citep
%<!209>\DeclareRobustCommand\Citep
   {\begingroup\NAT@swatrue\def\NAT@ctype{0}\NAT@partrue
     \let\NAT@up\NAT@Up
         \@ifstar{\NAT@fulltrue\NAT@citetp}{\NAT@fullfalse\NAT@citetp}}
%<*!subpack>
%<209>\newcommand\Citealt
%<!209>\DeclareRobustCommand\Citealt
   {\begingroup\NAT@swafalse\def\NAT@ctype{0}\NAT@parfalse
     \let\NAT@up\NAT@Up
         \@ifstar{\NAT@fulltrue\NAT@citetp}{\NAT@fullfalse\NAT@citetp}}
%<209>\newcommand\Citealp
%<!209>\DeclareRobustCommand\Citealp
   {\begingroup\NAT@swatrue\def\NAT@ctype{0}\NAT@parfalse
     \let\NAT@up\NAT@Up
         \@ifstar{\NAT@fulltrue\NAT@citetp}{\NAT@fullfalse\NAT@citetp}}
%</!subpack>
%<209>\newcommand\Citeauthor
%<!209>\DeclareRobustCommand\Citeauthor
   {\begingroup\NAT@swafalse\def\NAT@ctype{1}\NAT@parfalse
     \let\NAT@up\NAT@Up
    \@ifstar{\NAT@fulltrue\NAT@citetp}{\NAT@fullfalse\NAT@citetp}}
%    \end{macrocode}
% \end{macro}\end{macro}\end{macro}\end{macro}\end{macro}
%
% \begin{macro}{\citeyear}
% \changes{5.0}{1994 May 18}{Add means to cite year only.}
% \changes{5.2}{1994 Aug 25}{Add auxiliary file entry.}
% \changes{6.0}{1995 Sep 4}{Check for empty year}
% \changes{6.4}{1996 Sep 12}{Extra letter also printed with year number}
% \changes{6.4}{1996 Oct 2}{Add dummy macros for \texttt{hyperref.sty}}
% \changes{6.6}{1997 May 27}{Define with \cs{@citex} and \cs{NAT@ctype}}
% \changes{6.8}{1998 Feb 19}{Place inside a group}
% Similarly for the year only.
%    \begin{macrocode}
%<209>\newcommand\citeyear
%<!209>\DeclareRobustCommand\citeyear
   {\begingroup\NAT@swafalse\def\NAT@ctype{2}\NAT@parfalse\NAT@citetp}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\citeyearpar}
% \changes{6.6}{1997 May 17}{Add macro}
% \changes{6.8}{1998 Feb 19}{Place inside a group}
% I have often been asked for a version of |\citeyear| in parentheses.
%    \begin{macrocode}
%<209>\newcommand\citeyearpar
%<!209>\DeclareRobustCommand\citeyearpar
   {\begingroup\NAT@swatrue\def\NAT@ctype{2}\NAT@partrue\NAT@citetp}
%    \end{macrocode}
% \end{macro}
% 
% \begin{macro}{\citetext}
% \changes{6.8}{1998 Feb 19}{Add macro}
% To place any arbitrary text inside the citation braces, use |\citetext|.
% This can be used to advantage with |\citealp|. It also makes |\citeyearpar|
% unnecessary.
%    \begin{macrocode}
\newcommand\citetext[1]{\NAT@open#1\NAT@close}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\citefullauthor}
% \changes{5.3}{1994 Sep 13}{Add macro for those bib styles with full author
%     list available}
% \changes{6.0}{1995 Sep 4}{Check for empty author}
% \changes{6.4}{1996 Oct 2}{Add dummy macros for \texttt{hyperref.sty}}
% \changes{6.6}{1997 May 27}{Define with \cs{citeauthor*}}
% Some of the author--year bibliography styles supported here (\texttt{harvard}
%   and \texttt{newapa}) allow a citation with the full author list, because
%   they have the necessary information in the |\bibitem| entry. With 
%   version~5.3, I change the native form of this entry to allow
%   full authors too.
%
% This is now defined in terms of the starred version of |\citeauthor|. It is 
% really only kept for compatibility reasons.
%    \begin{macrocode}
%<209>\newcommand\citefullauthor
%<!209>\DeclareRobustCommand\citefullauthor
   {\citeauthor*}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\defcitealias}
% \changes{6.9}{1999 Jan 22}{Add macro}
% \begin{macro}{\citetalias}
% \changes{6.9}{1999 Jan 22}{Add macro}
% \begin{macro}{\citepalias}
% \changes{6.9}{1999 Jan 22}{Add macro}
% An alias is an alternative designation for a reference, something like [ABG] 
% in place of [Alpher, Bethe, Gamow, 1980]. The alias is defined with 
% |\defcitealias| and used with |\citetalias| and |\citepalias|. 
% This is controlled with 
% |\NAT@ctype| set to 3. This feature only exists for \LaTeXe.
% 
% The advantage over simply typing in the alias name is that hyperlinks and 
% indexing can be achieved. 
%    \begin{macrocode}
%<*!209>
\newcommand\defcitealias[2]{%
   \@ifundefined{al@#1\@extra@b@citeb}{}
   {\PackageWarning{natbib}{Overwriting existing alias for citation #1}}
   \@namedef{al@#1\@extra@b@citeb}{#2}}
\DeclareRobustCommand\citetalias{\begingroup
   \NAT@swafalse\def\NAT@ctype{3}\NAT@parfalse\NAT@citetp}
\DeclareRobustCommand\citepalias{\begingroup
   \NAT@swatrue\def\NAT@ctype{3}\NAT@partrue\NAT@citetp}
%</!209>
%    \end{macrocode}
% \end{macro}\end{macro}\end{macro}
% 
% \begin{macro}{\nocite}
% \changes{6.6}{1997 Apr 6}{Revise standard macro}
% In \LaTeXe, the |\nocite| command issues a warning if the citations are not
% defined. This is a check to see that they really are entered into the list
% of references. However, the |\@extra@b@citeb| addition for the
% \texttt{chapterbib} package is not allowed for, and hence the standard
% command will never recognize the citations as being defined. Modify the
% macro accordingly. Check for |*| citation, in which case, give no warning.
%    \begin{macrocode}
\renewcommand\nocite[1]{\@bsphack
  \@for\@citeb:=#1\do{%
    \edef\@citeb{\expandafter\@firstofone\@citeb}%
    \if@filesw\immediate\write\@auxout{\string\citation{\@citeb}}\fi
    \if*\@citeb\else
    \@ifundefined{b@\@citeb\@extra@b@citeb}{%
%<209>       \@warning
%<!209>       \NAT@citeundefined \PackageWarning{natbib}%
       {Citation `\@citeb' undefined}}{}\fi}%
  \@esphack}
%    \end{macrocode}
% \end{macro}
%
% \subsection{Parsing the Author--Year Entries}
% \begin{macro}{\NAT@parse}
% \changes{5.0}{1994 May 18}{Add parsing command, with additional 
%    font and sub-accent commands relaxed}
% \changes{5.1}{1994 Jun 22}{For \LaTeXe{} of \texttt{1994/06/01}, 
%    can protect font and sub-accents much better}
% \changes{5.2}{1994 Aug 24}{2.09 version to run in compatibility mode}
% \changes{5.3}{1994 Sep 13}{Add full author list}
% \changes{5.3}{1994 Sep 19}{Support starred version of \cs{cite} for full
%    author list}
% \changes{5.3}{1994 Sep 26}{Use \cs{@unexpandable@protect} in place of
%    \cs{noexpand}}
% \changes{5.4}{1995 Feb 6}{Call \cs{@parse@date} to split date into year and
%     extra label}
% \changes{5.5}{1995 May 18}{Rename from \cs{@cite@parse}}
% \changes{6.0}{1995 Sep 4}{Remove \cs{relax} from expanded \cs{@tempa}
%    definition; no longer needed under new system}
% \changes{6.0}{1995 Sep 21}{Prevent expansion of forced space (tilde)}
% \changes{6.7}{1997 Nov 10}{Deactive \texttt{babel}'s \cs{active@prefix}}
% The |\bibcite| commands in the auxiliary file associate the numerical and
% author--year information with the |\bibitem| key, which is the argument to
% |\NAT@parse|. As of version~6.0, the information is stored in
% |\b@|\emph{key} for each citation, as four separate items.
% \begin{quote}\begin{tabular}{lll}
%   1. & |\NAT@num| & sequence number or non-author--year label \\
%   2. & |\NAT@date| & year, with possible extra label \\
%   3. & |\NAT@name| & short author list \\
%   4. & |\NAT@all@names| & long author list (optional) 
% \end{tabular}\end{quote}
% In order to define each of the above commands as the appropriate item, it
% is first necessary to expand |\b@|\emph{key} into a temporary command
% |\NAT@temp|, which is then used as the argument of |\NAT@split|, which
% makes the individual assignments.
%    \begin{macrocode}
\newcommand\NAT@parse[1]{{%
%<*209>
      \@ifundefined{documentclass}
       {\let\prm=\relax\let\psf=\relax\let\ptt=\relax\let\pbf=\relax
        \let\psl=\relax\let\psc=\relax\let\pit=\relax\let\pem=\relax
        \let\prmfamily=\relax\let\psffamily=\relax\let\pttfamily=\relax
        \let\pbfseries=\relax\let\pslshape=\relax\let\pscshape=\relax
        \let\pitshape=\relax\let\pmdseries=\relax\let\pupshape=\relax
        \let\pc=\relax \let\pd=\relax \let\pb=\relax}
       {\let\protect=\@unexpandable@protect\let~\relax}%
%</209>
%<!209>     \let\protect=\@unexpandable@protect\let~\relax
%<!209>     \let\active@prefix=\@gobble
     \xdef\NAT@temp{\csname b@#1\@extra@b@citeb\endcsname}}%
     \expandafter\NAT@split\NAT@temp
     \expandafter\NAT@parse@date\NAT@date??????@@%
%<!subpack&!209>     \ifciteindex\NAT@index\fi
}
%    \end{macrocode}
% Some further notes on the above: for 2.09 it is necessary to turn off all the
% protected font commands |\prm| etc.\ when the label text is expanded into
% |\NAT@temp|, for otherwise there will be problems with the New Font
% Selection Scheme (NFSS); the protected sub-accent commands (protected
% versions of |\c|, |\d|, and |\b|) also cause troubles on expansion.
% Admittedly, this is not a good solution, for the list of problem commands
% might be much longer, but for the meantime, this will have to do.
% 
% For \LaTeXe, at least after the official release of
% \texttt{1994/06/01}, commands are made robust in a totally different
% manner, no longer by adding a \texttt{p} in front, but by adding a space
% afterwards. This means the commands in the auxiliary files look like the
% protected version once again, and not raw commands. They are infinitely
% protected. The above problem is easily overcome by making |\protect|
% equal to |\@unexpandable@protect|. A definitive list of commands to 
% protect is no longer necessary. (Initially I used |\noexpand|, but
% that only worked for font commands, not accents. Reading the documentation
% in \texttt{ltdefns.dtx} indicated that this is the better redefinition
% of |\protect|.)
%
% This trick is also applied to the 2.09 version for when it is running
% in the compatibility mode of \LaTeXe. This is needed for the 
% journal-specific coding, more than for the normal package.
% 
% The |\active@prefix| command appearing in \texttt{babel} causes problems
% at this point, so deactivate it.
% 
% The automatic indexing of citations (|\NAT@index|) is described in
% Section~\ref{sec:idx}.
% 
% \end{macro}
% 
% \begin{macro}{\NAT@split}
% \changes{5.3}{1994 Sep 13}{Changed to support full author list}
% \changes{5.5}{1995 May 14}{Fix coding slightly}
% \changes{5.5}{1995 May 18}{Renamed from \cs{@citez}}
% \changes{6.0}{1995 Sep 4}{Recode for new \cs{bibcite} structure}
% The actual assignments of the author--year and numerical label texts to
% the corresponding commands is carried out by |\NAT@split|. If the long
% author list is missing (argument |#4|), it is set equal to the short
% list.
%    \begin{macrocode}
\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}
%    \end{macrocode}
% \end{macro}
% 
% \begin{macro}{\NAT@parse@date}
% \changes{5.4}{1995 Feb 6}{Add macro to split date into year and extra label}
% \changes{5.5}{1995 Mar 24}{Put extra label in braces to localize any font
%      changes}
% \changes{5.5}{1995 May 18}{Rename from \cs{@parse@date}}
% With version 5.4, add the macro |\NAT@parse@date| that splits the date up
% into year and extra label, putting them into |\NAT@year| and |\NAT@exlab|.
% This is used to test if authors and years are equal for two adjacent
% citations, in which case, only the extra label is printed. The 
% macro searches the first 4 characters of the date for a letter 
% (|\catcode|=11) which then becomes the extra label. If there are only
% numerals in the first 4 positions (more precisely, non-letters), the 5th
% character is taken as extra label. If there is none, this will be a 
% question mark.
%    \begin{macrocode}
\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}
%    \end{macrocode}
% \end{macro}
%
% \subsection{Automatic Index Entries for Citations}\label{sec:idx}
% 
% \begin{macro}{\NAT@idxtxt}
% \changes{6.0}{1995 Sep 21}{Add macro}
% \begin{macro}{\NAT@index}
% \changes{6.0}{1995 Sep 21}{Add macro}
% \changes{6.9}{1999 Jan 22}{Allow \cs{makeindex} to be issued before package 
%             loaded}
% To make an entry in the index for every citation, I have added
% |\NAT@index| to the |\NAT@parse| command. This will do nothing unless
% |\makeindex| has been issued in the preamble, in which case it writes the
% citation information to the \texttt{.idx} file by means of the standard
% \LaTeX\ internal |\@wrindex|. The actual format of the citation
% information is contained in |\NAT@idxtxt| which a user may redefine if
% needed.
%    \begin{macrocode}
%<*!subpack&!209>
\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}
%    \end{macrocode}
% If |\makeindex| has already been issued before \thestyle\ is loaded, it 
% does not contain these extra features. Thus issue it once more, but only with 
% the extra features.
%    \begin{macrocode}
\@ifundefined{@indexfile}{}{\let\NAT@makeindex\relax\makeindex}
%    \end{macrocode}
% \end{macro}\end{macro}
% \begin{macro}{\ifciteindex}
% \changes{6.0}{1995 Sep 21}{Add flag}
% The switch for activating automatic citation indexing is defined here.
%    \begin{macrocode}
\newif\ifciteindex \citeindexfalse
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\citeindextype}
% \changes{6.0}{1995 Sep 29}{Add macro}
% \begin{macro}{\NAT@index@alt}
% \changes{6.0}{1995 Sep 29}{Add macro}
% The above coding will not work with the package \texttt{index.sty} by
% David~M. Jones. For that package, an alternative definition of |\NAT@index|
% is needed which is activated at the beginning of the document if
% \texttt{index} has been loaded. It thus does not matter in which order
% \thestyle\ or \texttt{index} are loaded.
% 
% With the \texttt{index} package, it is possible to have several index
% files, defined by a |\newindex| command that associates a name with two
% file extensions. By default, the name \texttt{default} is associated with
% \texttt{.idx} and \texttt{.ind}. To make the automatic index entries go to
% a different set, redefine |\citeindextype|.
% 
%    \begin{macrocode}
\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}{}}
%</!subpack&!209>
%    \end{macrocode}
% \end{macro}\end{macro}
% 
% \subsection{Writing the Entries to the Auxiliary File}
% 
% \noindent(New to version 6.0.)
%
% The author--year information is transferred from the \btx{} database to
% the document via |\bibitem| commands in the |thebibliography|
% environment. Standard \LaTeX\ simply assigns a running number to these
% entries, and writes that number with the citation key to the auxiliary
% file. For author--year citations, the author list and year must be written
% somehow to the auxiliary file. The form for this is to be
% \begin{quote}
% |\bibcite|\marg{key}|{|\marg{num}\marg{year}\marg{short}\marg{long}|}|
% \end{quote}
% This is the same form as in standard \LaTeX, except that the second
% argument becomes a set of 4 items. Here \emph{num} is the sequential
% number that is to be used if a numerical style is selected, \emph{short}
% is the abbreviate author list (Jones et al.), \emph{long} the full author
% list.
% 
% The author--year information is contained in the optional argument to
% |\bibitem|, but just how it is formatted depends on the system used. The
% native \thestyle\ syntax is
% \begin{quote}
% |\bibitem[|\emph{short}|(|\emph{year}|)|\emph{long}|]|\marg{key}
% \end{quote}
% while the \texttt{chicago} system is
% \begin{quote}
% |\bibitem[\protect\citeauthoryear|\marg{long}\marg{short}\marg{year}|]|%
%   \marg{key}
% \end{quote}
% 
% \begin{macro}{\NAT@ifcmd}
% \changes{6.0}{1995 Sep 4}{Add macro}
% \begin{macro}{\NAT@ifxcmd}
% \changes{6.0}{1995 Sep 4}{Add macro}
% It is necessary to process the optional argument by first testing if it
% contains a command, and if so, to execute that command. Otherwise, insert
% our own command to process the following text.
%    \begin{macrocode}
\newcommand\NAT@ifcmd{\futurelet\NAT@temp\NAT@ifxcmd}
\newcommand\NAT@ifxcmd{\ifx\NAT@temp\relax\else\expandafter\NAT@bare\fi}
%    \end{macrocode}
% This actually only tests if the next token expands to |\relax|, which is
% what |\protect| will be at this point. If so, just procede: the command
% itself follows. Otherwise, insert |\NAT@bare|. (Note, we must also define
% the possible commands like |\citeauthoryear| to do what we want.)
% \end{macro}\end{macro}
% 
% \begin{macro}{\NAT@bare}
% \changes{6.0}{1995 Sep 4}{Add macro}
% \changes{6.6}{1997 Jun 4}{The \cs{stepcounter} made always present}
% The command that is inserted if none is present must parse the native
% syntax for the author--year information. The template is somewhat complex
% because it must be able to test if there are no parentheses at all, in
% which case it activates the alternative, |\NAT@apalk| for the
% \texttt{apalike} syntax. When |\NAT@ifcmd| is invoked, it adds
% |(@)(@)\@nil| in order to provide the full template of |\NAT@bare|; if the
% argument itself contains no text in parentheses (not \thestyle{}
% syntax) then |#2| will be |@|; otherwise, |#4| catches the extra 
% parentheses.
%
% Using |(@)| instead of the earlier |()| (pre~7.0) allows empty years to be 
% given. Empty years are now permitted for citations with a code designation 
% in place of the authors. Troubles will now occur if the year begins with 
% |@|.
%    \begin{macrocode}
\def\NAT@bare#1(#2)#3(@)#4\@nil#5{%
%<*all|apalike|authordate>
  \if @#2
  \expandafter\NAT@apalk#1, , \@nil{#5}\else
%</all|apalike|authordate>
  \stepcounter{NAT@ctr}%
  \NAT@wrout{\arabic {NAT@ctr}}{#2}{#1}{#3}{#5}
%<all|apalike|authordate>\fi
}
%    \end{macrocode}
% The |NAT@ctr| above contains the designation of whatever counter is
% selected in the list environment for the \texttt{thebibliography}; it is
% the sequential counter for the entries.
% \end{macro}
%
% \begin{macro}{\NAT@wrout}
% \changes{6.0}{1995 Sep 4}{Add macro}
% \begin{macro}{\NAT@noname}
% \changes{6.0}{1995 Sep 6}{Add macro}
% \changes{6.0}{1995 Sep 21}{Prevent expansion of forced space (tilde)}
% Write the information to the auxiliary file as two arguments to |\bibcite|.
% 
% Note: the 5 arguments are: counter, year, short list, long list, key.
% The two author lists are written enclosed in braces to make sure any
% font commands are kept local. Otherwise, one level of braces disappears for
% authors like |{\em Jones}|.
%
% To test later for the absence of names, define |\NAT@noname| here.
% Define it with |\def|, otherwise it will be `long' and will not test
% correctly with |\NAT@all@names| which is defined with |\gdef|.
%    \begin{macrocode}
\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{{}}
%    \end{macrocode}
% \end{macro}\end{macro}
% 
% \begin{macro}{\bibitem}
% \changes{6.0}{1995 Sep 4}{Recode from standard}
% \begin{macro}{\@lbibitem}
% \changes{6.0}{1995 Sep 4}{Recode from standard}
% \changes{6.4}{1996 Oct 2}{Add dummy macros for \texttt{hyperref.sty}}
% The above commands are initiated with |\NAT@ifcmd| which decides whether
% |\NAT@bare| or one of the other commands is to be executed on the
% following arguments. It is actually |\@lbibitem| that calls |\NAT@ifcmd|,
% which in turn is invoked by the user command |\bibitem|.
% 
% If |\bibitem| has no optional argument, then we have a numerical citation
% style, which is to be forced by setting |\NAT@stdbst|. Put the sequential
% counter value in as the argument to |\@lbibitem| which is then treated as
% a non-author--year label.
%    \begin{macrocode}
\renewcommand\bibitem{%
  \@ifnextchar[{\@lbibitem}{%
%<!subpack>    \global\NAT@stdbsttrue
    \stepcounter{NAT@ctr}\@lbibitem[\arabic{NAT@ctr}]}}
%    \end{macrocode}
% Write the label with |\item| in the bibliography listing with the current
% value of |\NAT@num|, if it exists. This will either be the sequential
% number or whatever non-author--year text that was given as a special
% `numerical'. Since |\@biblabel| outputs only in numerical mode, this
% label vanishes for author--year mode.
% 
% Finally invoke |\NAT@ifcmd| with the funny template to activate
% |\NAT@bare| or some alternative.
%
% \changes{6.8b}{1998 July 6}{To work with \texttt{chapterbib} and 
%      \texttt{backref}}
% The \texttt{hyperref} package can call the \texttt{backref} package which 
% do not work with the \texttt{chapterbib} package. I have arranged with 
% Sebastian Rahtz to add the compatibility via \thestyle. Thus I add a fix to 
% include the |\@extra@b@citeb| suffix to the |\br@#2| commands called by 
% \texttt{backref}.
%    \begin{macrocode}
\def\@lbibitem[#1]#2{%
  \if\relax\@extra@b@citeb\relax\else
    \@ifundefined{br@#2\@extra@b@citeb}{}{%
     \@namedef{br@#2}{\@nameuse{br@#2\@extra@b@citeb}}}\fi
   \@ifundefined{b@#2\@extra@b@citeb}{\def\NAT@num{}}{\NAT@parse{#2}}%
   \item[\hfil\hyper@natanchorstart{#2\@extra@b@citeb}\@biblabel{\NAT@num}%
    \hyper@natanchorend]%
    \NAT@ifcmd#1(@)(@)\@nil{#2}}
%    \end{macrocode}
% Note: in standard \LaTeX, the sequential list counter is printed directly
% with |\item|, and then written to the auxiliary file so that |\cite| can
% refer to it on the next run. Here, |\item| prints exactly the same thing
% as |\cite| on the current run, if we are in numerical mode, otherwise
% nothing.
%
% \changes{6.3}{1996 Jun 10}{Include \texttt{showkeys} coding if already
%               loaded}
% \changes{6.4}{1996 Jun 27}{Remove from 2.09 coding}
% \changes{6.7}{1997 Sep 12}{Test for existence of \cs{SK@lbibitem}}
% If the \texttt{showkeys} package has already been loaded, the revised
% version of |\@lbibitem| will not have been saved. In this case, rerun some
% of the coding from that package. (If \texttt{showkeys} is loaded after
% \thestyle, there is no problem.)
% 
% Do not test if \texttt{showkeys} is loaded, but rather if |\SK@lbibitem|
% is defined. See comment on \texttt{showkeys} with option \texttt{final}
% on page~\pageref{SKdef}.
% 
%    \begin{macrocode}
%<*!209>
\ifx\SK@lbibitem\@undefined\else
   \let\SK@lbibitem\@lbibitem
   \def\@lbibitem[#1]#2{%
     \SK@lbibitem[#1]{#2}\SK@\SK@@label{#2}\ignorespaces}\fi
%</!209>
%    \end{macrocode}
% \end{macro}\end{macro}
% 
% \begin{macro}{\ifNAT@stdbst}
% \changes{6.0}{1995 Sep 4}{Add flag}
% If any non-author--year |\bibitem|s have been issued, then force
% numerical mode, since the author--year |\bibitem|s can handle this, but
% the numerical ones cannot work in author--year mode. Do this by inserting
% |\NAT@numberstrue| in the auxiliary file.
%    \begin{macrocode}
%<*!subpack>
\newif\ifNAT@stdbst \NAT@stdbstfalse

%<209>\let\NAT@enddoc=\enddocument
%<209>\def\enddocument
%<!209>\AtEndDocument
  {\ifNAT@stdbst\if@filesw\immediate\write\@auxout{\string
   \global\string\NAT@numberstrue}\fi\fi
%<209>\NAT@enddoc
  }
%</!subpack>
%    \end{macrocode}
% \end{macro}
% 
% \begin{macro}{\bibcite}
% \changes{6.1}{1995 Dec 5}{Add own coding for this macro}
% \changes{6.1a}{1995 Dec 19}{Add own test for changed citations}
% Not wanting to rely on the coding for |\bibcite| in the kernel, I define
% it myself. It is not enough just to `provide' it, for it must do the 
% right thing: write a label named |\b@|\emph{key}. The \LaTeX3 boys
% might decide to keep the command, but have it store the citations with
% a different prefix.
% 
% (I outsmarted myself here again. The test for changed citations and
% references involves reading in the auxiliary file with revised
% definitions for |\label| and |\bibcite|. The December~1995 release does
% this via a generalized labelling command |\@newl@bel|. As a result, I
% must add this test myself. Not so bad, because the warning comes from
% \thestyle\ and explicitly refers to citations instead of just
% `references'.)
%    \begin{macrocode}
%<*!209>
\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\let\bibcite\NAT@testdef}
\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}
%</!209>
%<209>\renewcommand\bibcite[2]{\global\@namedef{b@#1\@extra@binfo}{#2}}
%    \end{macrocode}
% \end{macro}
% 
% \subsection{Other Author--Year Schemes}
% \begin{macro}{\NAT@apalk}
% \changes{4.1}{1993 Oct 4}{Simplify by using comma-space as separator}
% \changes{5.3}{1994 Sep 13}{Full author list equals short list}
% \changes{5.5}{1995 May 18}{Renamed from \cs{@citeapalk}}
% \changes{6.0}{1995 Sep 4}{Recoded for version~6.0}
% If the argument of |\bibitem| contains no command, and if it does not
% conform to the \thestyle{} syntax, then try the \texttt{apalike}
% syntax (\emph{short}\texttt{, }\emph{year}). This has a funny template
% too in order to test for different syntax, which is indicated when |#2|
% is empty. In this case, give up trying to fit it to author--year formats,
% and go over to `numerical' with a special label. Set the flag
% |\NAT@stdbst| to mark this. This forces a numerical citation style.
%    \begin{macrocode}
%<*all|apalike|authordate>
\newcommand\NAT@apalk{}
\def\NAT@apalk#1, #2, #3\@nil#4{\if\relax#2\relax
%<!subpack>  \global\NAT@stdbsttrue
  \NAT@wrout{#1}{}{}{}{#4}\else
  \stepcounter{NAT@ctr}%
  \NAT@wrout{\arabic {NAT@ctr}}{#2}{#1}{}{#4}\fi}
%</all|apalike|authordate>
%    \end{macrocode}
% Note: the |NAT@ctr| is stepped here and everywhere else it is used,
% except when a special `numerical' label is being used. This conforms to
% standard \LaTeX\ which only increments the counter for pure numerical
% labels, without an optional argument to |\bibitem|.
% \end{macro}
% 
% The other schemes of citation labelling may also be accommodated, more
% easily than \texttt{apalike}. It is just necessary to define the particular
% commands, like |\citeauthoryear| to write the arguments to the
% auxiliary file in the required. These commands are detected by
% |\NAT@ifcmd| and simply left to be executed.
% 
% The only complication is that |\citeauthoryear| may be given with two or
% three arguments. This is accommodated by testing the |#3| and changing
% the form of the write command accordingly.
% 
% The form of the template is the same as for |\NAT@bare|, since this
% command is inserted in its place and must therefore conform to its
% syntax.
% 
% \begin{macro}{\citeauthoryear}
% \changes{5.3}{1994 Sep 13}{Allow full authors in citation}
% \changes{6.0}{1995 Sep 4}{Recode for version 6.0}
% For \texttt{newapa.bst} itself, the commands |\citestarts|, |\citeends|,
% as well as |\betweenauthors| must be defined; for others in this group,
% these commands are not needed.
%    \begin{macrocode}
%<*newapa|chicago|all>
\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}
%</newapa|chicago|all>
%    \end{macrocode}
% \end{macro}
% 
% \begin{macro}{\astroncite}
% \changes{6.0}{1995 Sep 4}{Recode for version 6.0}
% The |\astroncite| command must similarly conform to |\NAT@bare| syntax
% and put its arguments into the auxiliary file in the correct order.
%    \begin{macrocode}
%<*astron|all>
\newcommand\astroncite{}
\def\astroncite#1#2(@)(@)\@nil#3{\stepcounter{NAT@ctr}\NAT@wrout{\arabic
{NAT@ctr}}{#2}{#1}{}{#3}}
%</astron|all>
%    \end{macrocode}
% \end{macro}
% 
% \begin{macro}{\citename}
% \changes{6.0}{1995 Sep 4}{Recode for version 6.0}
% The |\citename| command just converts its arguments to the |\NAT@apalk|
% syntax, since its first argument should end in \verb*!, ! as for
% \texttt{apalike}. By making use of |\NAT@apalk| here, it is also possible
% to check for non-conformity of the syntax.
%    \begin{macrocode}
%<*authordate|all>
\newcommand\citename{}
\def\citename#1#2(@)(@)\@nil#3{\expandafter\NAT@apalk#1#2, \@nil{#3}}
%</authordate|all>
%    \end{macrocode}
% \end{macro}
% 
% \begin{macro}{\harvarditem}
% \changes{5.3}{1994 Sep 13}{Allow full authors in citation}
% \changes{5.5}{1995 May 18}{Defined in \LaTeXe\ terms}
% The Harvard family is allowed for simply by defining |\harvarditem| in
% terms of |\bibitem| with the \thestyle{} form.
% 
% The |\harvarditem| must allow for the optional argument, which is 
% the short author list. Use the short list in |\bibitem| if it is there,
% otherwise the long list must be taken.
% 
%    \begin{macrocode}
%<*harvard|all>
%<!209>\newcommand\harvarditem[4][]%
%<209>\def\harvarditem{\@ifnextchar[{\@harvarditem}{\@harvarditem[]}}
%<209>\def\@harvarditem[#1]#2#3#4%
    {\if\relax#1\relax\bibitem[#2(#3)]{#4}\else
        \bibitem[#1(#3)#2]{#4}\fi }
%    \end{macrocode}
% The command |\citeasnoun| must be defined since \texttt{harvard.bst}
% can add it for cross-referencing.
% \end{macro}
%
% \begin{macro}{\harvardleft}
% \changes{5.3}{1994 Sep 13}{Add macro}
% \begin{macro}{\harvardright}
% \changes{5.3}{1994 Sep 13}{Add macro}
% \begin{macro}{\harvardyearleft}
% \changes{5.3}{1994 Sep 13}{Add macro}
% \begin{macro}{\harvardyearright}
% \changes{5.3}{1994 Sep 13}{Add macro}
% \begin{macro}{\harvardand}
% \changes{5.3}{1994 Sep 13}{Add macro}
% \begin{macro}{\harvardurl}
% \changes{5.3}{1994 Sep 13}{Add macro}
% \changes{6.7}{1997 Jul 15}{Fix macro, use only one \texttt{\#}}
% The \texttt{harvard} package has been updated for \LaTeXe, and includes
% some new punctuation commands in the accompanying \texttt{bst} files.
% (Maybe they were always there and I overlooked them.) In order for
% \thestyle{} to work with these, it needs to define them. The |left| and 
% |right| commands have equivalents already; |\harvardurl| is defined
% as in \texttt{harvard.sty}. It is necessary to define |\harvardand|
% conditionally, and only later, in case it has already been set to
% something else by a |\bibstyle@xxx| (e.g., \texttt{agsm} sets it
% to |\&|.)
%    \begin{macrocode}
\newcommand\harvardleft{\NAT@open}
\newcommand\harvardright{\NAT@close}
\newcommand\harvardyearleft{\NAT@open}
\newcommand\harvardyearright{\NAT@close}
%<!209>\AtBeginDocument{\providecommand{\harvardand}{and}}
%<209>\def\harvardand{and}
\newcommand\harvardurl[1]{\textbf{URL:} \textit{#1}}
%</harvard|all>
%    \end{macrocode}
% \end{macro}\end{macro}\end{macro}\end{macro}\end{macro}\end{macro}
%
% \subsection{The Bibliography Listing}
% Changes must be made to the \texttt{thebibliography} environment for
% author--year citations. This is done be defining the environment with the
% features common to both schemes, and then by invoking |\@bibsetup|, which
% is either the author--year or numerical version.
% 
% \begin{macro}{\bibsection}
% \changes{4.2}{1993 Oct 22}{Make specific for JGR, GRL, NLINPROC}
% \changes{5.5}{1995 May 18}{Use \cs{renewcommand}}
% \changes{6.2}{1996 Apr 15}{Modified for \texttt{amsart} and \texttt{amsbook}}
% \changes{6.4}{1996 Sep 1}{Modified for \texttt{sectionbib} option}
% \changes{6.5}{1997 Feb 5}{Allow for \cs{bib@headings} in KOMA scripts}
% \changes{7.0}{1999 May 21}{Use \cs{chapter*} for \texttt{amsbook}}
% First, |\bibsection| is defined according to the main style: if chapters
% exist, then the bibliography is a numberless chapter, otherwise a
% numberless section. For the specific journals, |\bibsection| takes on
% special definitions.
% 
% Since the AMS classes \texttt{amsart} and \texttt{amsbook} redefine
% |\section*| in a way that is incompatible with the way it is used in 
% the \texttt{bibliographystyle} environment, it is necessary to remove the
% |\@mkboth| from the section title. Since these classes do not use this
% command at this point, there is no loss of functionality.
%
% The packages of the KOMA scripts make use of |\bib@heading| which functions
% much like |\bibsection|. If it is defined, let |\bibsection| be equal to it.
%    \begin{macrocode}
%<*!agu&!egs>
%<!209>\providecommand\bibsection{}
%<209>\def\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}}}}
%<*!subpack>
%<*!209>
\@ifclassloaded{amsart}%
  {\renewcommand\bibsection{\section*{\refname}}}{}
\@ifclassloaded{amsbook}%
  {\renewcommand\bibsection{\chapter*{\bibname}}}{}
%</!209>
\@ifundefined{bib@heading}{}{\let\bibsection\bib@heading}
%</!subpack>
%</!agu&!egs>
%<egs>\def\bibsection{\if@draft\newpage\fi
%<egs>    \noappendix\section*{\refname}}
%    \end{macrocode}
% \end{macro}
% 
% \begin{environment}{thebibliography}
% \changes{4.1b}{1993 Oct 18}{Add \cmd{\bibfont}, defaulted
%                to \cmd{\relax}}
% \changes{4.2}{1993 Oct 22}{Add coding for JGR, GRL, NLINPROC}
% \changes{4.2}{1993 Nov 20}{Remove coding for AGU, since AGU-supplied
%         coding is adequate but different}
% \changes{5.1}{1994 Jun 22}{Put \cmd{\bibfont} at start so \cmd{\list}
%     uses list parameters appropriate for the font size}
% \changes{5.1}{1994 Jun 22}{Add \cmd{\if@openbib} as in \LaTeXe}
% \changes{5.5}{1995 Mar 27}{Add special cross-ref citations for compatibility
%     with \texttt{harvard}, \texttt{chicago}, and \texttt{named}}
% \changes{6.1}{1995 Nov 22}{Replace \cs{if@openbib} with \cs{ifNAT@openbib}}
% \changes{6.1}{1995 Dec 4}{Replace counter \texttt{enumiv} with
%    \texttt{NAT@ctr} and refer to it explicitly, not with \cs{@listctr}}
% \changes{6.1}{1995 Dec 4}{Use \cs{PackageWarning} for empty
%      bibliography}
% \changes{6.9a}{1999 Apr 20}{Add \cs{bibpreamble}}
%
% The \texttt{thebibliography} environment is defined much as normal, except
% that |\bibsetup| contains the special features for numerical or
% author--year styles. The command |\bibfont| permits permits different
% font sizes or styles to be used in the list. For example, for 
% \textsl{Nonlinear Processes} it is |\small|. This means |\bibfont| must
% be issued before the |\list| command, since the list parameters depend
% on the current font size. For \textsl{AGU}, the whole
% |\thebibliography| is left off, since the AGU-supplied coding will
% do. It is only necessary to add |\noappendix| to the AGU coding.
% 
% I have replaced |\if@openbib| with |\ifNAT@openbib| in order to be
% independent of the standard classes; this flag disappeared with the
% December~1995 release of \LaTeX, so I do it myself just to be sure.
% 
% At the same time,
% I have also decided to use my own counter |NAT@ctr| for the numericals;
% previously I used |enumiv| as in the standard, and refered to it
% elsewhere with |\@listctr|, but now I refer to it explicitly. This is to
% avoid trouble if |\@listctr| should ever disappear. (The value of
% |\@listctr| is set by |\usecounter|.)
%    \begin{macrocode}
\newcounter{NAT@ctr}
%<*!agu>
\renewenvironment{thebibliography}[1]{%
 \bibsection\parindent \z@\bibpreamble\bibfont\list
   {\@biblabel{\arabic{NAT@ctr}}}{\@bibsetup{#1}%
    \setcounter{NAT@ctr}{0}}%
%<*!209&!subpack>
    \ifNAT@openbib
      \renewcommand\newblock{\par}
    \else
      \renewcommand\newblock{\hskip .11em \@plus.33em \@minus.07em}%
    \fi
%</!209&!subpack>
%<209|subpack>      \def\newblock{\hskip .11em plus.33em minus.07em}%
    \sloppy\clubpenalty4000\widowpenalty4000
    \sfcode`\.=1000\relax
%    \end{macrocode}
% The files \texttt{chicago.bst} and \texttt{named.bst} can add the
% commands |\citeN| and |\shortcite| respectively to the \texttt{.bbl}
% files, for cross-referencing. Similarly, \texttt{harvard.bst} can add
% |\citeasnoun|. These commands must therefore be accommodated, 
% as least within the |thebibliography| environment.
%    \begin{macrocode}
%<newapa|chicago|all>    \let\citeN\cite \let\shortcite\cite
%<harvard|all>    \let\citeasnoun\cite
 }{\def\@noitemerr{%
%<209>  \@warning
%<!209>  \PackageWarning{natbib}
     {Empty `thebibliography' environment}}%
  \endlist\vskip-\lastskip}
%<!egs>\let\bibfont\relax
%<egs>\let\bibfont\small
\let\bibpreamble\relax
%</!agu>
%<*agu>
\let\aguthebib=\thebibliography
\def\thebibliography#1{\noappendix\aguthebib{#1}}
%</agu>
%    \end{macrocode}
% \end{environment}
% 
% \subsection{Compatibility Commands}
% \begin{macro}{\reset@font}
% \begin{macro}{\refname}
% \changes{6.4}{1996 Jun 18}{Provide name with \LaTeXe\ too}
% \begin{macro}{\bibname}
% \changes{6.4}{1996 Jun 18}{Provide name with \LaTeXe\ too}
% For older implementations of \LaTeX~2.09 (before December, 1991) the
% |\reset@font| command does not exist. It is defined to be |\relax| under
% normal \LaTeX{}, but does more under NFSS. In case it is not defined, add
% it here. The naming commands |\bibname| and |\refname| are similarly
% unknown for this old \LaTeX. They are sometimes even unknown in non-standard
% classes that are used in place of \texttt{article}, \texttt{report}, and
% \texttt{book}.
%    \begin{macrocode}
%<*!209>
\providecommand\reset@font{\relax}
\providecommand\bibname{Bibliography}
\providecommand\refname{References}
%</!209>
%<*209>
\@ifundefined{reset@font}{\let\reset@font=\relax}{}
%<!agu&!egs>\@ifundefined{bibname}{\newcommand\bibname{Bibliography}}{}
\@ifundefined{refname}{\newcommand\refname{References}}{}
%</209>
%    \end{macrocode}
% \end{macro}\end{macro}\end{macro}
%
% \begin{macro}{\NAT@citeundefined}
% \changes{6.1}{1995 Nov 22}{Add macro}
% The December~1995 release of \LaTeX\ considered renaming the command
% |\G@refundefinedtrue| for flagging undefined references. However, since a
% number of packages, including \thestyle, were affected, it was decided to
% retain the old name for the new coding. I had already decided to go for
% an independent coding, which does exactly the same thing.
%    \begin{macrocode}
%<*!209>
\newcommand\NAT@citeundefined{\gdef \NAT@undefined {%
    \PackageWarningNoLine{natbib}{There were undefined citations}}}
\let \NAT@undefined \relax
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\NAT@citemultiple}
% \changes{6.1}{1995 Dec 6}{Add macro}
% Add the warning about multiply-defined citations, as part of the
% do-it-yourself |\bibcite| definition.
%    \begin{macrocode}
\newcommand\NAT@citemultiple{\gdef \NAT@multiple {%
    \PackageWarningNoLine{natbib}{There were multiply defined citations}}}
\let \NAT@multiple \relax
\AtEndDocument{\NAT@undefined\NAT@multiple}
%</!209>
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@mkboth}
% \changes{6.1}{1995 Dec 4}{Provide macro in case it is removed from
%     kernel}
% Having been burned by the December~1995 update on several internal
% commands, I have decided to make \thestyle\ as independent as
% possible, or at least to avoid it crashing when internals are changed or
% disappear in future. The |\@mkboth| is used in the bibliography listing,
% and is the same as |\makeboth| with \texttt{headings} pagestyle. Provide
% a dummy in case it disappears. If the kernel should use a different
% command in future, the headings will not function, but at least there
% will be no crash. (Also needed for very old versions of \LaTeX~2.09.)
%    \begin{macrocode}
%<209>\@ifundefined{@mkboth}{\newcommand\@markboth[2]{}}{}
%<!209>\providecommand\@mkboth[2]{}
%    \end{macrocode}
% \end{macro}
% 
% \begin{macro}{\MakeUppercase}
% \changes{6.1}{1995 Dec 4}{Provide compatibility for older versions}
% The |\MakeUppercase| command replaces |\uppercase| in \LaTeXe\ of
% June~1995. Provide it for earlier versions.
%    \begin{macrocode}
%<209>\let\MakeUppercase\uppercase
%<!209>\providecommand\MakeUppercase{\uppercase}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\@extra@b@citeb}
% \changes{6.4}{1996 Sep 1}{Add macro for \texttt{chapterbib.sty}}
% \begin{macro}{\@extra@binfo}
% \changes{6.4}{1996 Sep 1}{Add macro for \texttt{chapterbib.sty}}
% Two commands used by the \texttt{chapterbib} package, but which must 
% be defined to be nothing for use without that package. Do not |\let| them
% be |\relax|, for that package checks if they exist (i.e., not |\relax|)
% and redefines things like |\@citex|, which we do not want to have happen.
% The necessary redefinitions are already included in \thestyle.
%    \begin{macrocode}
%<209>\@ifundefined{@extra@b@citeb}{\def\@extra@b@citeb{}}{}
%<!209>\providecommand{\@extra@b@citeb}{}
\gdef\@extra@binfo{}
%    \end{macrocode}
% \end{macro}\end{macro}
%
% \begin{macro}{\hyper@natanchorstart}
% \changes{6.4}{1996 Oct 2}{Provide macro for \texttt{hyperref} package}
% \begin{macro}{\hyper@natanchorend}
% \changes{6.4}{1996 Oct 2}{Provide macro for \texttt{hyperref} package}
% \begin{macro}{\hyper@natlinkstart}
% \changes{6.4}{1996 Oct 2}{Provide macro for \texttt{hyperref} package}
% \begin{macro}{\hyper@natlinkend}
% \changes{6.4}{1996 Oct 2}{Provide macro for \texttt{hyperref} package}
% \begin{macro}{\hyper@natlinkbreak}
% \changes{6.8b}{1998 July 2}{Provide macro for \texttt{hyperref} package}
% The \texttt{hyperref} package of Sebastian Rahtz and Yannis Haralambous 
% defines these macros to
% make hypertext links and references. Without that package, these macros
% must be turned off. The order of loading \thestyle\ and \texttt{hyperref} 
% should not be important even though it is recommended that 
% \texttt{hyperref} be loaded last.
% 
% The \texttt{hyperref} package does not work with \texttt{chapterbib}, but I 
% have arranged with Sebastian Rahtz to add the necessary suffixes via 
% \thestyle. This involves adding |\@extra@b@citeb| to all calls to 
% |\hyper@natlinkstart| and |\hyper@natanchorstart|. To get \texttt{backref} to 
% work, I needed to add a hack to my |\@lbibitem|.
% 
% The |\hyper@natlinkbreak| to designed to break links between the names and 
% date, avoiding some possible problems when links go over a page.
%    \begin{macrocode}
%<*!209>
\providecommand\hyper@natanchorstart[1]{}
\providecommand\hyper@natanchorend{}
\providecommand\hyper@natlinkstart[1]{}
\providecommand\hyper@natlinkend{}
\providecommand\hyper@natlinkbreak[2]{#1}
%</!209>
%<*209>
\@ifundefined{hyper@natanchorstart}{\def\hyper@natanchorstart#1{}}{}
\@ifundefined{hyper@natanchorend}{\def\hyper@natanchorend{}}{}
\@ifundefined{hyper@natlinkstart}{\def\hyper@natlinkstart#1{}}{}
\@ifundefined{hyper@natlinkend}{\def\hyper@natlinkend{}}{}
\@ifundefined{hyper@natlinkbreak}{\def\hyper@natlinkbreak#1#2{#1}}{}
%</209>
%    \end{macrocode}
% \end{macro}\end{macro}\end{macro}\end{macro}\end{macro}
% 
% \changes{6.7}{1997 Nov 10}{Accommodate \texttt{babel}'s redefinitions}
% \changes{6.9}{1999 Feb 26}{Include \texttt{babel} accommodation with 
%           \texttt{subpack}}
% \changes{6.9a}{1999 Apr 20}{Fixes for \texttt{babel} 3.6t}
% The \texttt{babel} bundle redefines several internal commands in order to 
% handle special active characters required by some languages. One of these
% redefined commands is |\@citex|. This fails for \thestyle\ for two 
% reasons: the syntax is different and the \thestyle\ definition of |\@citex|
% has not yet been finalized. I correct this doing \texttt{babel}'s 
% redefinition at the |\begin{document}| with the right syntax. 
% 
% The main purpose of these redefinitions is to allow special active characters 
% to appear in the citation keys. To this end, |\@citex|, |\bibcite|, 
% |\nocite|, |\@bibitem|, and |\@lbibitem| need changing such that the active 
% characters are turned off when the keys are processed. In the case of 
% |\bibcite|, which is only ever called in a context where the active 
% characters are turned off, the second argument, the actual label, has the 
% active characters temporarily turned on. This causes \thestyle\ to crash; 
% hence \texttt{babel} now checks (v3.6t) for \thestyle\ and keeps the original 
% definition. This means any active characters in the \thestyle\ labels will 
% not be processed correctly, but these special characters should never be here 
% anyway, since they violate portability. 
% 
% It is also necessary to redefine |\NAT@testdef| which also uses the keys as 
% arguments. (It is a replacement for |\bibcite| for when the \texttt{.aux} 
% file is read in at the end.) Furthermore, |\@lbibitem| needs redefining, but 
% \texttt{babel} does not (yet) do this, only |\@bibitem|. 
% 
% Strictly speaking, \thestyle\ should be loaded before \texttt{babel} so that 
% the latter saves and modifies the \thestyle\ definitions, and not the 
% standard \LaTeX\ ones. However, in reality this is not necessary since 
% |\bibcite| is not redefined with \thestyle\ and |\@citex| is redefined by 
% \thestyle\ itself after the preamble. However, |\nocite| and |\@lbibitem| can 
% cause problems with the ordering. Solve this by redefining them immediately 
% if \texttt{babel} is present (i.e., \texttt{babel} before \thestyle); in this 
% case, \texttt{babel} has previously redefined them wrongly, \thestyle\ then 
% creates its own base definitions, and the \texttt{babel} redefinition is now 
% carried out again, with the proper ``originals''. A complication comes with 
% |\@lbibitem| in that at present \texttt{babel} does not redefine it, so it 
% must be (conditionally) added to the |\AtBeginDocument| hook in case 
% \thestyle\ is loaded first. If \texttt{babel} is changed in future, this 
% addition will not be needed and will not be executed. Thus the order of the 
% two packages is unimportant. 
% 
% Note: all this redefining is only important if there are keys containing
% active characters. One point to note is that optional notes containing active 
% characters will not work right for \texttt{babel}, neither with or 
% without \thestyle. They will work with the \texttt{german} package, but then 
% the keys with active characters will not. Oh boy!
% 
% With the journal coding (\texttt{subpack}), things are slightly different.
% For them it is |\@citex| that is defined directly, not |\NAT@citex|, so
% I have to restore that definition which \texttt{babel} has already
% altered and stored in |\org@@citex|.
% 
%    \begin{macrocode}
%<*!209>
%<*!subpack>
\@ifundefined{bbl@redefine}{}{% 
 \bbl@redefine\nocite#1{% 
  \@safe@activestrue\org@nocite{#1}\@safe@activesfalse}%
\bbl@redefine\@lbibitem[#1]#2{%
  \@safe@activestrue\org@@lbibitem[#1]{#2}\@safe@activesfalse}%
}
%</!subpack> 
\AtBeginDocument{\@ifundefined{bbl@redefine}{}{% 
%<subpack>\let\@citex\org@@citex
\bbl@redefine\@citex[#1][#2]#3{%
  \@safe@activestrue\org@@citex[#1][#2]{#3}\@safe@activesfalse}%
\bbl@redefine\NAT@testdef#1#2{%
  \@safe@activestrue\org@NAT@testdef{#1}{#2}\@safe@activesfalse}%
\@ifundefined{org@@lbibitem}{%
\bbl@redefine\@lbibitem[#1]#2{%
  \@safe@activestrue\org@@lbibitem[#1]{#2}\@safe@activesfalse}}{}%
}}
%</!209>
%    \end{macrocode}
% 
% \subsection{Sorting and Compression of Numbers}
% The \texttt{cite} and (obsolete) \texttt{citesort} packages by Donald
% Arseneau provide the coding for printing multiple citation numbers in
% ascending order, and with a range where applicable. That is, if the
% normal result of |\cite{..}| with several keys were [5, 3, 8, 4], the new
% result would be [3--5, 8].
% 
% Since \texttt{cite.sty} totally reimplements the citation commands (as
% does \thestyle) it is not possible to make the two compatible. Instead, I
% have removed the necessary coding from \texttt{cite.sty}, converted it to
% \thestyle\ format, and added it here. 
% 
% Originally I borrowed the coding from the \texttt{cite.sty} package, but for 
% version~6.6, I have adapted the coding so that it orders the citation keys
% according to the sequence in the reference list. This now works for both 
% numerical and author--year modes. The sorting is activated by the options
% \texttt{sort} and \texttt{sort\&compress}.
%
% \begin{macro}{\NAT@sort@cites}
% \changes{6.4}{1996 Oct 11}{Add coding from \texttt{cite.sty}}
% \changes{6.6}{1997 Jun 3}{Redo to sort cite keys; works with author--year 
%       mode}
% This feature is not provided for with \LaTeX~2.09. It does exist in the 
% journal subpackages, being selected by setting |\NAT@sort| accordingly: 0 
% for no sorting; 1 for sorting; 2 for sorting and compression (numerical mode 
% only). 
% 
% The macro |\NAT@sort@cites| places the reordered list of citation keys (the 
% argument to |\cite|\textit{xxx}) in |\NAT@cite@list|. If sorting is turned 
% off, this list is the same as the input. 
% 
% A sorted list of the citation numbers (|\NAT@num@list|) is made up following 
% Arseneau's procedure; from that the citation keys are placed in 
% |\NAT@cite@list| in the same order. If there are any non-numerical values of 
% |\NAT@num|, these are added to |\NAT@nonsort@list|, which is appended at the 
% end to the main list. Finally, the trailing comma is removed with 
% |\NAT@xcom|. 
%    \begin{macrocode}
%<*!209>
\ifnum\NAT@sort>0
\newcommand\NAT@sort@cites[1]{%
\@tempcntb\m@ne
\let\@celt\delimiter
\def\NAT@num@list{}%
\def\NAT@cite@list{}%
\def\NAT@nonsort@list{}%
\@for \@citeb:=#1\do{\NAT@make@cite@list}%
\edef\NAT@cite@list{\NAT@cite@list\NAT@nonsort@list}%
\edef\NAT@cite@list{\expandafter\NAT@xcom\NAT@cite@list @@}}
%    \end{macrocode}
% \begin{macro}{\NAT@make@cite@list}
% This is essentially Arseneau's coding, with some renaming and the addition 
% of |\NAT@cite@list| for the citation keys. The trick with the catcode is 
% his, and it determines if |\NAT@num| is really a number. This is a 
% non-number if the optional argument to |\bibitem| does not conform to any 
% of the allowed \thestyle\ syntaxes, such as if \texttt{alph.bst} is used.
%    \begin{macrocode}
\begingroup \catcode`\_=8
\gdef\NAT@make@cite@list{%
     \edef\@citeb{\expandafter\@firstofone\@citeb}%
    \@ifundefined{b@\@citeb\@extra@b@citeb}{\def\NAT@num{A}}%
    {\NAT@parse{\@citeb}}%
      \ifcat _\ifnum\z@<0\NAT@num _\else A\fi
       \@tempcnta\NAT@num \relax
%    \end{macrocode}
% If highest number so far, add at the end.
%    \begin{macrocode}
       \ifnum \@tempcnta>\@tempcntb 
          \edef\NAT@num@list{\NAT@num@list \@celt{\NAT@num}}%
          \edef\NAT@cite@list{\NAT@cite@list\@citeb,}%
          \@tempcntb\@tempcnta
       \else 
%    \end{macrocode}
% Else, process the numerical list to insert number and citation key.
%    \begin{macrocode}
          \let\NAT@@cite@list=\NAT@cite@list \def\NAT@cite@list{}%
          \edef\NAT@num@list{\expandafter\NAT@num@celt \NAT@num@list \@gobble @}%
          {\let\@celt=\NAT@celt\NAT@num@list}%
       \fi
    \else 
%    \end{macrocode}
% If not a number, add it to |\NAT@nonsort@list|.
%    \begin{macrocode}
       \edef\NAT@nonsort@list{\NAT@nonsort@list\@citeb,}%
 \fi}
\endgroup
%    \end{macrocode}
% \end{macro}
% This is the macro to insert a new key into the key list. All the keys so 
% far are first stored in |\NAT@@cite@list| and transferred over to 
% |\NAT@cite@list|, with the new key inserted where appropriate. The macros 
% |\NAT@nextc| and |\NAT@restc| return the next entry in the list, or the 
% rest of the list without the first entry, respectively.
%    \begin{macrocode}
\def\NAT@celt#1{\ifnum #1<\@tempcnta
  \xdef\NAT@cite@list{\NAT@cite@list\expandafter\NAT@nextc\NAT@@cite@list @@}%
  \xdef\NAT@@cite@list{\expandafter\NAT@restc\NAT@@cite@list}%
 \else
  \xdef\NAT@cite@list{\NAT@cite@list\@citeb,\NAT@@cite@list}\let\@celt\@gobble%
 \fi}
\def\NAT@num@celt#1#2{\ifx \@celt #1%
     \ifnum #2<\@tempcnta
        \@celt{#2}%
        \expandafter\expandafter\expandafter\NAT@num@celt
     \else
        \@celt{\number\@tempcnta}\@celt{#2}%
  \fi\fi}
\def\NAT@nextc#1,#2@@{#1,}
\def\NAT@restc#1,#2{#2}
\def\NAT@xcom#1,@@{#1}
\else
 \newcommand\NAT@sort@cites[1]{\edef\NAT@cite@list{#1}}\fi
%</!209>
%    \end{macrocode}
% \end{macro}
%
% \subsection{Local Configuration}
% \changes{5.2}{1994 Aug 25}{Add reading in of \texttt{natbib.cfg}}
% \changes{5.5}{1995 Mar 21}{Local configuration read in at end}
% To accommodate local additional |\bibstyle@| definitions, 
% or any other modifications to the coding, read in
% configuration file \texttt{natbib.cfg} if it exists. 
%    \begin{macrocode}
%<*!subpack&!209>
\InputIfFileExists{natbib.cfg}
       {\typeout{Local config file natbib.cfg used}}{}
%</!subpack&!209>
%</package>
%    \end{macrocode}
% 
% \Finale