diff options
author | Karl Berry <karl@freefriends.org> | 2006-01-12 23:57:07 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2006-01-12 23:57:07 +0000 |
commit | 36d4aa42d015b48d19108d0b983d26cc207ca078 (patch) | |
tree | 253eed51f8286374e8c7f5cebb3dd2a2d7bf977e /Master/texmf-dist/tex/latex/index/bibref.sty | |
parent | b2db5eec35b894d3550529a0c6de5cdf35928339 (diff) |
index
git-svn-id: svn://tug.org/texlive/trunk@994 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/index/bibref.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/index/bibref.sty | 117 |
1 files changed, 117 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/index/bibref.sty b/Master/texmf-dist/tex/latex/index/bibref.sty new file mode 100644 index 00000000000..62b985b18f8 --- /dev/null +++ b/Master/texmf-dist/tex/latex/index/bibref.sty @@ -0,0 +1,117 @@ +%%% ==================================================================== +%%% @LaTeX-style-file{ +%%% filename = "bibref.sty", +%%% version = "1.0beta", +%%% date = "29 September 1995", +%%% time = "14:36:27 EDT", +%%% author = "David M. Jones", +%%% address = "MIT Laboratory for Computer Science +%%% Room NE43-316 +%%% 545 Technology Square +%%% Cambridge, MA 02139 +%%% USA", +%%% telephone = "(617) 253-5936", +%%% FAX = "(617) 253-3480", +%%% checksum = "21394 117 377 3498", +%%% email = "dmjones@theory.lcs.mit.edu", +%%% codetable = "ISO/ASCII", +%%% keywords = "", +%%% supported = "yes", +%%% abstract = "", +%%% docstring = "The checksum field above contains a CRC-16 +%%% checksum as the first value, followed by the +%%% equivalent of the standard UNIX wc (word +%%% count) utility output of lines, words, and +%%% characters. This is produced by Robert +%%% Solovay's checksum utility.", +%%% } +%%% ==================================================================== + +%% This is an experimental package to support back references from +%% reference sections to the pages where individual items are cited. +%% I.e., the reference section would +%% +%% Zofia Adamowicz. A sharp version of the bounded +%% {Matijasevich} conjecture and the end-extension problem. +%% Journal of Symbolic Logic}, 57(2):597--616, June 1992. (pages +%% 1, 3-5, 54) +%% +%% if that item were cited on pages 1, 3, 4, 5 and 54. +%% +%% To use this feature, you'll need to make a small change to your +%% BibTeX bibliography style file. In the standard styles, all that +%% is needed is to modify the function fin.entry as follows: +%% +%% FUNCTION {fin.entry} +%% { add.period$ +%% write$ +%% "\bibref{" cite$ "}" * * write$ % added line +%% newline$ +%% } +%% +%% Then load the bibref package by adding +%% +%% \usepackage{bibref} +%% +%% to your document preamble, and run LaTeX as normal. After running +%% LaTeX, invoke makeindex as follows: +%% +%% makeindex -s bibref.ist -o <jobname>.bnd <jobname>.bdx +%% +%% The next time you run LaTeX, the back-references should magically +%% appear. +%% +%% See plaintst.tex and xplain.bst for an example. + +\RequirePackage{index} + +\newindex{@bib}{bdx}{bnd}{} + +\newcommand{\biblabel}[2]{% + \global\@namedef{br@#1}{#2}% +} + +\newcommand{\bibref}[1]{% + \unskip\space + \@ifundefined{br@#1}{% +% (\textbf{??})% + }{% + \edef\reserved@a{\@nameuse{br@#1}}% + \afterassignment\@bibref\count@\reserved@a\relax\@nil + }% +} + +\def\@bibref#1\@nil{% + \if\relax#1% + (page~\reserved@a)% + \else + (pages~\reserved@a)% + \fi +} + +\let\@@cite\cite + +\renewcommand{\cite}[2][]{% + \@for\@citea:=#2\do{% + \edef\reserved@a{% + \noexpand\index[@bib]{\@citea}% + }% + \reserved@a + }% + \def\reserved@a{#1}% + \ifx\reserved@a\@empty + \@@cite{#2}% + \else + \@@cite[#1]{#2}% + \fi +} + +\renewcommand{\bibliography}[1]{% + \if@filesw + \immediate\write\@auxout{\string\bibdata{#1}}% + \fi + \@input@{\jobname.bnd}% + \@input@{\jobname.bbl}% +} + +\endinput |