diff options
author | Karl Berry <karl@freefriends.org> | 2012-07-29 22:04:20 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2012-07-29 22:04:20 +0000 |
commit | fe32258562977401195cca3076b1e37bdf9c836a (patch) | |
tree | 70bfa31f28ef339f5dd2650b73a1b46e7747c3ce /Master/texmf-dist/tex/latex/hyperref/nameref.sty | |
parent | 70467f28c321a6700620dd5b77fba19e158047a8 (diff) |
hyperref
git-svn-id: svn://tug.org/texlive/trunk@27238 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/hyperref/nameref.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/hyperref/nameref.sty | 40 |
1 files changed, 22 insertions, 18 deletions
diff --git a/Master/texmf-dist/tex/latex/hyperref/nameref.sty b/Master/texmf-dist/tex/latex/hyperref/nameref.sty index 57eb9464ec9..0cb76115da7 100644 --- a/Master/texmf-dist/tex/latex/hyperref/nameref.sty +++ b/Master/texmf-dist/tex/latex/hyperref/nameref.sty @@ -9,7 +9,7 @@ %% File: nameref.dtx %% Copyright (C) 1995-1999 Sebastian Rahtz %% 2000 Sebastian Rahtz, Heiko Oberdiek -%% 2001-2010 Heiko Oberdiek +%% 2001-2012 Heiko Oberdiek %% %% This file is part of the `Hyperref Bundle'. %% ------------------------------------------- @@ -30,11 +30,18 @@ %% given in the file `manifest.txt'. \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{nameref} - [2010/04/30 v2.40 Cross-referencing by name of section]% + [2012/07/28 v2.41 Cross-referencing by name of section]% \RequirePackage{refcount}[2006/02/12] \RequirePackage{gettitlestring}[2009/12/18] \RequirePackage{ltxcmds}[2009/12/12] -\def\strip@period#1.\relax#2\@@@{#1} +\def\NR@strip@period#1.\ltx@empty#2\@nil{#1} +\def\NR@sanitize@labelname{% + \@onelevel@sanitize\@currentlabelname + \edef\@currentlabelname{% + \expandafter\NR@strip@period\@currentlabelname + \ltx@empty.\ltx@empty\@nil + }% +} \newif\ifNR@showkeys \NR@showkeysfalse \@ifpackageloaded{showkeys}{% @@ -45,13 +52,15 @@ }% \endgroup }{} +\providecommand*{\label@hook}{} +\ltx@GlobalAppendToMacro{\label@hook}{% + \NR@sanitize@labelname +} \def\label#1{% \@bsphack \begingroup - \@onelevel@sanitize\@currentlabelname - \edef\@currentlabelname{% - \expandafter\strip@period\@currentlabelname\relax.\relax\@@@% - }% + \def\label@name{#1}% + \label@hook \protected@write\@auxout{}{% \string\newlabel{#1}{% {\@currentlabel}% @@ -68,10 +77,8 @@ \@bsphack \SK@\SK@@label{#1}% \begingroup - \@onelevel@sanitize\@currentlabelname - \edef\@currentlabelname{% - \expandafter\strip@period\@currentlabelname\relax.\relax\@@@% - }% + \def\label@name{#1}% + \label@hook \protected@write\@auxout{}{% \string\newlabel{#1}{% {\@currentlabel}% @@ -89,11 +96,9 @@ \def\slabel#1{% \@bsphack \if@filesw - {% - \@onelevel@sanitize\@currentlabelname - \edef\@currentlabelname{% - \expandafter\strip@period\@currentlabelname\relax.\relax\@@@% - }% + \begingroup + \def\label@name{#1}% + \label@hook \let\thepage\relax \def\protect{\noexpand\noexpand\noexpand}% \edef\@tempa{% @@ -106,8 +111,7 @@ }% }% }% - \expandafter - }% + \expandafter\endgroup \@tempa \if@nobreak\ifvmode\nobreak\fi\fi \fi |