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.dtx185
1 files changed, 145 insertions, 40 deletions
diff --git a/Master/texmf-dist/source/latex/amsrefs/amsrefs.dtx b/Master/texmf-dist/source/latex/amsrefs/amsrefs.dtx
index 8882bafc2ee..56d623f7015 100644
--- a/Master/texmf-dist/source/latex/amsrefs/amsrefs.dtx
+++ b/Master/texmf-dist/source/latex/amsrefs/amsrefs.dtx
@@ -1,9 +1,9 @@
%%% ====================================================================
%%% @LaTeX-doc-source-file{
%%% filename = "amsrefs.dtx",
-%%% version = "2.02",
-%%% date = "2006/10/25",
-%%% time = "11:13:05 EDT",
+%%% version = "2.03",
+%%% date = "2007/10/22",
+%%% time = "10:22:13 EDT",
%%% author = "Michael J Downes and David M. Jones",
%%% address = "American Mathematical Society,
%%% Publications Technical Group,
@@ -17,13 +17,13 @@
%%% instead of being determined chiefly by the BibTeX
%%% style file.",
%%% copyright = "Copyright 2001, 2004, 2006, 2007 American
-%%% Mathematical Society.",
+%%% Mathematical Society.",
%%% license = "Unlimited copying and redistribution of this file
%%% are permitted as long as this file is not
%%% modified. Modifications, and distribution of
%%% modified versions, are permitted, but only if
%%% the resulting file is renamed.",
-%%% checksum = "24451 8100 25457 244022",
+%%% checksum = "57935 8186 25806 247374",
%%% docstring = "The checksum field, produced by Robert Solovay's
%%% checksum utility, gives CRC-16 checksum, lines,
%%% words, and characters.",
@@ -861,7 +861,7 @@
% Standard declaration of package name and date.
% \begin{macrocode}
\NeedsTeXFormat{LaTeX2e}[1995/12/01]
-\ProvidesPackage{amsrefs}[2006/10/25 v2.02]
+\ProvidesPackage{amsrefs}[2007/10/22 v2.03]
% \end{macrocode}
%
% \begin{macro}{\amsrefs@warning@nl}
@@ -1284,6 +1284,10 @@
% \end{macrocode}
%
% \begin{macrocode}
+\DeclareBooleanOption{msc-links}
+% \end{macrocode}
+%
+% \begin{macrocode}
\ExecuteOptions{numeric,traditional-quotes,sorted-cites,compressed-cites}
\ProcessOptions\relax
@@ -1293,19 +1297,27 @@
%
% \begin{macrocode}
\IfOption{backrefs}{%
- \IfFileExists{hyperref.sty}{%
- \RequirePackage{hyperref}[1999/07/08]
- }{}%
\IfFileExists{backref.sty}{%
\RequirePackage{backref}[1999/05/30]
- }{}%
+ }{%
+ \amsrefs@warning@nl{The backrefs option cannot be used^^J%
+ unless the backref package is also installed.^^J%
+ (backref is part of the hyperref package)}%
+ }%
+}{}
+
+\IfOption{msc-links}{%
+ \IfFileExists{hyperref.sty}{%
+ \RequirePackage{hyperref}[1999/07/08]
+ }{
+ \amsrefs@warning@nl{The msc-links option cannot be used^^J%
+ unless the hyperref package is installed}%
+ }%
}{}
% \end{macrocode}
%
% \subsubsection{The \opt{?} option}
%
-% Note that in the following auxiliary package list, \pkg{getwidth}
-% is not (yet) included.
% \begin{macrocode}
\IfOption{?}{%
\typeout{^^J%
@@ -2662,6 +2674,10 @@
% \end{macro}
%
% \begin{macro}{\bib@field@patches}
+% Depending on your point of view, this macro either puts the
+% bibitem into a canonical form or, alternatively, it fudges the
+% data to fit our model. Either way, it simplifies formatting the
+% bibliography.
% \begin{macrocode}
\def\bib@field@patches{%
\ifx\bib'author\@empty
@@ -2707,6 +2723,18 @@
\let\bib'date\@empty
\fi
% \end{macrocode}
+% Some journals have ``numbers'' but no ``volumes''. AMS house
+% style is to treat the number as volume.
+% \begin{macrocode}
+ \ifx\setbib@@\setbib@article
+ \ifx\bib'volume\@empty
+ \ifx\bib'number\@empty\else
+ \let\bib'volume\bib'number
+ \let\bib'number\@empty
+ \fi
+ \fi
+ \fi
+% \end{macrocode}
% \cs{bib'language} is used for producing the printed rendition of
% the language. \cs{bib@language} needs to be in the form required by
% \cn{selectlanguage}.
@@ -3001,8 +3029,10 @@
% \begin{macrocode}
\def\bibcite@write#1{%
\if@filesw
- \let\citesel\citesel@write
- \csname b@#1\endcsname
+ \begingroup
+ \let\citesel\citesel@write
+ \csname b@#1\endcsname
+ \endgroup
\fi
}
% \end{macrocode}
@@ -3011,10 +3041,8 @@
% \begin{macro}{\citesel@write}
% \begin{macrocode}
\def\citesel@write#1#2#3#4#5{%
- \begingroup
- \toks@{{#3}{#4}}%
- \immediate\write\@auxout{\string\bibcite{\CurrentBib}{\the\toks@}}%
- \endgroup
+ \toks@{{#3}{#4}}%
+ \immediate\write\@auxout{\string\bibcite{\CurrentBib}{\the\toks@}}%
}
% \end{macrocode}
% \end{macro}
@@ -3039,13 +3067,38 @@
% \end{macrocode}
% \end{macro}
%
+% \begin{macro}{\bib@div@mark}
+% The AMS document classes automatically take care of the page
+% marks for \cn{section*} and \cn{chapter*}, but for the standard
+% classes, we need to make sure that \cn{@mkboth} gets invoked.
+% \begin{macrocode}
+\let\bib@div@mark\@gobble
+% \end{macrocode}
+% This is verbose, but probably safer than any alternative.
+% \begin{macrocode}
+\@ifclassloaded{amsbook}{}{%
+ \@ifclassloaded{amsart}{}{%
+ \@ifclassloaded{amsproc}{}{%
+ \def\bib@div@mark#1{%
+ \@mkboth{\MakeUppercase{#1}}{\MakeUppercase{#1}}%
+ }%
+ }%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
+%
% \begin{environment}{bibchapter}
% We need to take a little extra trouble here to pre-expand the
% \cn{bibname}.
% \begin{macrocode}
\newenvironment{bibchapter}[1][\bibname]{%
\begingroup
- \protected@edef\@{\endgroup\protect\chapter*{#1}}%
+ \protected@edef\@{%
+ \endgroup
+ \protect\chapter*{#1}%
+ \protect\bib@div@mark{#1}%
+ }%
\@
}{\par}
% \end{macrocode}
@@ -3056,7 +3109,11 @@
% \begin{macrocode}
\newenvironment{bibsection}[1][\refname]{%
\begingroup
- \protected@edef\@{\endgroup\protect\section*{#1}}%
+ \protected@edef\@{%
+ \endgroup
+ \protect\section*{#1}%
+ \protect\bib@div@mark{#1}%
+ }%
\@
}{\par}
% \end{macrocode}
@@ -3888,6 +3945,7 @@
% \begin{macrocode}
\newcommand{\othercites}[1]{%
\cite@begingroup
+ \let\BackCite\@gobble
\let\cite@endgroup\@empty
\def\citelist{\othercitelist}%
\cites{#1}%
@@ -4484,7 +4542,11 @@
\let\hyper@anchorstart\@gobble
\let\hyper@anchorend\relax
}%
- \@ifpackageloaded{showlabels}{}{%
+ \@ifpackageloaded{showkeys}{%
+ \@ifpackagewith{showkeys}{notcite}{%
+ \let\ar@SK@cite\@gobble
+ }{}
+ }{%
\let\ar@SK@cite\@gobble
\let\SK@@label\@gobble
\let\SK@\@gobbletwo
@@ -6893,7 +6955,7 @@
%
% \begin{macro}{\@scanforMR}
% \begin{macrocode}
-\def\@scanforMR#1#2#3#4\@nil{%
+\def\strip@MRprefix#1#2#3#4\@nil{%
\def\@tempa{#1#2#3#4}%
\if#1M%
\if#2R%
@@ -6909,7 +6971,7 @@
\def\MR#1{%
\relax\ifhmode\unskip\spacefactor3000 \space\fi
\begingroup
- \@scanforMR#1\@nil
+ \strip@MRprefix#1\@nil
\edef\@tempa{MR\@nx\MRhref{\@tempa}{\@tempa}}%
\@xp\endgroup
\@tempa
@@ -7285,21 +7347,34 @@
% \end{macrocode}
%
% \subsubsection{The \opt{backrefs} option}
-%
+% Rather than checking for the \opt{backrefs} option \emph{per se},
+% we check to see if the \pkg{backref} package is loaded. This
+% accomodates authors who load the \pkg{backref} package explicitly
+% but do not pass the \opt{backrefs} option to \pkg{amsrefs}.
% \begin{macrocode}
-\IfOption{backrefs}{%
- \let\PrintBackRefs\print@backrefs
- \@ifundefined{Hy@backout}{%
- \amsrefs@warning{backref option requires hyperref package}%
- }{%
+\AtBeginDocument{%
+ \@ifpackageloaded{backref}{%
+ \let\PrintBackRefs\print@backrefs
\let\BackCite\back@cite
- \AtBeginDocument{%
- \let\ams@saved@toc\tableofcontents
- \@starttoc{brf}{}%
- \let\tableofcontents\ams@saved@toc
- }%
- }%
-}{%
+% \end{macrocode}
+% The \pkg{backref} package uses \cn{@starttoc} inside
+% \cn{thebibliography} to open and read the \fn{.brf} file. We
+% could do something similar with \cn{biblist}, but it seems
+% cleaner to use \cn{AtBeginDocument}. Unfortunately, \cls{amsart}
+% redefines \cn{@starttoc} in a way that interacts badly with this
+% use. So, we inline the relevant parts of \cn{@starttoc} here.
+% (The group and \cn{makeatletter} are unnecessary at present, but
+% I'll leave them in as future-proofing.)
+% \begin{macrocode}
+ \begingroup
+ \makeatletter
+ \@input{\jobname.brf}%
+ \if@filesw
+ \newwrite\tf@brf
+ \immediate\openout\tf@brf \jobname.brf\relax
+ \fi
+ \endgroup
+ }{}%
}
% \end{macrocode}
%
@@ -7309,7 +7384,7 @@
\IfOption{citation-order}{%
\IfOption{alphabetic}{%
\amsrefs@warning@nl{%
- The 'citation-order' and 'alphabetic' options are
+ The citation-order and alphabetic options are
incompatible%
}%
}{
@@ -7432,8 +7507,8 @@
\def\bibtex@style{amsry}%
}{%
\amsrefs@warning@nl{%
- The 'y2k' option can only be used with the^^J%
- 'alphabetic' option%
+ The y2k option can only be used with the^^J%
+ alphabetic option%
}%
}
}{}
@@ -7447,6 +7522,36 @@
}{}
% \end{macrocode}
%
+% \subsubsection{The \opt{msc-links} option}
+%
+% \begin{macrocode}
+\IfOption{msc-links}{%
+% \end{macrocode}
+% Unless you're using pdf\TeX, links cannot be broken across
+% lines, which causes problems for long-form MR numbers such as
+% ``MR2149145 (2006d:01012)''. To mitigate the problem, we
+% manually break such numbers into two separate links.
+% \begin{macrocode}
+ \@ifundefined{href}{}{%
+ \def\parse@MR#1 (#2)#3\@nil{%
+ \def\MR@url{http://www.ams.org/mathscinet-getitem?mr=#1}%
+ \def\@tempd{#1}%
+ \def\@tempe{#2}%
+ }%
+ \def\MRhref#1#2{%
+ \begingroup
+ \parse@MR#1 ()\@empty\@nil%
+ \href{\MR@url}{\@tempd\vphantom{()}}%
+ \ifx\@tempe\@empty
+ \else
+ \ \href{\MR@url}{(\@tempe)}%
+ \fi
+ \endgroup
+ }%
+ }{}
+}{}
+% \end{macrocode}
+%
% \subsubsection{The \opt{author-year} option}
%
% Here ends the \pkg{amsrefs} package, unless the \opt{author-year}
@@ -8077,5 +8182,5 @@
\endinput
% \end{macrocode}
%
-% \CheckSum{5058}
+% \CheckSum{5139}
% \Finale