diff options
Diffstat (limited to 'Master/texmf-dist/source/latex/hyperref/backref.dtx')
-rw-r--r-- | Master/texmf-dist/source/latex/hyperref/backref.dtx | 134 |
1 files changed, 104 insertions, 30 deletions
diff --git a/Master/texmf-dist/source/latex/hyperref/backref.dtx b/Master/texmf-dist/source/latex/hyperref/backref.dtx index 64016f1fadc..02c5068260d 100644 --- a/Master/texmf-dist/source/latex/hyperref/backref.dtx +++ b/Master/texmf-dist/source/latex/hyperref/backref.dtx @@ -1,7 +1,7 @@ % \iffalse %% File: backref.dtx %% Copyright (C) 1995-2000 David Carlisle, Sebastian Rahtz, Heiko Oberdiek -%% 2001-2010 Heiko Oberdiek +%% 2001-2012 Heiko Oberdiek %% %% This file is part of the `Hyperref Bundle'. %% ------------------------------------------- @@ -29,9 +29,9 @@ %<driver>\ProvidesFile{backref.drv} % \fi % \ProvidesFile{backref.dtx} - [2010/08/30 v1.36 Bibliographical back referencing]% + [2012/07/25 v1.38 Bibliographical back referencing]% % -% \CheckSum{747} +% \CheckSum{768} % % \iffalse %<*driver> @@ -72,6 +72,18 @@ % % \subsection{Options} % +% The supported options are given as package options. +% Few options (e.g. |verbose|, |enable|, |disable|) +% can be changed after the package is loaded by +% the macro \cs{backrefsetup}, e.g.: +% \begin{quote} +%\begin{verbatim} +%\usepackage[verbose]{backref} +%\backrefsetup{verbose=false} +%\end{verbatim} +% \end{quote} +% This macro is available since version 2012/07/24 v1.37. +% % \subsubsection{Options for type of back references} % % In short the following options set the type of back @@ -111,6 +123,24 @@ % |spanish|, and |brazil| (|brazilian|). % Default is |english|. % +% \subsubsection{Other options} +% +% \begin{description} +% \item[|verbose|:] +% A message is written into the |.aux| file for each +% reference that is found for back citing. +% \item[|enable|, |disable|:] +% If a citation should not be back cited, then +% the recording can be turned off by option |disable| +% and enabled again afterwards, e.g.: +% \begin{quote} +%\begin{verbatim} +%\bookmarksetup{disable}\cite{...}\bookmarksetup{enable} +%\end{verbatim} +% \end{quote} +% Both options are added in version 2012/07/24 v1.37. +% \end{description} +% % \subsection{Detecting the end of a bibliography entry} % % Package |backref| has to be able to detect the end of an entry @@ -264,17 +294,32 @@ % % \subsection{Options} % +% \begin{macrocode} +\RequirePackage{kvoptions}[2011/06/30] +\RequirePackage{kvsetkeys}[2009/07/30] +\RequirePackage{ltxcmds}[2009/12/12] +\SetupKeyvalOptions{% + family=backref,% + prefix=BR@,% +} +% \end{macrocode} +% \begin{macro}{\backrefsetup} +% \begin{macrocode} +\newcommand*{\backrefsetup}{\kvsetkeys{backref}} +% \end{macrocode} +% \end{macro} +% % \subsubsection{Option verbose} % If package hyperref is loaded, then its setting is used as % default for the verbose switch. % \begin{macrocode} -\newif\ifBR@verbose -\@ifundefined{ifHy@verbose}{% - \BR@verbosefalse -}{% - \let\ifBR@verbose\ifHy@verbose -} -\DeclareOption{verbose}{\BR@verbosetrue} +\DeclareBoolOption[% + \ltx@ifundefined{ifHy@verbose}{% + false% + }{% + \ifx\ifHy@verbose\iftrue true\else false\fi + }% +]{verbose} % \end{macrocode} % % \subsubsection{Options for way of working} @@ -290,24 +335,30 @@ % Now the options follows, that can be used without % package hyperref. % \begin{macrocode} -\DeclareOption{pageref}{% +\DeclareVoidOption{pageref}{% \def\backref{\backrefpagesname\ }% \let\backrefxxx\page@backref } -\DeclareOption{ref}{% +\DeclareVoidOption{ref}{% \def\backref{\backrefsectionsname\ }% \let\backrefxxx\section@backref } % \end{macrocode} % Set up back-referencing to be hyper links, by page or section. % \begin{macrocode} -\DeclareOption{hyperref}{% +\DeclareVoidOption{hyperref}{% \def\backref{}\let\backrefxxx\hyper@section@backref } -\DeclareOption{hyperpageref}{% +\DeclareVoidOption{hyperpageref}{% \def\backref{}\let\backrefxxx\hyper@page@backref } % \end{macrocode} +% Recording the back references in the auxiliary file can +% be enabled and disabled by the following options. +% \begin{macrocode} +\DeclareBoolOption[true]{enable} +\DeclareComplementaryOption{disable}{enable} +% \end{macrocode} % % \subsubsection{Language options} % @@ -382,7 +433,7 @@ \errmessage{No definitions for language `#2' found!}% \noexpand\fi \endgroup - \noexpand\DeclareOption{#1}{% + \noexpand\DeclareVoidOption{#1}{% \noexpand\BR@addto{\noexpand##1}{\noexpand##2}% }% }% @@ -419,8 +470,25 @@ % \subsubsection{Process options} % % \begin{macrocode} -\ExecuteOptions{pageref} -\ProcessOptions*\relax +\backrefsetup{pageref} +\ProcessKeyvalOptions* +% \end{macrocode} +% +% \begin{macro}{\BR@DisableOption} +% \begin{macrocode} +\def\BR@DisableOption#1{% + \DisableKeyvalOption[% + action=warning,% + package=backref,% + ]{backref}{#1}% +} +% \end{macrocode} +% \end{macro} +% \begin{macrocode} +\BR@DisableOption{ref} +\BR@DisableOption{pageref} +\BR@DisableOption{hyperref} +\BR@DisableOption{hyperpageref} % \end{macrocode} % % \subsection{The bibliography} @@ -798,9 +866,6 @@ % \begin{macrocode} \def\BR@citex[#1]#2{% \BRorg@citex[{#1}]{#2}% - \ifBR@verbose - \PackageInfo{backref}{back cite \string`#2\string'}% - \fi \Hy@backout{#2}% } % \end{macrocode} @@ -820,18 +885,27 @@ % \begin{macrocode} \def\Hy@backout#1{% \@bsphack - \ifx\@empty\@currentlabel - \protected@write\@auxout{}{% - \string\@writefile{brf}{% - \string\backcite{#1}{{\thepage}{(document)}{Doc-Start}}% + \ifBR@enable + \ifBR@verbose + \PackageInfo{backref}{Back cite \string`#1\string'}% + \fi + \ifx\@empty\@currentlabel + \protected@write\@auxout{}{% + \string\@writefile{brf}{% + \string\backcite{#1}{{\thepage}{(document)}{Doc-Start}}% + }% }% - }% - \else - \protected@write\@auxout{}{% - \string\@writefile{brf}{% - \string\backcite{#1}{{\thepage}{\@currentlabel}{\@currentHref}}% + \else + \protected@write\@auxout{}{% + \string\@writefile{brf}{% + \string\backcite{#1}{{\thepage}{\@currentlabel}{\@currentHref}}% + }% }% - }% + \fi + \else + \ifBR@verbose + \PackageInfo{backref}{Disabled back cite \string`#1\string'}% + \fi \fi \@esphack } |