summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/amsrefs/amsrefs.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/source/latex/amsrefs/amsrefs.dtx')
-rw-r--r--Master/texmf-dist/source/latex/amsrefs/amsrefs.dtx315
1 files changed, 260 insertions, 55 deletions
diff --git a/Master/texmf-dist/source/latex/amsrefs/amsrefs.dtx b/Master/texmf-dist/source/latex/amsrefs/amsrefs.dtx
index 5f7f155d810..60ad1633760 100644
--- a/Master/texmf-dist/source/latex/amsrefs/amsrefs.dtx
+++ b/Master/texmf-dist/source/latex/amsrefs/amsrefs.dtx
@@ -1,6 +1,6 @@
% \def\filename{amsrefs.dtx}
-% \def\fileversion{2.10}
-% \def\filedate{2012/05/08}
+% \def\fileversion{2.12}
+% \def\filedate{2013/01/16}
%
% \iffalse meta-comment
%
@@ -15,7 +15,7 @@
% fax: (401) 331-3842
% email: tech-support@ams.org
%
-% Copyright 2001, 2004, 2006, 2007, 2010, 2012 American Mathematical Society.
+% Copyright 2001, 2004, 2006, 2007, 2010, 2012, 2013 American Mathematical Society.
%
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3c
@@ -834,7 +834,7 @@
% Standard declaration of package name and date.
% \begin{macrocode}
\NeedsTeXFormat{LaTeX2e}[1995/12/01]
-\ProvidesPackage{amsrefs}[2012/05/08 v2.10]
+\ProvidesPackage{amsrefs}[2013/01/16 v2.12]
% \end{macrocode}
%
% \begin{macro}{\amsrefs@warning@nl}
@@ -1374,6 +1374,7 @@
% \end{macrocode}
%
% \begin{macrocode}
+\DefineSimpleKey{bib}{accessdate}
\DefineSimpleKey{bib}{address}
\DefineSimpleKey{bib}{book}
\DefineSimpleKey{bib}{booktitle}
@@ -1783,8 +1784,17 @@
+{.} {} {transition}
+{} {\SentenceSpace \PrintReviews} {review}
}
-% \end{macrocode}
-%
+
+\BibSpec{webpage}{%
+ +{} {\PrintAuthors} {author}
+ +{,} { \emph} {title}
+ +{:} { \emph} {subtitle}
+ +{} { \PrintDate} {date}
+ +{,} { \url} {url}
+ +{.} { Accessed \PrintDateField} {accessdate}
+ +{.} { } {note}
+ +{.} {} {transition}
+}
% \begin{macrocode}
\BibSpecAlias{periodical}{book}
\BibSpecAlias{collection}{book}
@@ -1835,6 +1845,11 @@
\newcounter{bib}
% \end{macrocode}
%
+% \begin{macrocode}
+\DefineSimpleKey{biblist}{prefix}
+\DefineSimpleKey{biblist}{labels}
+% \end{macrocode}
+%
% \begin{environment}{biblist}
% \begin{macrocode}
\newenvironment{biblist}{%
@@ -1865,12 +1880,48 @@
% \end{macrocode}
% \end{macro}
%
+% \begin{macro}{\amsrefs@@lbibitem}
+% \begin{macro}{\amsrefs@bibitem}
+% Reference processing at the AMS sometimes results in raw
+% \cs{bibitem} entries being interspersed with \cs{bib} entries in
+% a bibliography. For that to work, we need to modify
+% \cs{@lbibitem} and \cs{@bibitem} to interoperate more smoothly
+% with \pkg{amsrefs}.
+% \begin{macrocode}
+\def\amsrefs@lbibitem[#1]#2{%
+ \begingroup
+ \def\CurrentBib{#2}%
+ \def\thebib{#1}%
+ \@nmbrlistfalse
+ \item\leavevmode
+ \if@filesw
+ {\let\protect\noexpand
+ \immediate\write\@auxout{\string\bibcite{#2}{{#1}{}}}}%
+ \fi
+ \endgroup
+ \ignorespaces
+}
+
+\def\amsrefs@bibitem#1{%
+ \def\CurrentBib{#1}%
+ \item
+ \if@filesw
+ \immediate\write\@auxout{\string\bibcite{#1}{{\the\value{\@listctr}}{}}}%
+ \fi
+ \ignorespaces
+}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
% \begin{macro}{\@biblist}
% \begin{macrocode}
\newcommand\@biblist[1][]{%
\stepcounter{bib@env}
\biblistfont
\labelsep .5em\relax
+ \let\@bibitem\amsrefs@bibitem
+ \let\@lbibitem\amsrefs@lbibitem
\list{\BibLabel}{%
\restore@labelwidth
\@maxlabelwidth\z@
@@ -1889,6 +1940,25 @@
\widowpenalty\clubpenalty
\frenchspacing
\ResetCapSFCodes
+ \star@{\@biblistsetup}{}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@biblistsetup}
+% \begin{macrocode}
+\newcommand{\@biblistsetup}[1]{%
+ \RestrictedSetKeys{}{biblist}{\the\rsk@toks}{#1}%
+ \rkvIfEmpty{biblist}{prefix}{}{%
+ \let\amsrefs@label@prefix\biblist'prefix
+ }%
+ \rkvIfEmpty{biblist}{labels}{}{%
+ \@ifundefined{amsrefs@option@\biblist'labels}{%
+ \amsrefs@warning{Invalid label style `\biblist'labels`}%
+ }{%
+ \csname amsrefs@option@\biblist'labels\endcsname
+ }%
+ }%
}
% \end{macrocode}
% \end{macro}
@@ -2046,10 +2116,13 @@
% \macroarg{2}{bibtype}
% \begin{macrocode}
\newcommand{\BibItem}[2]{%
- \def\@tempa{#1}%
+ \vdef\@tempa{#1}%
+ \edef\@tempa{%
+ \edef\@nx\@tempa{\@nx\@xp\@nx\zap@space\@tempa\space\@nx\@empty}%
+ }%
+ \@tempa
\edef\@tempb{%
- \@nx\@bibdef\@xp\@nx\csname setbib@#2\endcsname{#2}%
- {\macrotext\@tempa}%
+ \@nx\@bibdef\@xp\@nx\csname setbib@#2\endcsname{#2}{\@tempa}%
}%
\@tempb
}
@@ -2082,7 +2155,7 @@
% \begin{macro}{\bib@exec}
% And \cs{bib@exec} is a pointer to the procedure that
% \cs{normal@bibdef} will invoke to process the key-value pairs
-% after they've been parsed. It has one
+% after they've been parsed. It has one
% of these values:
% \begin{enumerate}
%
@@ -2334,12 +2407,6 @@
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\numeric@refs}
-% \begin{macrocode}
-\def\numeric@refs{00}
-% \end{macrocode}
-% \end{macro}
-%
% \begin{macro}{\bib@print}
% \MacroArgs
% \macroarg{1}{citekey}
@@ -2881,6 +2948,54 @@
% \end{macrocode}
% \end{macro}
%
+% \begin{macro}{\alpha@label@}
+% \begin{macrocode}
+\def\alpha@label@{%
+ \ifx\@empty\bib'label
+ \def\thebib{\CurrentBib}%
+ \else
+ \let\thebib\bib'label
+ \fi
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\amsrefs@option@numeric}
+% \begin{macrocode}
+\def\amsrefs@option@numeric{%
+ \let\alpha@label\relax
+ \let\generate@label\relax
+ % \@nmbrlisttrue
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\amsrefs@option@alphabetic}
+% \begin{macrocode}
+\def\amsrefs@option@alphabetic{%
+ \let\alpha@label\alpha@label@
+ \let\generate@label\generate@alphalabel
+ \let\calc@author@part\calc@author@part@
+ \let\@suffix@format\@alph
+ \let\append@label@year\append@label@year@
+ % \@nmbrlistfalse
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\amsrefs@option@shortalphabetic}
+% \begin{macrocode}
+\def\amsrefs@option@shortalphabetic{%
+ \let\alpha@label\alpha@label@
+ \let\generate@label\generate@alphalabel
+ \let\calc@author@part\calc@author@part@short
+ \let\@suffix@format\@arabic
+ \let\append@label@year\@empty
+ % \@nmbrlistfalse
+}
+% \end{macrocode}
+% \end{macro}
+%
% \begin{macro}{\bib@cite}
% When \cs{bib@cite} is called, author name and year are available
% in \cs{bib@author} and \cs{bib@year}.
@@ -3009,6 +3124,18 @@
% \end{macrocode}
% \end{macro}
%
+% \begin{macro}{\DuplicateBibKeyWarning}
+% \begin{macrocode}
+\def\DuplicateBibLabelWarning{%
+ \amsrefs@warning{%
+ Duplicate biblabel stem `\current@stem ' detected.\MessageBreakNS
+ This usually means the order of the bibitems\MessageBreakNS
+ is incompatible with the style of labels\MessageBreakNS
+ you are using}%
+}
+% \end{macrocode}
+% \end{macro}
+%
% \begin{macro}{\bibcite@write}
% \begin{macrocode}
\def\bibcite@write#1{%
@@ -3095,7 +3222,11 @@
\begingroup
\protected@edef\@{%
\endgroup
- \protect\section*{#1}%
+ \ifx\@bibtitlestyle\undefined
+ \protect\section*{#1}%
+ \else
+ \protect\@bibtitlestyle
+ \fi
\protect\bib@div@mark{#1}%
}%
\@
@@ -5829,6 +5960,18 @@
\let\current@year\@empty
% \end{macrocode}
%
+% \begin{macro}{\amsrefs@label@prefix}
+% \begin{macrocode}
+\let\amsrefs@label@prefix\@empty
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\thebib}
+% \begin{macrocode}
+\def\thebib{\amsrefs@label@prefix\@arabic\c@bib}
+% \end{macrocode}
+% \end{macro}
+%
% \begin{macro}{\append@to@stem}
% \begin{macrocode}
\def\append@to@stem{\global\@concat\current@stem}
@@ -5849,7 +5992,7 @@
% current stem to the empty string.
% \begin{macrocode}
\global\let\previous@stem\current@stem
- \global\let\current@stem\@empty
+ \global\let\current@stem\amsrefs@label@prefix
% \end{macrocode}
% The list of primary contributors is available to us in
% \cs{current@primary} in the form
@@ -5905,9 +6048,9 @@
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\calc@author@part}
+% \begin{macro}{\calc@author@part@}
% \begin{macrocode}
-\def\calc@author@part{%
+\def\calc@author@part@{%
\ifnum \@tempcnta = 1
\@xp\@oneauthorlabel\@xp{\@tempa}%
\else
@@ -5917,6 +6060,14 @@
% \end{macrocode}
% \end{macro}
%
+% \begin{macro}{\calc@author@part@short}
+% \begin{macrocode}
+\def\calc@author@part@short{%
+ \@xp\@multiauthorlabel\@xp{\@tempa}%
+}%
+% \end{macrocode}
+% \end{macro}
+%
% \begin{macro}{\@firstone}
% This extracts the first character from a properly prepared author
% name (i.e., one in which accents are properly wrapped).
@@ -6034,9 +6185,9 @@
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\append@label@year}
+% \begin{macro}{\append@label@year@}
% \begin{macrocode}
-\def\append@label@year{%
+\def\append@label@year@{%
\safe@set\@tempcnta\bib@year
\edef\bib@citeyear{\the\@tempcnta}%
\append@to@stem{%
@@ -6072,6 +6223,15 @@
\ifx\previous@year\current@year
\@tempswatrue
\fi
+ \else
+ \begingroup
+ \let\name\@firstofone
+ \@ifundefined{amsrefs@stem@\current@stem}{%
+ \expandafter\gdef\csname amsrefs@stem@\current@stem\endcsname{}%
+ }{%
+ \DuplicateBibLabelWarning
+ }%
+ \endgroup
\fi
\if@tempswa
\global\advance\alpha@suffix\@ne
@@ -7077,7 +7237,6 @@
% \begin{macrocode}
\newcommand{\PrintDOI}[1]{%
DOI #1%
- \IfEmptyBibField{volume}{, (to appear in print)}{}%
}
% \end{macrocode}
% \end{macro}
@@ -7122,9 +7281,22 @@
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\print@date}
+% \begin{macro}{\PrintDateField}
% \begin{macrocode}
-\def\print@date{%
+\newcommand{\PrintDateField}[1]{%
+ \@ifempty{#1}{}{%
+ \begingroup
+ \bib@parsedate{#1}%
+ \print@full@date
+ \endgroup
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\print@full@date}
+% \begin{macrocode}
+\def\print@full@date{%
\ifx\bib@month\@empty
\else
\print@month@day
@@ -7134,6 +7306,12 @@
% \end{macrocode}
% \end{macro}
%
+% \begin{macro}{\print@date}
+% \begin{macrocode}
+\let\print@date\print@full@date
+% \end{macrocode}
+% \end{macro}
+%
% \begin{macro}{\print@month@day}
% \begin{macrocode}
\def\print@month@day{%
@@ -7300,16 +7478,8 @@
% \begin{macrocode}
\IfOption{alphabetic}{%
\def\bibtex@style{amsra}%
- \def\alpha@label{%
- \ifx\@empty\bib'label
- \def\thebib{\CurrentBib}%
- \else
- \let\thebib\bib'label
- \fi
- }%
- \let\generate@label\generate@alphalabel
\let\process@citelist\process@citelist@unsorted
- \def\numeric@refs{01}%
+ \amsrefs@option@alphabetic
}{}
% \end{macrocode}
%
@@ -7319,21 +7489,8 @@
% \begin{macrocode}
\IfOption{shortalphabetic}{%
\def\bibtex@style{amsrs}%
- \def\alpha@label{%
- \ifx\@empty\bib'label
- \def\thebib{\CurrentBib}%
- \else
- \let\thebib\bib'label
- \fi
- }%
- \let\@suffix@format\@arabic
- \def\calc@author@part{%
- \@xp\@multiauthorlabel\@xp{\@tempa}%
- }%
- \let\append@label@year\@empty
- \let\generate@label\generate@alphalabel
\let\process@citelist\process@citelist@unsorted
- \def\numeric@refs{01}%
+ \amsrefs@option@shortalphabetic
}{}
% \end{macrocode}
%
@@ -7552,6 +7709,26 @@
\IfOption{author-year}{}{\PopCatcodes \endinput}
% \end{macrocode}
%
+% \begin{macro}{\@biblistsetup}
+% \begin{macrocode}
+\renewcommand{\@biblistsetup}[1]{%
+ \RestrictedSetKeys{}{biblist}{\the\rsk@toks}{#1}%
+ \rkvIfEmpty{biblist}{prefix}{}{%
+ \amsrefs@warning{%
+ The `prefix' biblist option cannot be used\MessageBreak
+ with the author-year option.%
+ }%
+ }%
+ \rkvIfEmpty{biblist}{labels}{}{%
+ \amsrefs@warning{%
+ The `labels' biblist option cannot be used\MessageBreak
+ with the author-year option.%
+ }%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
% \begin{macro}{\generate@label}
% \begin{macrocode}
\def\generate@label{%
@@ -7645,12 +7822,6 @@
% \end{macrocode}
% \end{macro}
%
-% \begin{macro}{\numeric@refs}
-% \begin{macrocode}
-\def\numeric@refs{01}%
-% \end{macrocode}
-% \end{macro}
-%
% \begin{macro}{\citeleft}
% \begin{macrocode}
\def\citeleft{(}%
@@ -7709,6 +7880,18 @@
% \end{macrocode}
% \end{macro}
%
+% \begin{macro}{\citeyear}
+% \begin{macrocode}
+\DeclareRobustCommand{\citeyear}[1]{%
+ \begingroup
+ \let\citeleft\@empty
+ \let\citeright\@empty
+ \star@{\cite@a\citesel@year{#1}}{}%
+ \endgroup
+}
+% \end{macrocode}
+% \end{macro}
+%
% \begin{macro}{\ocite}
% \begin{macrocode}
\DeclareRobustCommand{\ocite}[1]{%
@@ -7995,6 +8178,17 @@
+{.} {} {transition}
+{} {\SentenceSpace \PrintReviews} {review}
}
+
+\BibSpec{webpage}{%
+ +{} {\PrintAuthors} {author}
+ +{.} { \PrintDate} {date}
+ +{.} { \emph} {title}
+ +{:} { \emph} {subtitle}
+ +{,} { \url} {url}
+ +{.} { Accessed \PrintDateField} {accessdate}
+ +{.} { } {note}
+ +{.} {} {transition}
+}
% \end{macrocode}
%
% \begin{macrocode}
@@ -8010,7 +8204,7 @@
%
% \begin{macrocode}
\NeedsTeXFormat{LaTeX2e}[1995/12/01]
-\ProvidesPackage{amsbst}[2012/05/08 v2.10]
+\ProvidesPackage{amsbst}[2013/01/16 v2.12]
%\RequirePackage{amsrefs}[2004/03/29]
% \end{macrocode}
%
@@ -8137,6 +8331,17 @@
+{.} { } {note}
+{.} {} {transition}
}
+
+\BibSpec{webpage}{%
+ +{} {\PrintAuthors} {author}
+ +{.} { } {title}
+ +{:} { } {subtitle}
+ +{.} { \PrintDateB} {date}
+ +{.} { \url} {url}
+ +{.} { Accessed \PrintDateField} {accessdate}
+ +{.} { } {note}
+ +{.} {} {transition}
+}
% \end{macrocode}
%
% \begin{macro}{\PrintEditorsA}