From 01aade3322bbb50b565fbb94ed1bade7a0726478 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Fri, 11 Dec 2009 01:05:57 +0000 Subject: hyperref update (10dec09) git-svn-id: svn://tug.org/texlive/trunk@16351 c570f23f-e606-0410-a88d-b1316a301751 --- .../texmf-dist/source/latex/hyperref/nameref.dtx | 63 ++++++++++++++-------- 1 file changed, 40 insertions(+), 23 deletions(-) (limited to 'Master/texmf-dist/source/latex/hyperref/nameref.dtx') diff --git a/Master/texmf-dist/source/latex/hyperref/nameref.dtx b/Master/texmf-dist/source/latex/hyperref/nameref.dtx index c17b0a301cb..674080c1ea1 100644 --- a/Master/texmf-dist/source/latex/hyperref/nameref.dtx +++ b/Master/texmf-dist/source/latex/hyperref/nameref.dtx @@ -24,9 +24,9 @@ %\ProvidesFile{nameref.drv} % \fi % \ProvidesFile{nameref.dtx} - [2009/12/02 v2.33 Cross-referencing by name of section]% + [2009/12/08 v2.34 Cross-referencing by name of section]% % -% \CheckSum{610} +% \CheckSum{580} % % \iffalse %<*driver> @@ -76,6 +76,30 @@ % September 28th changes by David Carlisle.\\ % More recent changes are recorded in ChangeLog. % +% The versions before 2009/11/27 v2.32 did not expand the +% title strings (of \cs{section}, \cs{caption}, \dots). +% Then the behaviour switched to expanding, because this +% allows to remove unwanted macros (\cs{label}, \dots). +% Despite this method is used in package \textsf{titleref} +% and class \textsf{memoir}, the first feedbacks let me conclude +% that this is not robust enough. Therefore I wrote package +% \textsf{gettitlestring} that uses the non-expanding +% method as default. It also allows me to use this package +% in package \textsf{zref-titleref}. +% See the package documentation of package \textsf{gettitlestring} +% how to change the method. It also provides a hook to remove +% additional unwanted macros, not supported by the package. +% Example: +%\begin{quote} +%\begin{verbatim} +%\usepackage{gettitlestring} +%\GetTitleStringDisableCommands{% +% \let\mylabel\@gobble +% \renewcommand\myindex[2]{}% +%} +%\end{verbatim} +%\end{quote} +% % \section{Implementation} % \begin{macrocode} %<*package> @@ -83,6 +107,7 @@ % % \begin{macrocode} \RequirePackage{refcount}[2006/02/12] +\RequirePackage{gettitlestring}[2009/12/08] % \end{macrocode} % % We redefine |\label| so that it also writes the name of the @@ -213,23 +238,8 @@ % % \begin{macrocode} \def\NR@gettitle#1{% - \def\@currentlabelname{#1}% - \begingroup - \let\label\@gobble - \let\index\@gobble - \let\glossary\@gobble - \let\markboth\@gobbletwo - \let\@mkboth\@gobbletwo - \let\markright\@gobble - \let\protect\@unexpandable@protect - \let\phantomsection\@empty - \def\addcontentsline{\expandafter\@gobble\@gobbletwo}% - \edef\x{\endgroup - \noexpand\def\noexpand\@currentlabelname{% - \@currentlabelname - }% - }% - \x + \GetTitleString{#1}% + \let\@currentlabelname\GetTitleStringResult } % \end{macrocode} % @@ -276,10 +286,17 @@ % Captions % % \begin{macrocode} -\let\NR@@caption\@caption -\long\def\@caption#1[#2]{% - \NR@gettitle{#2}% - \NR@@caption{#1}[{#2}]% +\AtBeginDocument{% + \@ifpackageloaded{hyperref}{% + \@ifpackagelater{hyperref}{2009/12/05}\@gobble\@firstofone + }\@firstofone + {% + \let\NR@@caption\@caption + \long\def\@caption#1[#2]{% + \NR@gettitle{#2}% + \NR@@caption{#1}[{#2}]% + }% + }% } % \end{macrocode} % -- cgit v1.2.3