diff options
Diffstat (limited to 'Master/texmf-dist/source/latex/hyperref/nameref.dtx')
-rw-r--r-- | Master/texmf-dist/source/latex/hyperref/nameref.dtx | 45 |
1 files changed, 32 insertions, 13 deletions
diff --git a/Master/texmf-dist/source/latex/hyperref/nameref.dtx b/Master/texmf-dist/source/latex/hyperref/nameref.dtx index 9ec895bada4..5465afdeb98 100644 --- a/Master/texmf-dist/source/latex/hyperref/nameref.dtx +++ b/Master/texmf-dist/source/latex/hyperref/nameref.dtx @@ -1,7 +1,7 @@ % \iffalse % File: nameref.dtx % Copyright (C) 1995-9 Sebastian Rahtz -% 2000-7 Sebastian Rahtz, Heiko Oberdiek +% 2000-9 Sebastian Rahtz, Heiko Oberdiek % %% This file is part of the `Hyperref Bundle'. %% ------------------------------------------- @@ -24,9 +24,9 @@ %<driver>\ProvidesFile{nameref.drv} % \fi % \ProvidesFile{nameref.dtx} - [2007/05/29 v2.31 Cross-referencing by name of section]% + [2009/11/27 v2.32 Cross-referencing by name of section]% % -% \CheckSum{576} +% \CheckSum{602} % % \iffalse %<*driver> @@ -210,7 +210,26 @@ % % If a section heading or the like has a |\label| in it, % we need to extract it, or subsequent processing breaks. -% This is done by the label-writing routine. +% +% \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 + \edef\x{\endgroup + \noexpand\def\noexpand\@currentlabelname{% + \@currentlabelname + }% + }% + \x +} +% \end{macrocode} % % First the numbered sections. While we are about it, put in % a useful section formatting macro. @@ -219,7 +238,7 @@ \newcounter{section@level} \def\@sect#1#2#3#4#5#6[#7]#8{% \setcounter{section@level}{#2}% - \def\@currentlabelname{#7}% + \NR@gettitle{#7}% \NR@sect{#1}{#2}{#3}{#4}{#5}{#6}[{#7}]{\Sectionformat{#8}{#2}}% } % \end{macrocode} @@ -227,7 +246,7 @@ % \begin{macrocode} \let\NR@ssect\@ssect \def\@ssect#1#2#3#4#5{% - \def\@currentlabelname{#5}% + \NR@gettitle{#5}% \NR@ssect{#1}{#2}{#3}{#4}{\Sectionformat{#5}{#1}}% } % \end{macrocode} @@ -237,17 +256,17 @@ % \begin{macrocode} \let\NR@part\@part \def\@part[#1]#2{% - \def\@currentlabelname{#1}% + \NR@gettitle{#1}% \NR@part[{#1}]{#2}% } \let\NR@chapter\@chapter \def\@chapter[#1]#2{% - \def\@currentlabelname{#1}% + \NR@gettitle{#1}% \NR@chapter[{#1}]{#2}% } \let\NR@schapter\@schapter \def\@schapter#1{% - \def\@currentlabelname{#1}% + \NR@gettitle{#1}% \NR@schapter{#1}% } % \end{macrocode} @@ -257,7 +276,7 @@ % \begin{macrocode} \let\NR@@caption\@caption \long\def\@caption#1[#2]{% - \def\@currentlabelname{#2}% + \NR@gettitle{#2}% \NR@@caption{#1}[{#2}]% } % \end{macrocode} @@ -271,7 +290,7 @@ \def\@tempa{#2}% \ifx\@tempa\@empty \else - \def\@currentlabelname{#2}% + \NR@gettitle{#2}% \fi }% }{}% @@ -284,7 +303,7 @@ \@ifpackageloaded{titlesec}{% \let\NRorg@ttl@sect@i\ttl@sect@i \def\ttl@sect@i#1#2[#3]#4{% - \def\@currentlabelname{#4}% + \NR@gettitle{#4}% \NRorg@ttl@sect@i{#1}{#2}[{#3}]{#4}% }% }{}% @@ -302,7 +321,7 @@ \edef\x{\endgroup \long\def\expandafter\noexpand\csname beamer@#1\endcsname [####1]{% hash-ok - \def\noexpand\@currentlabelname{####1}% + \noexpand\NR@gettitle{####1}% \expandafter\noexpand\csname NRorg@beamer@#1\endcsname [{####1}]% }% |