summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/hyperref/nameref.sty
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2006-08-20 00:16:44 +0000
committerKarl Berry <karl@freefriends.org>2006-08-20 00:16:44 +0000
commit81e85f9bb5875b6c3cd460112e26e715d8965004 (patch)
tree080f756dab293c38187e2cc6cde199e717f57433 /Master/texmf-dist/tex/latex/hyperref/nameref.sty
parent4cdec44e9893db7879eb9f2f34cfcbe52072abd0 (diff)
hyperref 6.75a (1aug06)
git-svn-id: svn://tug.org/texlive/trunk@1993 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.sty58
1 files changed, 42 insertions, 16 deletions
diff --git a/Master/texmf-dist/tex/latex/hyperref/nameref.sty b/Master/texmf-dist/tex/latex/hyperref/nameref.sty
index 4cde86550c5..55270920da3 100644
--- a/Master/texmf-dist/tex/latex/hyperref/nameref.sty
+++ b/Master/texmf-dist/tex/latex/hyperref/nameref.sty
@@ -6,8 +6,6 @@
%%
%% nameref.dtx (with options: `package')
%%
-\def\filedate{2003/12/03}
-\def\fileversion{2.21}
%% This file is part of the `Hyperref Bundle'.
%% -------------------------------------------
%%
@@ -20,8 +18,10 @@
%%
%% The list of all files belonging to the `Hyperref Bundle' is
%% given in the file `manifest.txt'.
-\ProvidesPackage{nameref}[\filedate\space v\fileversion
- \space Cross-referencing by name of section]
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{nameref}
+ [2006/08/15 v2.26 Cross-referencing by name of section]
+\RequirePackage{refcount}[2006/02/12]
\def\strip@period#1.\relax#2\@@@{#1}
\newif\ifNR@showkeys
\NR@showkeysfalse
@@ -143,6 +143,11 @@
\def\@currentlabelname{#1}%
\NR@schapter{#1}%
}
+\let\NR@@caption\@caption
+\long\def\@caption#1[#2]{%
+ \def\@currentlabelname{#2}%
+ \NR@@caption{#1}[{#2}]%
+}
\AtBeginDocument{%
\@ifpackageloaded{titlesec}{%
\let\NRorg@ttl@sect@i\ttl@sect@i
@@ -161,15 +166,24 @@
\long\def\@fifthoffive#1#2#3#4#5{#5}
\providecommand*\@safe@activestrue{}%
\providecommand*\@safe@activesfalse{}%
+\def\NR@setref#1{%
+ \begingroup
+ \@safe@activestrue
+ \expandafter
+ \endgroup
+ \expandafter\NR@@setref\csname r@#1\endcsname
+}
+\def\NR@@setref#1{%
+ \ifx\@undefined#1%
+ \let#1\relax
+ \fi
+ \@setref#1%
+}
\def\T@ref#1{%
- \@safe@activestrue
- \expandafter\@setref\csname r@#1\endcsname\@firstoffive{#1}%
- \@safe@activesfalse
+ \NR@setref{#1}\@firstoffive{#1}%
}%
\def\T@pageref#1{%
- \@safe@activestrue
- \expandafter\@setref\csname r@#1\endcsname\@secondoffive{#1}%
- \@safe@activesfalse
+ \NR@setref{#1}\@secondoffive{#1}%
}%
\ifNR@showkeys
\ifx\SK@ref\@empty
@@ -177,14 +191,14 @@
\def\T@ref#1{%
\@safe@activestrue
\SK@\SK@@ref{#1}%
- \expandafter\@setref\csname r@#1\endcsname\@firstoffive{#1}%
\@safe@activesfalse
+ \NR@setref{#1}\@firstoffive{#1}%
}%
\def\T@pageref#1{%
\@safe@activestrue
\SK@\SK@@ref{#1}%
- \expandafter\@setref\csname r@#1\endcsname\@secondoffive{#1}%
\@safe@activesfalse
+ \NR@setref{#1}\@secondoffive{#1}%
}%
\fi
\fi
@@ -194,9 +208,7 @@
\DeclareRobustCommand{\pageref}{\T@pageref}%
}
\def\T@nameref#1{%
- \@safe@activestrue
- \expandafter\@setref\csname r@#1\endcsname\@thirdoffive{#1}%
- \@safe@activesfalse
+ \NR@setref{#1}\@thirdoffive{#1}%
}%
\ifNR@showkeys
\ifx\SK@ref\@empty
@@ -204,14 +216,28 @@
\def\T@nameref#1{%
\@safe@activestrue
\SK@\SK@@ref{#1}%
- \expandafter\@setref\csname r@#1\endcsname\@thirdoffive{#1}%
\@safe@activesfalse
+ \NR@setref{#1}\@thirdoffive{#1}%
}%
\fi
\fi
\def\nameref{\protect\T@nameref}
\def\Nameref#1{`\nameref{#1}' on page~\pageref{#1}}
\providecommand\Sectionformat[2]{#1}
+\@ifpackageloaded{ifthen}{%
+ \let\NROrg@ifthenelse\ifthenelse
+ \def\ifthenelse{%
+ \let\begingroup\NR@TE@begingroup
+ \NROrg@ifthenelse
+ }%
+ \let\NROrg@begingroup\begingroup
+ \def\NR@TE@begingroup{%
+ \let\begingroup\NROrg@begingroup
+ \begingroup
+ \def\ref##1{\getrefbykeydefault{##1}{}{??}}%
+ \def\pageref##1{\getrefbykeydefault{##1}{page}{0}}%
+ }%
+}{}
\ifx\csname @@vpageref\endcsname\relax
\else
\def\@@vpageref#1[#2]#3{%