From 2e59afec9907d090fa6cb3d54066333df8826741 Mon Sep 17 00:00:00 2001
From: "Dr. Clea F. Rees" <cfrees@imapmail.org>
Date: Wed, 10 Dec 2008 20:50:19 +0000
Subject: multibib update 2008/12/10

git-svn-id: svn://tug.org/texlive/trunk@11585 c570f23f-e606-0410-a88d-b1316a301751
---
 Master/texmf-dist/tex/latex/multibib/multibib.sty | 140 +++++++++++++++++-----
 1 file changed, 107 insertions(+), 33 deletions(-)

(limited to 'Master/texmf-dist/tex/latex/multibib/multibib.sty')

diff --git a/Master/texmf-dist/tex/latex/multibib/multibib.sty b/Master/texmf-dist/tex/latex/multibib/multibib.sty
index d77c922be29..fa7866ceeca 100644
--- a/Master/texmf-dist/tex/latex/multibib/multibib.sty
+++ b/Master/texmf-dist/tex/latex/multibib/multibib.sty
@@ -8,28 +8,39 @@
 %% 
 %% IMPORTANT NOTICE:
 %% 
-%% For the copyright see the source file.
+%% This work may be distributed and/or modified under the conditions of
+%% the LaTeX Project Public License, either version 1.3 of this license
+%% or any later version. The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt and version 1.3 or later is
+%% part of all distributions of LaTeX version 2003/12/01 or
+%% later.
 %% 
-%% Any modified versions of this file must be renamed
-%% with new filenames distinct from multibib.sty.
+%% This work has the LPPL maintenance status "maintained". The Current
+%% Maintainer of this work is Thorsten Hansen.
+%% 
+%% Any modified versions of this file must be renamed with new filenames
+%% distinct from multibib.sty.
+%% 
+%% This is a generated file. It may not be distributed without the
+%% original source file multibib.dtx.
+%% 
+%% To produce the documentation run multibib.dtx through LaTeX.
 %% 
-%% For distribution of the original source see the terms
-%% for copying and modification in the file multibib.dtx.
 %% 
