2 %% This is file `nameref.sty',
3 %% generated with the docstrip utility.
5 %% The original source files were:
7 %% nameref.dtx (with options: `package')
9 \def\filedate{2001/01/27}
10 \def\fileversion{2.19}
11 %% This file is part of the `Hyperref Bundle'.
12 %% -------------------------------------------
14 %% It may be distributed under the conditions of the LaTeX Project Public
15 %% License, either version 1.2 of this license or (at your option) any
16 %% later version. The latest version of this license is in
17 %% http://www.latex-project.org/lppl.txt
18 %% and version 1.2 or later is part of all distributions of LaTeX
19 %% version 1999/12/01 or later.
21 %% The list of all files belonging to the `Hyperref Bundle' is
22 %% given in the file `manifest.txt'.
23 \ProvidesPackage{nameref}[\filedate\space v\fileversion
24 \space Cross-referencing by name of section]
25 \def\strip@period#1.\relax#2\@@@{#1}
28 \@ifpackageloaded{showkeys}{%
30 \@ifundefined{SK@@label}{%
32 \global\NR@showkeystrue
40 \def\ref{\protect\ref}%
41 \edef\@currentlabstr{%
42 \expandafter\strip@prefix\meaning\@currentlabelname
44 \protected@write\@auxout{}{%
45 \string\newlabel{#1}{%
48 {\expandafter\strip@period\@currentlabstr\relax.\relax\@@@}%
61 \def\ref{\protect\ref}%
62 \edef\@currentlabstr{%
63 \expandafter\strip@prefix\meaning\@currentlabelname
65 \protected@write\@auxout{}{%
66 \string\newlabel{#1}{%
69 {\expandafter\strip@period\@currentlabstr\relax.\relax\@@@}%
78 \@ifundefined{slabel}{}{%
84 \def\ref{\protect\ref}%
85 \edef\@currentlabstr{%
86 \expandafter\strip@prefix\meaning\@currentlabelname
89 \def\protect{\noexpand\noexpand\noexpand}%
92 \string\newlabel{#1}{%
95 {\expandafter\strip@period
96 \@currentlabstr\relax.\relax\@@@}%
104 \if@nobreak\ifvmode\nobreak\fi\fi
109 \def\@writetocindents@{%
111 \@for\@tempa:=-1,0,1,2,3\do{%
112 \immediate\write\@auxout{%
113 \string\newlabel{tocindent\@tempa}{%
114 \csname r@tocindent\@tempa\endcsname{}{}{}{}%
120 \newcounter{section@level}
121 \def\@sect#1#2#3#4#5#6[#7]#8{%
122 \setcounter{section@level}{#2}%
123 \def\@currentlabelname{#7}%
124 \NR@sect{#1}{#2}{#3}{#4}{#5}{#6}[{#7}]{\Sectionformat{#8}{#2}}%
127 \def\@ssect#1#2#3#4#5{%
128 \def\@currentlabelname{#5}%
129 \NR@ssect{#1}{#2}{#3}{#4}{\Sectionformat{#5}{#1}}%
133 \def\@currentlabelname{#1}%
136 \let\NR@chapter\@chapter
137 \def\@chapter[#1]#2{%
138 \def\@currentlabelname{#1}%
139 \NR@chapter[{#1}]{#2}%
141 \let\NR@schapter\@schapter
143 \def\@currentlabelname{#1}%
146 \def\@currentlabelname{}
148 \long\def\@firstoffive#1#2#3#4#5{#1}
149 \long\def\@secondoffive#1#2#3#4#5{#2}
150 \long\def\@thirdoffive#1#2#3#4#5{#3}
151 \long\def\@fourthoffive#1#2#3#4#5{#4}
152 \long\def\@fifthoffive#1#2#3#4#5{#5}
153 \providecommand*\@safe@activestrue{}%
154 \providecommand*\@safe@activesfalse{}%
157 \expandafter\@setref\csname r@#1\endcsname\@firstoffive{#1}%
162 \expandafter\@setref\csname r@#1\endcsname\@secondoffive{#1}%
171 \expandafter\@setref\csname r@#1\endcsname\@firstoffive{#1}%
177 \expandafter\@setref\csname r@#1\endcsname\@secondoffive{#1}%
182 \providecommand\ref{\protect\T@ref}
183 \providecommand\pageref{\protect\T@pageref}
186 \expandafter\@setref\csname r@#1\endcsname\@thirdoffive{#1}%
195 \expandafter\@setref\csname r@#1\endcsname\@thirdoffive{#1}%
200 \def\nameref{\protect\T@nameref}
201 \def\Nameref#1{`\nameref{#1}' on page~\pageref{#1}}
202 \providecommand\Sectionformat[2]{#1}
203 \ifx\csname @@vpageref\endcsname\relax
205 \def\@@vpageref#1[#2]#3{%
207 \global\advance\c@vrcnt\@ne
208 \@ifundefined{r@\the\c@vrcnt @vr}%
209 {\@namedef{r@\the\c@vrcnt @vr}{{??}{??}{??}{??}{??}}}{}%
211 \expandafter\expandafter\expandafter
212 \@secondoffive\csname r@\the\c@vrcnt @vr\endcsname
214 \@ifundefined{r@\the\c@vrcnt @xvr}%
215 {\@namedef{r@\the\c@vrcnt @xvr}{{??}{??}{??}{??}{??}}}{}%
217 \expandafter\expandafter\expandafter
218 \@secondoffive\csname r@\the\c@vrcnt @xvr\endcsname
221 \let\@currentlabel\@empty
222 \expandafter\label\expandafter{\the\c@vrcnt @xvr}%
227 \noexpand\vref at page boundary
228 \@tempb-\@tempa\space (may loop)%
231 \@ifundefined{r@#3}{\@namedef{r@#3}{{??}{??}{??}{??}{??}}}{}%
233 \expandafter\expandafter\expandafter
234 \@secondoffive\csname r@#3\endcsname
241 \is@pos@number\@tempb{%
242 \is@pos@number\@tempa{%
244 \advance\@tempcnta\@ne
248 \ifnum \@tempb =\@tempcnta
260 \ifnum \@tempb =\@tempcnta
279 \let\@currentlabel\@empty
280 \expandafter\label\expandafter{\the\c@vrcnt @vr}%
283 \DeclareRobustCommand\vnameref[1]{%
284 \unskip~\nameref{#1}%
285 \@vpageref[\unskip]{#1}%
290 %% End of file `nameref.sty'.