Back referencing from bibliographical citations^{∗}

David Carlisle

1994/10/02

Contents

1 Introduction 1

2 Usage 1

3 The macros 1

Contents

1 Introduction

2 Usage

3 The macros

1 ⟨∗package⟩

2 \ProvidesPackage{backref}[\filedate:
3 bibliographical back referencing, \fileversion]

4

5 \long\def\page@backref#1#2#3{#1}
6 \long\def\section@backref#1#2#3{#2}
7 \long\def\hyper@section@backref#1#2#3{%
8 \hyperlink{#3}{#1}%
9 }
10 \long\def\hyper@page@backref#1#2#3{%
11 \hyperlink{page.#2}{#2}%

12 }

13 \DeclareOption{pageref}{%
14 \def\backref{pages }%
15 \let\backrefxxx\page@backref

∗This file has version number v1.5i, last revised 1994/10/02.

17 \DeclareOption{ref}{%
18 \def\backref{sections }%
19 \let\backrefxxx\section@backref

20 }

Set up back-referencing to be hyper links, by page or section.

21 \DeclareOption{hyperref}{%
22 \def\backref{}\let\backrefxxx\hyper@section@backref

23 }

24 \DeclareOption{hyperpageref}{%
25 \def\backref{}\let\backrefxxx\hyper@page@backref

26 }

27 \ExecuteOptions{pageref}
28 \ProcessOptions

29

30 \@ifundefined{newblock}{\def\newblock{\par}}{}

31

32 \def\xbibitem{\@ifnextchar[{\@xlbibitem}{\@xbibitem}}

33

34 \def\@xlbibitem[#1]#2#3\par{%
35 \oldb[#1]{#2}#3
36 \newblock
37 \backref{\csname br@#2\endcsname}%
38 \par
39 }%
40 \def\@xbibitem#1#2\par{%
41 \oldb{#1}#2
42 \newblock
43 \backref{\csname br@#1\endcsname}%
44 \par

45 }

46 \def\backcite#1#2{%
47 \@for\x:=#1\do{\expandafter\protected@xdef\csname br@\x\endcsname{%
48 \expandafter\ifx\csname br@\x\endcsname\relax\else
49  \csname br@\x\endcsname, \fi\protect\backrefxxx#2}}}

50

51 \def\@currentHref{}
52 \AtBeginDocument{%
53 \let\oldb\bibitem
54 \let\bibitem\xbibitem
55 \let\oldbibl\thebibliography
56 \def\thebibliography{\@starttoc{brf}{}\oldbibl}
57 \let\old@citex\@citex
58 \let\@citex\x@citex

59 }

60

61 \def\x@citex[#1]#2{%
62 \old@citex[#1]{#2}%
63 \def\@nothing{}%

64 \ifx\@nothing\@currentlabel\else
65 \@bsphack
66 \protected@write\@auxout{}%
67 {\string\@writefile{brf}%
68  {\string\backcite{#2}{{\@currentlabel}{\thepage}{\@currentHref}}}}%
69 \@esphack
70 \fi

71 }

72

73 ⟨/package⟩