From c89084e6f1fa14cb197420a7738d1de99d3ebd91 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Wed, 31 Oct 2007 18:09:17 +0000 Subject: natbib 81 (30oct07) git-svn-id: svn://tug.org/texlive/trunk@5316 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/source/latex/natbib/bibentry.drv | 8 ++--- Master/texmf-dist/source/latex/natbib/bibentry.dtx | 33 +++++++++++++++---- Master/texmf-dist/source/latex/natbib/natbib.drv | 2 +- Master/texmf-dist/source/latex/natbib/natbib.dtx | 38 ++++++++++++---------- 4 files changed, 52 insertions(+), 29 deletions(-) (limited to 'Master/texmf-dist/source/latex/natbib') diff --git a/Master/texmf-dist/source/latex/natbib/bibentry.drv b/Master/texmf-dist/source/latex/natbib/bibentry.drv index 1130aaa686e..c570e1161ba 100644 --- a/Master/texmf-dist/source/latex/natbib/bibentry.drv +++ b/Master/texmf-dist/source/latex/natbib/bibentry.drv @@ -11,15 +11,15 @@ %% %% Make changes to it as needed. (Never change the file bibentry.dtx!) %% ============================================ -%% Copyright 1997-1999 Patrick W Daly -%% Max-Planck-Institut f\"ur Aeronomie +%% Copyright 1997-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} \ProvidesFile{bibentry.drv} - [2000/06/20 1.4 (PWD)] + [2007/10/30 1.5 (PWD)] \documentclass{ltxdoc} %\documentclass[twoside]{ltxdoc} %\documentclass[a4paper]{ltxdoc} diff --git a/Master/texmf-dist/source/latex/natbib/bibentry.dtx b/Master/texmf-dist/source/latex/natbib/bibentry.dtx index fc477968a4c..cbf396d4b68 100644 --- a/Master/texmf-dist/source/latex/natbib/bibentry.dtx +++ b/Master/texmf-dist/source/latex/natbib/bibentry.dtx @@ -5,12 +5,12 @@ {BIBENTRY.DTX} %======================================================================== % -%% Copyright 1997-1999 Patrick W Daly -%% Max-Planck-Institut f\"ur Aeronomie +%% Copyright 1997-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 % % This program can be redistributed and/or modified under the terms % of the LaTeX Project Public License Distributed from CTAN @@ -42,15 +42,16 @@ % *** The DATE, VERSION, and other INFO %\fi %\ProvidesFile{bibentry} - [2000/06/20 1.4 (PWD)] + [2007/10/30 1.5 (PWD)] % \changes{1.0}{1997 Jun 13}{Initial version} % \changes{1.1}{1997 Nov 11}{Refine for use with \cs{bibliography}} % \changes{1.1a}{1998 Mar 2}{Fix bug by using \cs{ifx} instead of \cs{if}} % \changes{1.2}{1999 Feb 23}{Update copyright notice} % \changes{1.3}{1999 Aug 26}{Works with \texttt{url} package} % \changes{1.4}{2000 Jun 20}{Add \texttt{hyperref} compatibility} +% \changes{1.5}{2007 Oct 30}{Add \cs{doi} definition} % -% \CheckSum{126} +% \CheckSum{135} % \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 @@ -272,8 +273,8 @@ End of documentation driver file. % This package must be used with \btx, not with a hand-written % \texttt{thebibliography} environment. % -% Strictly speaking, there must be a \texttt{.bbl} file; whether this is -% generated by \btx\ or by hand is unimportant. +% More precisely, there must be a \texttt{.bbl} file external to the \LaTeX\ +% file; whether this is written by hand or by \btx\ is unimportant. % % \DescribeMacro{\nobibliography} % The bibliography entries are stored with the command @@ -311,6 +312,11 @@ End of documentation driver file. % \item \LaTeX\ the file twice. % \end{enumerate} % +% \noindent +% \textbf{Note:} it is highly recommended to make use of the \texttt{url} +% package, which will nicely format both url and doi addresses; in particular, +% they will break at convenient locations without a hyphen. +% % \section{Caveats} % % The entries in the \texttt{.bbl} must be of the form @@ -528,6 +534,19 @@ End of documentation driver file. {You have used \string\nobibliography* \MessageBreak without a following \string\bibliography.\MessageBreak You may not be able to run BibTeX}\fi} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\doi} +% \changes{1.5}{2007 Oct 30}{Add macro} +% The |\doi| command is used in the modern \texttt{.bst} files, and is in fact +% defined inside the |thebibliography| environment for these styles. However, +% that means, it is undefined outside where |\bibentry| is used. So it is +% necessary to provide a definition globally. +% \begin{macrocode} +\AtBeginDocument{\@ifpackageloaded{url} + {\providecommand{\doi}{doi: \begingroup \urlstyle{rm}\Url}} + {\providecommand{\doi}[1]{doi: #1}}} % % \end{macrocode} % \end{macro} diff --git a/Master/texmf-dist/source/latex/natbib/natbib.drv b/Master/texmf-dist/source/latex/natbib/natbib.drv index 4335ba4af70..62be6e3fb69 100644 --- a/Master/texmf-dist/source/latex/natbib/natbib.drv +++ b/Master/texmf-dist/source/latex/natbib/natbib.drv @@ -19,7 +19,7 @@ %% E-mail: daly@mps.mpg.de \NeedsTeXFormat{LaTeX2e} \ProvidesFile{natbib.drv} - [2007/02/05 8.0 (PWD)] + [2007/10/30 8.1 (PWD)] \documentclass{ltxdoc} %\documentclass[twoside]{ltxdoc} %\documentclass[a4paper]{ltxdoc} diff --git a/Master/texmf-dist/source/latex/natbib/natbib.dtx b/Master/texmf-dist/source/latex/natbib/natbib.dtx index c4112cc378b..794bb080155 100644 --- a/Master/texmf-dist/source/latex/natbib/natbib.dtx +++ b/Master/texmf-dist/source/latex/natbib/natbib.dtx @@ -55,7 +55,7 @@ % *** The DATE, VERSION, and other INFO %\fi %\ProvidesFile{natbib} - [2007/02/05 8.0 (PWD)] + [2007/10/30 8.1 (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 @@ -173,8 +173,9 @@ % \changes{8.0}{2007 Feb 2}{Allow changes in cite style, for chapterbib; remove \texttt{nopreonly} option} % \changes{8.0}{2007 Feb 5}{Remove 2.09 support} % \changes{8.0}{2007 Feb 5}{Remove subpackage option (and agu, egs options)} +% \changes{8.1}{2007 Oct 30}{Replace some \cs{edef}s with \cs{protected@edef}} % -% \CheckSum{2376} +% \CheckSum{2381} % \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 @@ -400,7 +401,7 @@ End of documentation driver file. % \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,\kern} +% \DoNotIndex{\ifcat,\m@ne,\number,\kern,\protected@edef} % \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} @@ -2581,6 +2582,7 @@ is read in after the main package file. % % The command |\@cprwrite| is defined in the \texttt{citeref} package. % \changes{7.2}{2006 Jan 12}{Add \texttt{citeref} support} +% \changes{8.1}{2007 Oct 30}{Add \cs{@empty} after \cs{@citeb}, as now in standard \LaTeX} % \begin{macrocode} \providecommand\@firstofone[1]{#1} \newcommand\NAT@citexnum{} @@ -2592,7 +2594,7 @@ is read in after the main package file. \ifnum\NAT@ctype=0\if*#1*\else #1\ \fi\fi\fi \@for\@citeb:=\NAT@cite@list\do - {\edef\@citeb{\expandafter\@firstofone\@citeb}% + {\edef\@citeb{\expandafter\@firstofone\@citeb\@empty}% \if@filesw\immediate\write\@auxout{\string\citation{\@citeb}}% \@ifundefined{@cprwrite}{}{\expandafter\@cprwrite\@citeb=}\fi \@ifundefined{b@\@citeb\@extra@b@citeb}{% @@ -2627,6 +2629,7 @@ is read in after the main package file. % can be used independently} % \changes{7.2}{2006 Jan 12}{Add hyperlinks to compressed cites} % \changes{7.4a}{2006 Sep 06}{Add \cs{noexpand} to \cs{hyper@natlinkend}} +% \changes{8.1}{2007 Oct 30}{Change \cs{edef} to \cs{protected@edef}} % \begin{macrocode} \ifNAT@swa \ifnum\NAT@ctype>1\relax\@citea @@ -2644,11 +2647,11 @@ is read in after the main package file. \endgroup \ifnum\NAT@nm=\@tempcnta \ifx\NAT@last@yr\relax - \edef\NAT@last@yr{\@citea \mbox{% + \protected@edef\NAT@last@yr{\@citea \mbox{% \noexpand\hyper@natlinkstart{\@citeb\@extra@b@citeb}{% \noexpand\citenumfont{\NAT@num}}\noexpand\hyper@natlinkend}}% \else - \edef\NAT@last@yr{--\penalty\@m\mbox{% + \protected@edef\NAT@last@yr{--\penalty\@m\mbox{% \noexpand\hyper@natlinkstart{\@citeb\@extra@b@citeb}{% \noexpand\citenumfont{\NAT@num}}\noexpand\hyper@natlinkend}}% \fi @@ -2768,6 +2771,7 @@ is read in after the main package file. % % The command |\@cprwrite| is defined in the \texttt{citeref} package. % \changes{7.2}{2006 Jan 12}{Add \texttt{citeref} support} +% \changes{8.1}{2007 Oct 30}{Add \cs{@empty} after \cs{@citeb}, as now in standard \LaTeX} % \begin{macrocode} \newcommand\NAT@citex{} \def\NAT@citex% @@ -2776,7 +2780,7 @@ is read in after the main package file. \let\@citea\@empty \@cite{\let\NAT@nm\@empty\let\NAT@year\@empty \@for\@citeb:=\NAT@cite@list\do - {\edef\@citeb{\expandafter\@firstofone\@citeb}% + {\edef\@citeb{\expandafter\@firstofone\@citeb\@empty}% \if@filesw\immediate\write\@auxout{\string\citation{\@citeb}}% \@ifundefined{@cprwrite}{}{\expandafter\@cprwrite\@citeb=}\fi \@ifundefined{b@\@citeb\@extra@b@citeb}{\@citea% @@ -2965,7 +2969,7 @@ is read in after the main package file. % \begin{macrocode} \newcommand\shortcites[1]{% \@bsphack\@for\@citeb:=#1\do - {\edef\@citeb{\expandafter\@firstofone\@citeb}% + {\edef\@citeb{\expandafter\@firstofone\@citeb\@empty}% \global\@namedef{bv@\@citeb\@extra@b@citeb}{}}\@esphack} % \end{macrocode} % \end{macro} @@ -3474,7 +3478,7 @@ is read in after the main package file. % \begin{macrocode} \renewcommand\nocite[1]{\@bsphack \@for\@citeb:=#1\do{% - \edef\@citeb{\expandafter\@firstofone\@citeb}% + \edef\@citeb{\expandafter\@firstofone\@citeb\@empty}% \if@filesw\immediate\write\@auxout{\string\citation{\@citeb}}\fi \if*\@citeb\else \@ifundefined{b@\@citeb\@extra@b@citeb}{% @@ -4365,8 +4369,8 @@ is read in after the main package file. \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 @@}} +\protected@edef\NAT@cite@list{\NAT@cite@list\NAT@nonsort@list}% +\protected@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 @@ -4377,7 +4381,7 @@ is read in after the main package file. % \begin{macrocode} \begingroup \catcode`\_=8 \gdef\NAT@make@cite@list{% - \edef\@citeb{\expandafter\@firstofone\@citeb}% + \edef\@citeb{\expandafter\@firstofone\@citeb\@empty}% \@ifundefined{b@\@citeb\@extra@b@citeb}{\def\NAT@num{A}}% {\NAT@parse{\@citeb}}% \ifcat _\ifnum\z@<0\NAT@num _\else A\fi @@ -4386,22 +4390,22 @@ is read in after the main package file. % 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,}% + \protected@edef\NAT@num@list{\NAT@num@list \@celt{\NAT@num}}% + \protected@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 @}% + \protected@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,}% + \protected@edef\NAT@nonsort@list{\NAT@nonsort@list\@citeb,}% \fi} \endgroup % \end{macrocode} @@ -4429,7 +4433,7 @@ is read in after the main package file. \def\NAT@restc#1,#2{#2} \def\NAT@xcom#1,@@{#1} \else - \newcommand\NAT@sort@cites[1]{\edef\NAT@cite@list{#1}}\fi + \newcommand\NAT@sort@cites[1]{\protected@edef\NAT@cite@list{#1}}\fi % \end{macrocode} % \end{macro} % -- cgit v1.2.3