diff options
author | Karl Berry <karl@freefriends.org> | 2007-02-09 23:21:48 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2007-02-09 23:21:48 +0000 |
commit | d8d07e14b624ecf502b5130140ad9ad2f4d60bcb (patch) | |
tree | 477787e1df0ce7dc3c7a68e159f21b4d33e94ca1 /Master/texmf-dist/tex/latex/natbib | |
parent | 6fdecd9398457a8877476bba32077d791b67336f (diff) |
natbib 8.0 since a mac user noticed already
git-svn-id: svn://tug.org/texlive/trunk@3963 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/natbib')
-rw-r--r-- | Master/texmf-dist/tex/latex/natbib/natbib.sty | 128 |
1 files changed, 96 insertions, 32 deletions
diff --git a/Master/texmf-dist/tex/latex/natbib/natbib.sty b/Master/texmf-dist/tex/latex/natbib/natbib.sty index 29d25c4f434..ed4ac59ffb8 100644 --- a/Master/texmf-dist/tex/latex/natbib/natbib.sty +++ b/Master/texmf-dist/tex/latex/natbib/natbib.sty @@ -19,15 +19,15 @@ %% Full documentation can be obtained by LaTeXing that original file. %% Only a few abbreviated comments remain here to describe the usage. %% ============================================= -%% Copyright 1993-2006 Patrick W Daly +%% Copyright 1993-2007 Patrick W Daly %% Max-Planck-Institut f\"ur Sonnensystemforschung %% Max-Planck-Str. 2 %% D-37191 Katlenburg-Lindau %% Germany -%% E-mail: daly@linmpi.mpg.de +%% E-mail: daly@mps.mpg.de \NeedsTeXFormat{LaTeX2e}[1995/06/01] \ProvidesPackage{natbib} - [2006/09/06 7.4a (PWD)] + [2007/02/05 8.0 (PWD)] % 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 @@ -78,6 +78,7 @@ % \citeyear{key} ==>> 1990 % \citeyearpar{key} ==>> (1990) % \citetext{priv. comm.} ==>> (priv. comm.) + % \citenum{key} ==>> 11 [non-superscripted] % Note: full author lists depends on whether the bib style supports them; % if not, the abbreviated list is printed even when full requested. % @@ -92,8 +93,12 @@ % \citetalias{key} ==>> text % \citepalias{key} ==>> (text) % - % Defining the citation style of a given bib style: - % Use \bibpunct (in the preamble only) with 6 mandatory arguments: + % Defining the citation mode and punctual (citation style) + % \setcitestyle{<comma-separated list of keywords, same + % as the package options>} + % Example: \setcitestyle{square,semicolon} + % Alternatively: + % Use \bibpunct with 6 mandatory arguments: % 1. opening bracket for citation % 2. closing bracket % 3. citation separator (for multiple citations in one \cite) @@ -111,7 +116,7 @@ % Then the \bibliographystyle{newbib} will cause \bibstyle@newbib to % be called on THE NEXT LATEX RUN (via the aux file). % - % Such preprogrammed definitions may be invoked in the text (preamble only) + % 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. % @@ -124,7 +129,8 @@ % 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) + % semicolon - multiple citations separated by semi-colon (default) + % colon - same as semicolon, an earlier confusion % comma - separated by comma % authoryear - selects author-year citations (default) % numbers- selects numerical citations @@ -176,7 +182,9 @@ \newcommand\bibstyle@chicago{\bibpunct{(}{)}{;}{a}{,}{,}} \newcommand\bibstyle@named{\bibpunct{[}{]}{;}{a}{,}{,}} \newcommand\bibstyle@agu{\bibpunct{[}{]}{;}{a}{,}{,~}}%Amer. Geophys. Union -\newcommand\bibstyle@egs{\bibpunct{(}{)}{;}{a}{,}{,}}%Eur. Geophys. Soc. +\newcommand\bibstyle@copernicus{\bibpunct{(}{)}{;}{a}{,}{,}}%Copernicus Publications +\let\bibstyle@egu=\bibstyle@copernicus +\let\bibstyle@egs=\bibstyle@copernicus \newcommand\bibstyle@agsm{\bibpunct{(}{)}{,}{a}{}{,}\gdef\harvardand{\&}} \newcommand\bibstyle@kluwer{\bibpunct{(}{)}{,}{a}{}{,}\gdef\harvardand{\&}} \newcommand\bibstyle@dcu{\bibpunct{(}{)}{;}{a}{;}{,}\gdef\harvardand{and}} @@ -186,11 +194,11 @@ \newcommand\bibstyle@nlinproc{\bibpunct{(}{)}{;}{a}{,}{,}}%Nonlin.Proc.Geophys. % Define citation punctuation for some numerical styles \newcommand\bibstyle@cospar{\bibpunct{/}{/}{,}{n}{}{}% - \gdef\NAT@biblabelnum##1{##1.}} + \gdef\bibnumfmt##1{##1.}} \newcommand\bibstyle@esa{\bibpunct{(Ref.~}{)}{,}{n}{}{}% - \gdef\NAT@biblabelnum##1{##1.\hspace{1em}}} + \gdef\bibnumfmt##1{##1.\hspace{1em}}} \newcommand\bibstyle@nature{\bibpunct{}{}{,}{s}{}{\textsuperscript{,}}% - \gdef\NAT@biblabelnum##1{##1.}} + \gdef\bibnumfmt##1{##1.}} % The standard LaTeX styles \newcommand\bibstyle@plain{\bibpunct{[}{]}{,}{n}{}{,}} \let\bibstyle@alpha=\bibstyle@plain @@ -208,7 +216,7 @@ \renewcommand\NAT@open{}\renewcommand\NAT@close{} \ExecuteOptions{nobibstyle}} \DeclareOption{authoryear}{\NAT@numbersfalse - \ExecuteOptions{round,colon,bibstyle}} + \ExecuteOptions{round,semicolon,bibstyle}} \DeclareOption{round}{% \renewcommand\NAT@open{(} \renewcommand\NAT@close{)} \ExecuteOptions{nobibstyle}} @@ -223,8 +231,9 @@ \ExecuteOptions{nobibstyle}} \DeclareOption{comma}{\renewcommand\NAT@sep{,} \ExecuteOptions{nobibstyle}} -\DeclareOption{colon}{\renewcommand\NAT@sep{;} +\DeclareOption{semicolon}{\renewcommand\NAT@sep{;} \ExecuteOptions{nobibstyle}} +\DeclareOption{colon}{\ExecuteOptions{semicolon}} \DeclareOption{nobibstyle}{\let\bibstyle=\@gobble} \DeclareOption{bibstyle}{\let\bibstyle=\@citestyle} \newif\ifNAT@openbib \NAT@openbibfalse @@ -250,18 +259,62 @@ \AtBeginDocument{\global\let\bibstyle=\@gobble} \let\@citestyle\bibstyle \newcommand\citestyle[1]{\@citestyle{#1}\let\bibstyle\@gobble} -\@onlypreamble{\citestyle}\@onlypreamble{\@citestyle} \newcommand\bibpunct[7][, ]% {\gdef\NAT@open{#2}\gdef\NAT@close{#3}\gdef - \NAT@sep{#4}\global\NAT@numbersfalse\ifx #5n\global\NAT@numberstrue + \NAT@sep{#4}\global\NAT@numbersfalse + \ifx #5n\global\NAT@numberstrue\global\NAT@superfalse \else - \ifx #5s\global\NAT@numberstrue\global\NAT@supertrue + \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 + \NAT@@setcites } -\@onlypreamble{\bibpunct} +\newcommand\setcitestyle[1]{ + \@for\@tempa:=#1\do + {\def\@tempb{round}\ifx\@tempa\@tempb + \renewcommand\NAT@open{(}\renewcommand\NAT@close{)}\fi + \def\@tempb{square}\ifx\@tempa\@tempb + \renewcommand\NAT@open{[}\renewcommand\NAT@close{]}\fi + \def\@tempb{angle}\ifx\@tempa\@tempb + \renewcommand\NAT@open{$<$}\renewcommand\NAT@close{$>$}\fi + \def\@tempb{curly}\ifx\@tempa\@tempb + \renewcommand\NAT@open{\{}\renewcommand\NAT@close{\}}\fi + \def\@tempb{semicolon}\ifx\@tempa\@tempb + \renewcommand\NAT@sep{;}\fi + \def\@tempb{colon}\ifx\@tempa\@tempb + \renewcommand\NAT@sep{;}\fi + \def\@tempb{comma}\ifx\@tempa\@tempb + \renewcommand\NAT@sep{,}\fi + \def\@tempb{authoryear}\ifx\@tempa\@tempb + \NAT@numbersfalse\fi + \def\@tempb{numbers}\ifx\@tempa\@tempb + \NAT@numberstrue\NAT@superfalse\fi + \def\@tempb{super}\ifx\@tempa\@tempb + \NAT@numberstrue\NAT@supertrue\fi + \expandafter\NAT@find@eq\@tempa=\relax\@nil + \if\@tempc\relax\else + \expandafter\NAT@rem@eq\@tempc + \def\@tempb{open}\ifx\@tempa\@tempb + \xdef\NAT@open{\@tempc}\fi + \def\@tempb{close}\ifx\@tempa\@tempb + \xdef\NAT@close{\@tempc}\fi + \def\@tempb{aysep}\ifx\@tempa\@tempb + \xdef\NAT@aysep{\@tempc}\fi + \def\@tempb{yysep}\ifx\@tempa\@tempb + \xdef\NAT@yrsep{\@tempc}\fi + \def\@tempb{notesep}\ifx\@tempa\@tempb + \xdef\NAT@cmt{\@tempc}\fi + \def\@tempb{citesep}\ifx\@tempa\@tempb + \xdef\NAT@sep{\@tempc}\fi + \fi + }% + \NAT@@setcites +} + \def\NAT@find@eq#1=#2\@nil{\def\@tempa{#1}\def\@tempc{#2}} + \def\NAT@rem@eq#1={\def\@tempc{#1}} + \def\NAT@@setcites{\global\let\bibstyle\@gobble} +\AtBeginDocument{\let\NAT@@setcites\NAT@set@cites} \newcommand\NAT@open{(} \newcommand\NAT@close{)} \newcommand\NAT@sep{;} \ProcessOptions @@ -274,16 +327,19 @@ [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 +\if*#2*\else#2\ \fi \unskip\kern\p@\textsuperscript{\NAT@@open#1\NAT@@close}% - \if*#3*\else\ (#3)\fi\else #1\fi\endgroup} -\providecommand - \textsuperscript[1]{\mbox{$^{\mbox{\scriptsize#1}}$}} + \if*#3*\else\ #3\fi\else #1\fi\endgroup} +\providecommand\textsuperscript[1]{\mbox{$^{\mbox{\scriptsize#1}}$}} \providecommand\@firstofone[1]{#1} \newcommand\NAT@citexnum{} \def\NAT@citexnum[#1][#2]#3{% \NAT@sort@cites{#3}% \let\@citea\@empty \@cite{\def\NAT@num{-1}\let\NAT@last@yr\relax\let\NAT@nm\@empty + \ifNAT@swa\else + \ifnum\NAT@ctype=0\if*#1*\else + #1\ \fi\fi\fi \@for\@citeb:=\NAT@cite@list\do {\edef\@citeb{\expandafter\@firstofone\@citeb}% \if@filesw\immediate\write\@auxout{\string\citation{\@citeb}}% @@ -338,11 +394,11 @@ \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{% + \@citea \NAT@test{1}\ \NAT@mbox{\NAT@@open}% + \fi \NAT@mbox{% \hyper@natlinkstart{\@citeb\@extra@b@citeb}% {\citenumfont{\NAT@num}}\hyper@natlinkend}% - \def\@citea{\NAT@@close\NAT@sep\penalty\@m\ }% + \def\@citea{\NAT@mbox{\NAT@@close\NAT@sep\penalty\@m\ }}% \or\@citea \hyper@natlinkstart{\@citeb\@extra@b@citeb}% \NAT@test{\NAT@ctype}\hyper@natlinkend @@ -359,8 +415,10 @@ \fi }}% \ifnum\NAT@cmprs>0\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}} + \ifNAT@swa\else\NAT@mbox{\NAT@@close}% + \ifnum\NAT@ctype=0\if*#2*\else + \NAT@cmt#2\fi + \fi\fi}{#1}{#2}} \newcommand\NAT@test[1]{\ifnum#1=1 \ifx\NAT@nmfmt{\NAT@nm}\NAT@noname {\reset@font\bfseries(author?)}\PackageWarning{natbib} {Author undefined for citation`\@citeb' @@ -479,9 +537,9 @@ \global\@namedef{bv@\@citeb\@extra@b@citeb}{}}\@esphack} \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 +\let\bibnumfmt\@empty +\providecommand\@biblabel[1]{[#1]} +\AtBeginDocument{\ifx\bibnumfmt\@empty\let\bibnumfmt\@biblabel\fi} \newcommand\NAT@bibsetnum[1]{\settowidth\labelwidth{\@biblabel{#1}}% \setlength{\leftmargin}{\labelwidth}\addtolength{\leftmargin}{\labelsep}% \setlength{\itemsep}{\bibsep}\setlength{\parsep}{\z@}% @@ -495,7 +553,7 @@ \newlength{\bibhang} \setlength{\bibhang}{1em} \newlength{\bibsep} -{\@listi \global\bibsep\itemsep \global\advance\bibsep by\parsep} + {\@listi \global\bibsep\itemsep \global\advance\bibsep by\parsep} \newcommand\NAT@bibsetup% [1]{\setlength{\leftmargin}{\bibhang}\setlength{\itemindent}{-\leftmargin}% @@ -508,14 +566,17 @@ \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\@biblabel\NAT@biblabelnum \let\@bibsetup\NAT@bibsetnum + \renewcommand\NAT@idxtxt{\NAT@name\ \NAT@open\NAT@num\NAT@close}% \def\natexlab##1{}% \else \let\@cite\NAT@cite \let\@citex\NAT@citex \let\@biblabel\NAT@biblabel \let\@bibsetup\NAT@bibsetup + \let\NAT@space\relax + \renewcommand\NAT@idxtxt{\NAT@name\ \NAT@open\NAT@date\NAT@close}% \def\natexlab##1{##1}% \fi} \AtBeginDocument{\NAT@set@cites} @@ -552,6 +613,9 @@ \DeclareRobustCommand\citealp {\begingroup\NAT@swatrue\def\NAT@ctype{0}\NAT@parfalse \@ifstar{\NAT@fulltrue\NAT@citetp}{\NAT@fullfalse\NAT@citetp}} +\DeclareRobustCommand\citenum + {\begingroup\NAT@swatrue\def\NAT@ctype{0}\NAT@parfalse\let\textsuperscript\ + \NAT@citexnum[][]} \DeclareRobustCommand\citeauthor {\begingroup\NAT@swafalse\def\NAT@ctype{1}\NAT@parfalse \@ifstar{\NAT@fulltrue\NAT@citetp}{\NAT@fullfalse\NAT@citetp}} @@ -743,7 +807,7 @@ \PackageWarning{natbib} {Empty `thebibliography' environment}}% \endlist\vskip-\lastskip} -\let\bibfont\relax + \let\bibfont\relax \let\bibpreamble\relax \providecommand\reset@font{\relax} \providecommand\bibname{Bibliography} |