2 %% This is file `backref.sty',
3 %% generated with the docstrip utility.
5 %% The original source files were:
7 %% backref.dtx (with options: `package')
10 \def\filedate{2000/01/19}
11 %% File: backref.dtx Copyright (C) 1995, 1996, 1997, 1999 David Carlisle, Sebastian Rahtz
12 %% This file is part of the `Hyperref Bundle'.
13 %% -------------------------------------------
15 %% It may be distributed under the conditions of the LaTeX Project Public
16 %% License, either version 1.2 of this license or (at your option) any
17 %% later version. The latest version of this license is in
18 %% http://www.latex-project.org/lppl.txt
19 %% and version 1.2 or later is part of all distributions of LaTeX
20 %% version 1999/12/01 or later.
22 %% The list of all files belonging to the `Hyperref Bundle' is
23 %% given in the file `manifest.txt'.
24 \ProvidesPackage{backref}%
25 [\filedate\space v\fileversion\space Bibliographical back referencing]
27 \@ifundefined{ifHy@verbose}{%
30 \let\ifBR@verbose\ifHy@verbose
32 \DeclareOption{verbose}{\BR@verbosetrue}
33 \long\def\page@backref#1#2#3{#1}
34 \long\def\section@backref#1#2#3{#2}
35 \long\def\hyper@section@backref#1#2#3{\hyperlink{#3}{#2}}
36 \long\def\hyper@page@backref#1#2#3{\hyperlink{page.#1}{#1}}
37 \def\backrefpagesname{pages}
38 \def\backrefsectionsname{sections}
39 \DeclareOption{pageref}{%
40 \def\backref{\backrefpagesname\ }%
41 \let\backrefxxx\page@backref
44 \def\backref{\backrefsectionsname\ }%
45 \let\backrefxxx\section@backref
47 \DeclareOption{hyperref}{%
48 \def\backref{}\let\backrefxxx\hyper@section@backref
50 \DeclareOption{hyperpageref}{%
51 \def\backref{}\let\backrefxxx\hyper@page@backref
53 \ExecuteOptions{pageref}
55 \def\BR@bibitem{\@ifnextchar[\BR@@lbibitem\BR@@bibitem}
56 \def\BR@@lbibitem[#1]#2#3\par{%
57 \BRorg@bibitem[#1]{#2}#3
59 \backref{\csname br@#2\endcsname}%
62 \def\BR@@bibitem#1#2\par{%
65 \backref{\csname br@#1\endcsname}%
68 \@ifundefined{newblock}{\def\newblock{\par}}{}
71 \edef\x{\expandafter\@firstofone\x\@empty}%
72 \expandafter\ifx\csname br@\x\endcsname\relax
73 \expandafter\protected@xdef\csname br@\x\endcsname{%
74 \protect\backrefxxx#2%
78 \expandafter\def\expandafter\reserved@a\expandafter{%
81 \let\BRorg@backrefxxx\backrefxxx
82 \global\let\BR@found=N%
83 \long\def\backrefxxx##1##2##3{%
84 \expandafter\def\expandafter\reserved@b\expandafter{%
85 \BRorg@backrefxxx{##1}{##2}{##3}%
87 \ifx\reserved@a\reserved@b
88 \global\let\BR@found=Y%
91 \setbox\@tempboxa\hbox{\csname br@\x\endcsname}%
94 \expandafter\protected@xdef\csname br@\x\endcsname{%
95 \csname br@\x\endcsname, %
96 \protect\backrefxxx#2%
104 \let\BRorg@bibitem\bibitem
105 \let\bibitem\BR@bibitem
106 \let\BRorg@thebibliography\thebibliography
107 \def\thebibliography{%
109 \BRorg@thebibliography
111 \@ifundefined{NAT@parse}{%
112 \global\let\BRorg@citex\@citex
113 \global\let\@citex\BR@citex
115 \PackageInfo{backref}{** backref set up for natbib **}%
118 \def\BR@citex[#1]#2{%
119 \BRorg@citex[#1]{#2}%
121 \PackageInfo{backref}{back cite \string`#2\string'}%
125 \@ifpackageloaded{chicago}{%
126 \let\BRorg@citedatax\@citedatax
127 \def\@citedatax[#1]#2{%
128 \BRorg@citedatax[#1]{#2}%
134 \ifx\@empty\@currentlabel
135 \protected@write\@auxout{}{%
136 \string\@writefile{brf}{%
137 \string\backcite{#1}{{\thepage}{(document)}{Doc-Start}}%
141 \protected@write\@auxout{}{%
142 \string\@writefile{brf}{%
143 \string\backcite{#1}{{\thepage}{\@currentlabel}{\@currentHref}}%
151 %% End of file `backref.sty'.