summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/amsrefs/amsrefs.dtx
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2007-10-14 22:19:57 +0000
committerKarl Berry <karl@freefriends.org>2007-10-14 22:19:57 +0000
commit6e5c0acada6a9c582fe33af8763348a18eb2a0f6 (patch)
treeb9c5791b76f3c25d0cd5207cc35c3bf01f609395 /Master/texmf-dist/source/latex/amsrefs/amsrefs.dtx
parent53b3eebc589bf2a49e91bd9c9d8112f2b38bce11 (diff)
amsrefs update
git-svn-id: svn://tug.org/texlive/trunk@5189 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/amsrefs/amsrefs.dtx')
-rw-r--r--Master/texmf-dist/source/latex/amsrefs/amsrefs.dtx159
1 files changed, 105 insertions, 54 deletions
diff --git a/Master/texmf-dist/source/latex/amsrefs/amsrefs.dtx b/Master/texmf-dist/source/latex/amsrefs/amsrefs.dtx
index e8d81ed6336..8882bafc2ee 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.0",
-%%% date = "2004/06/30",
-%%% time = "11:24:39 EDT",
+%%% version = "2.02",
+%%% date = "2006/10/25",
+%%% time = "11:13:05 EDT",
%%% author = "Michael J Downes and David M. Jones",
%%% address = "American Mathematical Society,
%%% Publications Technical Group,
@@ -16,7 +16,14 @@
%%% to be controlled completely from the LaTeX side
%%% instead of being determined chiefly by the BibTeX
%%% style file.",
-%%% checksum = "09127 8030 25325 242081",
+%%% copyright = "Copyright 2001, 2004, 2006, 2007 American
+%%% 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",
%%% docstring = "The checksum field, produced by Robert Solovay's
%%% checksum utility, gives CRC-16 checksum, lines,
%%% words, and characters.",
@@ -224,11 +231,6 @@
% this,'' whereas with the \textit{logical quotes} option the order
% is reversed, ``like this''.
%
-% \item[beta, jpa]
-%
-% Obsolete; these applied only to the beta version of the
-% \pkg{amsrefs} package.
-%
% \end{description}
%
% \section{More about the \cn{bib} command}\label{bib-command}
@@ -859,6 +861,7 @@
% Standard declaration of package name and date.
% \begin{macrocode}
\NeedsTeXFormat{LaTeX2e}[1995/12/01]
+\ProvidesPackage{amsrefs}[2006/10/25 v2.02]
% \end{macrocode}
%
% \begin{macro}{\amsrefs@warning@nl}
@@ -867,20 +870,14 @@
% \end{macrocode}
% \end{macro}
%
-% Backward handling for beta version.
+% Backward handling for beta and jpa options.
% \begin{macrocode}
\@ifpackagewith{amsrefs}{beta}{%
- \amsrefs@warning@nl{The beta option is deprecated^^J%
- and will be removed in a future release of amsrefs}
- \expandafter\edef\csname opt@amsrbeta.sty\endcsname
- {\@ptionlist{amsrefs.sty}}%
- \def\@currname{amsrbeta}%
- \expandafter\let\csname amsrbeta.sty-h@@k\endcsname\@empty
- \def\@tempa{\input{amsrbeta.sty}\endinput}%
-}{%
- \let\@tempa\@empty
-}
-\@tempa
+ \amsrefs@warning@nl{The beta option is obsolete}%
+}{}
+\@ifpackagewith{amsrefs}{jpa}{%
+ \amsrefs@warning@nl{The jpa option is obsolete}%
+}{}
% \end{macrocode}
%
% \begin{macrocode}
@@ -914,7 +911,6 @@
% \begin{macrocode}
\@ifundefined{NormalCatcodes}{\RequirePackage{pcatcode}\relax}{}
\PushCatcodes\NormalCatcodes
-\ProvidesPackage{amsrefs}[2004/06/07 v1.71]
% \end{macrocode}
%
% \begin{macrocode}
@@ -1283,11 +1279,6 @@
\DeclareBooleanOption{beta}
% \end{macrocode}
%
-% This one is obsolete now.
-% \begin{macrocode}
-\DeclareBooleanOption{jpa}
-% \end{macrocode}
-%
% \begin{macrocode}
\DeclareBooleanOption{bibtex-style}
% \end{macrocode}
@@ -2197,6 +2188,11 @@
\let\set:bib'journal\output@xref@a
\let\set:bib'publisher\output@xref@a
\def\set:bib'xref##1##2{\output@xref@{##1}\@empty}%
+ \def\set:bib'book##1##2{\output@inner@xref@{##1}\@empty}%
+ \let\set:bib'conference\set:bib'book
+ \let\set:bib'partial\set:bib'book
+ \let\set:bib'reprint\set:bib'book
+ \let\set:bib'translation\set:bib'book
}
\catcode`\:=12
@@ -2226,6 +2222,13 @@
\@xp\g@undef\csname bi@#1\endcsname
}%
}
+
+\def\output@inner@xref@#1{%
+ \in@={#1}%
+ \ifin@\else
+ \output@xref@{#1}%
+ \fi
+}
% \end{macrocode}
%
% \begin{macro}{\bbl@copy}
@@ -2388,6 +2391,7 @@
\def\bib@print@inner#1#2{%
\begingroup
#2\relax % execute definitions locally
+ \bib@resolve@xrefs
\bib@field@patches
\bib'setup
#1%
@@ -2553,6 +2557,8 @@
\ifx#1\@empty
\else
\begingroup
+ \@apply\auto@protect\amsrefs@textsymbols
+ \@apply\auto@protect\amsrefs@textaccents
\let\DSK@def\xref@add@toks
\let\DSK@append\xref@append
\toks@\@emptytoks
@@ -4294,13 +4300,34 @@
%
% \subsubsection{Munging the \fn{.aux} file}
%
-% \begin{macro}{\bibcite}
+% \begin{macro}{\amsrefs@bibcite}
% When processing the \fn{.aux} file at begin-document, this is what
% \cs{bibcite} will do:
% \begin{macrocode}
-\def\bibcite#1{\@xp\bibcite@a\csname b@#1\endcsname}
+\def\amsrefs@bibcite#1{\@xp\bibcite@a\csname b@#1\endcsname}
% \end{macrocode}
% \end{macro}
+% However, \pkg{hyperref} also redefines \cs{bibcite}, so to avoid
+% conflicts and also ensure that it doesn't matter whether
+% \pkg{amsrefs} or \pkg{hyperref} is loaded first, rather than
+% redefining \cs{bibcite} directly, we redefine it inside the
+% \fn{.aux} file.
+% \begin{macrocode}
+\AtBeginDocument{%
+ \if@filesw
+ \immediate\write\@auxout{%
+ \string\@ifundefined{amsrefs@bibcite}{}{%
+ \string\let\string\bibcite\string\amsrefs@bibcite
+ }%
+ }%
+ \fi
+% \end{macrocode}
+% For good measure, we'll redefine it here as well, even though it
+% really shouldn't matter any longer.
+% \begin{macrocode}
+ \let\bibcite\amsrefs@bibcite
+}
+% \end{macrocode}
%
% \begin{macro}{\bibcite@a}
% \MacroArgs
@@ -4422,11 +4449,20 @@
% \end{macrocode}
% \end{macro}
%
-% \subsubsection{\pkg{hyperref} and \pkg{showkeys} support}
+% \subsubsection{\pkg{hyperref}, \pkg{showkeys} and \pkg{shaderef}
+% support}
+%
+% \begin{macro}{\shade@cite}
+% \begin{macrocode}
+\newcommand{\shade@cite}{\overshadebox{shaderef-gray}}
+% \end{macrocode}
+% \end{macro}
%
% \begin{macro}{\ar@hyperlink}
% \begin{macrocode}
-\def\ar@hyperlink#1{\hyper@@link [cite]{}{cite.\extr@cite#1}{#1}}
+\def\ar@hyperlink#1{%
+ \hyper@@link [cite]{}{cite.\extr@cite#1}{\shade@cite{#1}}%
+}
% \end{macrocode}
% \end{macro}
%
@@ -4440,16 +4476,19 @@
% packages don't appear to be loaded.
% \begin{macrocode}
\AtBeginDocument{%
- \@ifundefined{hyper@@link}{%
- \let\ar@hyperlink\@firstofone
+ \@ifpackageloaded{shaderef}{}{%
+ \let\shade@cite\@empty
+ }%
+ \@ifpackageloaded{hyperref}{}{%
+ \let\ar@hyperlink\shade@cite
\let\hyper@anchorstart\@gobble
\let\hyper@anchorend\relax
- }{}%
- \@ifundefined{SK@@label}{%
+ }%
+ \@ifpackageloaded{showlabels}{}{%
\let\ar@SK@cite\@gobble
\let\SK@@label\@gobble
\let\SK@\@gobbletwo
- }{}%
+ }%
}
% \end{macrocode}
%
@@ -6689,6 +6728,7 @@
\def\bib@reprint#1{%
\begingroup
#1\relax % execute definitions locally
+ \bib@resolve@xrefs
\bib@field@patches
\bib'setup
\IfEmptyBibField{copula}{reprinted in}{\bib'copula} \nopunct
@@ -6712,6 +6752,7 @@
\def\bib@translation#1{%
\begingroup
#1\relax % execute definitions locally
+ \bib@resolve@xrefs
\bib@field@patches
\bib'setup
\let\PrintPrimary\@empty
@@ -6850,14 +6891,28 @@
% \end{macro}
% \end{macro}
%
+% \begin{macro}{\@scanforMR}
+% \begin{macrocode}
+\def\@scanforMR#1#2#3#4\@nil{%
+ \def\@tempa{#1#2#3#4}%
+ \if#1M%
+ \if#2R%
+ \def\@tempa{#3#4}%
+ \fi
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+%
% \begin{macro}{\MR}
% \begin{macrocode}
\def\MR#1{%
\relax\ifhmode\unskip\spacefactor3000 \space\fi
- \def\@tempa##1:##2:##3\@nil{%
- \ifx @##2\@empty##1\else\textbf{##1:}##2\fi
- }%
- \MRhref{#1}{MR \@tempa#1:@:\@nil}%
+ \begingroup
+ \@scanforMR#1\@nil
+ \edef\@tempa{MR\@nx\MRhref{\@tempa}{\@tempa}}%
+ \@xp\endgroup
+ \@tempa
}
% \end{macrocode}
% \end{macro}
@@ -6866,7 +6921,7 @@
% For older versions of some AMS document classes, this patch is
% needed.
% \begin{macrocode}
-\providecommand{\MRhref}[1]{}
+\providecommand{\MRhref}[2]{#1}
% \end{macrocode}
% \end{macro}
%
@@ -7238,7 +7293,11 @@
\amsrefs@warning{backref option requires hyperref package}%
}{%
\let\BackCite\back@cite
- \AtBeginDocument{\@starttoc{brf}{}}%
+ \AtBeginDocument{%
+ \let\ams@saved@toc\tableofcontents
+ \@starttoc{brf}{}%
+ \let\tableofcontents\ams@saved@toc
+ }%
}%
}{%
}
@@ -7285,16 +7344,6 @@
} % end conditional code for initials option
% \end{macrocode}
%
-% \subsubsection{The \opt{jpa} option}
-%
-% \begin{macrocode}
-\IfOption{jpa}{%
- \amsrefs@warning{The 'jpa' option is obsolete}%
- \typeout{Trying \string\usepackage{amsjpa} instead ...}%
- \RequirePackage{amsjpa}[2000/02/02]
-}{}
-% \end{macrocode}
-%
% \subsubsection{The \opt{logical-quotes} option}
%
% \begin{macro}{\deferredquotes}
@@ -7532,7 +7581,9 @@
%
% \begin{macro}{\BibLabel}
% \begin{macrocode}
-\let\BibLabel\@empty
+\def\BibLabel{%
+ \hyper@anchorstart{cite.\CurrentBib}\relax\hyper@anchorend
+}
% \end{macrocode}
% \end{macro}
%
@@ -8026,5 +8077,5 @@
\endinput
% \end{macrocode}
%
-% \CheckSum{5005}
+% \CheckSum{5058}
% \Finale