-%% This generated file may be distributed as long as the
-%% original source files, as listed above, are part of the
-%% same distribution. (The sources need not necessarily be
-%% in the same archive or directory.)
 %% Package `multibib' to use with LaTeX2e.
-%% Copyright (C) 2003 by Thorsten Hansen. All rights reserved.
+%%
+%% Copyright (C) 2008 by Thorsten Hansen
 %%
 \NeedsTeXFormat{LaTeX2e}
 \ProvidesPackage{multibib}
-          [2004/01/28 v1.3 Multiple bibliographies for one document.]
+          [2008/12/10 v1.4 Multiple bibliographies for one document.]
 
 \newif\ifcontinuouslabels
 \continuouslabelstrue
 \DeclareOption{resetlabels}{\continuouslabelsfalse}
+\newif\iflabeled
+\labeledfalse
+\DeclareOption{labeled}{\labeledtrue}
 \ProcessOptions
 \def\mylop#1\to#2{\expandafter\mylopoff#1\mylopoff#1#2}
 \long\def\mylopoff#1,#2\mylopoff#3#4{\def#4{#1}\def#3{#2}}
@@ -73,30 +84,75 @@
        \addcontentsline{toc}{chapter}{\bibname}%
        \@ldthebibliography{#1}}}%
     {}%
-  \let\std@thebibliography\thebibliography
-  \def\thebibliography#1{%
-    \@isnumber{#1}%
-      {\ifnum\mb@biblabelwidth=0
-         \@tempcnta\c@enumiv
-         \ifcontinuouslabels
-           \advance\@tempcnta#1%
-         \fi
-         \std@thebibliography{\@arabic\@tempcnta}%
-      \else
-        \std@thebibliography{\@arabic\mb@biblabelwidth}%
+  \@ifpackageloaded{natbib}%
+    {%
+
+\renewenvironment{thebibliography}[1]{%
+ \bibsection\parindent \z@\bibpreamble\bibfont\list
+   {\@biblabel{\arabic{NAT@ctr}}}{\@bibsetup{#1}%
+    \usecounter{NAT@ctr}}% %% only changed here to usecounter
+    \ifNAT@openbib
+      \renewcommand\newblock{\par}
+    \else
+      \renewcommand\newblock{\hskip .11em \@plus.33em \@minus.07em}%
+    \fi
+    \sloppy\clubpenalty4000\widowpenalty4000
+    \sfcode`\.=1000\relax
+    \let\citeN\cite \let\shortcite\cite
+    \let\citeasnoun\cite
+ }{\def\@noitemerr{%
+  \PackageWarning{natbib}
+     {Empty `thebibliography' environment}}%
+  \endlist\vskip-\lastskip}
+
+      \let\std@thebibliography\thebibliography
+      \def\thebibliography#1{%
+        \@isnumber{#1}%
+        {\ifnum\mb@biblabelwidth=0
+          \@tempcnta\c@NAT@ctr %% changed here to c@NAT@ctr
+          \ifcontinuouslabels
+          \advance\@tempcnta#1%
+          \fi
+          \std@thebibliography{\@arabic\@tempcnta}%
+          \else
+          \std@thebibliography{\@arabic\mb@biblabelwidth}%
         \global\mb@biblabelwidth 0
-      \fi}%
-      {\std@thebibliography{#1}}%
-  }%
+        \fi}%
+        {\std@thebibliography{#1}}%
+     }%
+   }%
+   {% else, natbib not loaded
+     \let\std@thebibliography\thebibliography
+
+     \def\thebibliography#1{%
+        \@isnumber{#1}%
+          {\ifnum\mb@biblabelwidth=0
+            \@tempcnta\c@enumiv
+            \ifcontinuouslabels
+            \advance\@tempcnta#1%
+            \fi
+            \std@thebibliography{\@arabic\@tempcnta}%
+            \else
+            \std@thebibliography{\@arabic\mb@biblabelwidth}%
+          \global\mb@biblabelwidth 0
+          \fi}%
+        {\std@thebibliography{#1}}%
+    }%
+   }%
 }
 \newcommand{\@isnumber}[3]{%
-  \def\argi{#1}%
-  \ifx\argi\empty
+  \def\argdef{#1}%
+  \edef\argedef{#1}%
+  \ifx\argedef\empty
     #3
   \else
-    \global\@tempswafalse
-    \setbox\@tempboxa=\hbox{\@scannumber#1\plugh}%
-    \if@tempswa#2\else#3\fi
+    \ifx\argdef\argedef
+      \global\@tempswafalse
+      \setbox\@tempboxa=\hbox{\@scannumber#1\plugh}%
+      \if@tempswa#2\else#3\fi
+    \else
+      #3
+    \fi
   \fi}
 \let\plugh\relax
 \newcommand{\@scannumber}[1]{%
@@ -147,6 +203,16 @@
     \expandafter\edef\csname nocite\@suffix\endcsname##1{{%
       \let\noexpand\@auxout\csname @auxout\@suffix\endcsname
       \noexpand\nocite{##1}}}%
+    \iflabeled % if option labeled
+      \expandafter\edef\csname @bibitem\@suffix\endcsname##1{%
+        \noexpand\item
+        \noexpand\if@filesw \noexpand\immediate\noexpand\write\noexpand\@auxout
+        {\noexpand\string\noexpand\bibcite{##1}%
+           {\@suffix\noexpand\the\noexpand\value{\noexpand\@listctr}}}%
+        \noexpand\fi
+        \noexpand\ignorespaces}%
+      \expandafter\edef\csname @biblabel\@suffix\endcsname##1{[\@suffix##1]}%
+    \fi % end if option labeled
     \expandafter\edef\csname bibliography\@suffix\endcsname##1{{%
       \let\noexpand\temp@auxout\noexpand\@auxout
       \let\noexpand\addtocontents\noexpand\mb@addtocontents
@@ -157,11 +223,19 @@
           \expandafter\noexpand\csname refname\@suffix\endcsname
       \let\noexpand\bibname
           \expandafter\noexpand\csname refname\@suffix\endcsname
+      \iflabeled
+        \let\noexpand\@bibitem
+            \expandafter\noexpand\csname @bibitem\@suffix\endcsname
+        \let\noexpand\@biblabel
+            \expandafter\noexpand\csname @biblabel\@suffix\endcsname
+      \fi
       \noexpand\bibliography{##1}%
       }}
-    \expandafter\edef\csname bibliographystyle\@suffix\endcsname##1{{%
-      \let\noexpand\@auxout\csname @auxout\@suffix\endcsname
-      \noexpand\bibliographystyle{##1}}}%
+    \expandafter\edef\csname bibliographystyle\@suffix\endcsname##1{%
+      \noexpand\if@filesw
+        \noexpand\immediate\noexpand\write\csname @auxout\@suffix\endcsname
+          {\noexpand\string\noexpand\bibstyle{##1}}%
+      \noexpand\fi}
    }%
 }
 \@onlypreamble\newcites
-- 
cgit v1.2.3

