diff options
author | Karl Berry <karl@freefriends.org> | 2006-08-20 00:16:44 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2006-08-20 00:16:44 +0000 |
commit | 81e85f9bb5875b6c3cd460112e26e715d8965004 (patch) | |
tree | 080f756dab293c38187e2cc6cde199e717f57433 /Master/texmf-dist/source/latex/hyperref/backref.dtx | |
parent | 4cdec44e9893db7879eb9f2f34cfcbe52072abd0 (diff) |
hyperref 6.75a (1aug06)
git-svn-id: svn://tug.org/texlive/trunk@1993 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/hyperref/backref.dtx')
-rw-r--r-- | Master/texmf-dist/source/latex/hyperref/backref.dtx | 116 |
1 files changed, 100 insertions, 16 deletions
diff --git a/Master/texmf-dist/source/latex/hyperref/backref.dtx b/Master/texmf-dist/source/latex/hyperref/backref.dtx index 5a25459c36e..147a1739ec0 100644 --- a/Master/texmf-dist/source/latex/hyperref/backref.dtx +++ b/Master/texmf-dist/source/latex/hyperref/backref.dtx @@ -1,8 +1,5 @@ -\def\fileversion{1.23} -\def\filedate{2003/03/20} -% % \iffalse -%% File: backref.dtx Copyright (C) 1995-2003 David Carlisle, Sebastian Rahtz, Heiko Oberdiek +%% File: backref.dtx Copyright (C) 1995-2005 David Carlisle, Sebastian Rahtz, Heiko Oberdiek % %% This file is part of the `Hyperref Bundle'. %% ------------------------------------------- @@ -16,9 +13,29 @@ %% %% The list of all files belonging to the `Hyperref Bundle' is %% given in the file `manifest.txt'. +% +%<*dtx> +\ProvidesFile{backref.dtx} +%</dtx> +%<package>\NeedsTeXFormat{LaTeX2e} +%<package>\ProvidesPackage{backref} +%<driver>\ProvidesFile{backref.drv} +% \fi +% \ProvidesFile{backref.dtx} + [2006/08/01 v1.26 Bibliographical back referencing] +% +% \CheckSum{550} +% +% \iffalse %<*driver> \documentclass{ltxdoc} +\IfFileExists{bmhydoc.sty}{\usepackage{bmhydoc}}{} +\usepackage[numbered]{hypdoc} +\usepackage{backref} +\EnableCrossrefs +\CodelineIndex \begin{document} + \GetFileInfo{backref.sty} \title{% Back referencing from bibliographical citations% \thanks{% @@ -29,13 +46,19 @@ \author{David Carlisle and Sebastian Rahtz} \date{\filedate} \maketitle + \makeatletter + \@ifundefined{HyperrefOverview}{}{% + \HyperrefOverview*% + }% \tableofcontents \DocInput{backref.dtx} + \PrintIndex \end{document} %</driver> % \fi -% \CheckSum{505} +% % \MakeShortVerb{|} +% % \section{Introduction} % % \section{Usage} @@ -78,11 +101,12 @@ % |USenglish|, |british|, |german|, |ngerman|, |austrian|, |naustrian|, % |french|, |francais|, and |spanish|. % -% \subsection{Formatting of the back references list} +% \subsection{Detecting the end of a bibliography entry} % % Package |backref| has to be able to detect the end of an entry % in the bibliography, therefore each \cmd{\bibitem} entry must % be ended by an empty line (or a |\par| token). +% \nopagebreak % % Example: %\begin{quote} @@ -95,9 +119,38 @@ %\end{thebibliography} %\end{verbatim} %\end{quote} +% Then package |backref| can automatically add hooks +% for the back references list at the end of the entries. +% +% \DescribeMacro{\backrefparscanfalse} +% \DescribeMacro{\backrefparscantrue} +% Sometimes it is not appropriate if the entry is read as +% argument. For example, catcode changes for verbatim stuff +% do not have the desired effect. Therefore the scan for +% the \cs{par} token can be disabled by \cs{backrefparscanfalse} +% before \cs{bibitem} and enabled by \cs{backrefparscantrue} +% afterwards. +% +% \DescribeMacro{\backrefprint} +% If the scan for the end of the entry is disabled, then package +% |backref| does not know where to put the back references +% list. The list is printed by the macro \cs{backrefprint}, thus +% just call it at the right place. Example: +%\begin{quote} +%\begin{verbatim} +%\backrefparscanfalse % disable scan for entry ending +%\bibitem[...]{...} +% ... \verb|...| ... % potentially dangerous stuff +% ... \url{...} ... +% \backrefprint % print back reference list here +%\backrefparscantrue % enable scan again +%\end{verbatim} +%\end{quote} +% +% \subsection{Formatting of the back references list} % -% Then package |backref| can add hooks for the back references list. -% at the end of the entry. The list is separated by \cmd{\newblock}, +% The back references list is separated from the entry +% by \cmd{\newblock}, % if the used bibliography package supports this. The package options % control the kind of back references (page numbers, sections numbers), % whereas the hooks control the formatting. @@ -106,7 +159,7 @@ % available since version 1.21 of package |backref|. The former one % is enabled by default. % -% \subsubsection{Formatting hook \cmd{\backref}} +% \subsubsection{Formatting hook \cs{backref}} % % Macro \cmd{\backref} has a a comma separated % list of backref references as first and only argument. @@ -114,7 +167,7 @@ % hyperref there is an introductionary text, controlled by % macros \cmd{\backrefpagesname} or \cmd{\backrefsectionsname}. % -% \subsubsection{Formatting hook \cmd{\backrefalt}} +% \subsubsection{Formatting hook \cs{backrefalt}} % % \cmd{\backrefalt} is a new interface since version 1.21 of package % |backref|. It takes four arguments: @@ -171,8 +224,6 @@ % \subsection{Package identification} % \begin{macrocode} %<*package> -\ProvidesPackage{backref}% - [\filedate\space v\fileversion\space Bibliographical back referencing] % \end{macrocode} % % \subsection{Options} @@ -323,20 +374,53 @@ % % \subsection{The bibliography} % +% \begin{macro}{\ifbackrefparscan} +% \begin{macrocode} +\newif\ifbackrefparscan +\backrefparscantrue +% \end{macrocode} +% \end{macro} +% % \begin{macro}{\BR@bibitem} % \begin{macrocode} -\def\BR@bibitem{\@ifnextchar[\BR@@lbibitem\BR@@bibitem} +\def\BR@bibitem{% + \ifbackrefparscan + \expandafter\@ifnextchar\expandafter[\expandafter + \BR@@lbibitem\expandafter\BR@@bibitem + \else + \expandafter\@ifnextchar\expandafter[\expandafter + \BR@@@lbibitem\expandafter\BR@@@bibitem + \fi +} % \end{macrocode} % \end{macro} % \begin{macrocode} \def\BR@@lbibitem[#1]#2#3\par{% - \BRorg@bibitem[#1]{#2}#3% + \let\backrefprint\BR@backrefprint + \BRorg@bibitem[{#1}]{#2}#3% \BR@backref{#2}% }% \def\BR@@bibitem#1#2\par{% + \let\backrefprint\BR@backrefprint \BRorg@bibitem{#1}#2% \BR@backref{#1}% } +\def\BR@@@lbibitem[#1]#2{% + \def\backrefprint{\BR@backref{#2}}% + \BRorg@bibitem[{#1}]{#2}% +} +\def\BR@@@bibitem#1{% + \def\backrefprint{\BR@backref{#1}}% + \BRorg@bibitem{#1}% +} +\def\BR@backrefprint{% + \PackageError{backref}{% + \string\backrefprint\space is only available after \string\bibitem + \MessageBreak + with setting \string\backrefparscanfalse + }\@ehc +} +\let\backrefprint\BR@backrefprint \def\BR@backref#1{% \newblock \begingroup @@ -546,7 +630,7 @@ % \begin{macro}{\BR@citex} % \begin{macrocode} \def\BR@citex[#1]#2{% - \BRorg@citex[#1]{#2}% + \BRorg@citex[{#1}]{#2}% \ifBR@verbose \PackageInfo{backref}{back cite \string`#2\string'}% \fi @@ -560,7 +644,7 @@ \@ifpackageloaded{chicago}{% \let\BRorg@citedatax\@citedatax \def\@citedatax[#1]#2{% - \BRorg@citedatax[#1]{#2}% + \BRorg@citedatax[{#1}]{#2}% \Hy@backout{#2}% }% }{} |