summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/hyperref/nameref.dtx
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2009-12-11 01:05:57 +0000
committerKarl Berry <karl@freefriends.org>2009-12-11 01:05:57 +0000
commit01aade3322bbb50b565fbb94ed1bade7a0726478 (patch)
treeb5cb1e9b3bac48d62323860c53dfc42b8f08b387 /Master/texmf-dist/source/latex/hyperref/nameref.dtx
parent927fa25899dff5fa86c4e142b091ab724bceac9c (diff)
hyperref update (10dec09)
git-svn-id: svn://tug.org/texlive/trunk@16351 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/hyperref/nameref.dtx')
-rw-r--r--Master/texmf-dist/source/latex/hyperref/nameref.dtx63
1 files changed, 40 insertions, 23 deletions
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 @@
%<driver>\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}
%