1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175
|
%%
%% This is file `nameref.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% nameref.dtx (with options: `package')
%%
\def\filedate{1999/02/17}
\def\fileversion{2.11}
%% This package may be distributed under the terms of the LaTeX Project Public
%% License, as described in lppl.txt in the base LaTeX distribution.
%% Either version 1.0 or, at your option, any later version.
\ProvidesPackage{nameref}[\filedate\space Cross-referencing by name of section]
\def\strip@period#1.\relax#2\@@@{#1}
\def\label#1{%
\@bsphack
\bgroup
\let\label\@gobble
\def\ref{\protect\ref}%
\edef\@currentlabstr{\expandafter\strip@prefix\meaning\@currentlabelname}%
\protected@write\@auxout{}%
{\string\newlabel{#1}{%
{\@currentlabel}%
{\thepage}%
{\expandafter\strip@period\@currentlabstr\relax.\relax\@@@}%
{\@currentHref}{}%
}}%
\egroup
\@esphack
}
\let\ltx@label\label
\@ifundefined{slabel}{}{%
\def\slabel#1{%
\@bsphack
\if@filesw
{\let\label\@gobble
\def\ref{\protect\ref}%
\edef\@currentlabstr{\expandafter\strip@prefix\meaning\@currentlabelname}%
\let\thepage\relax
\def\protect{\noexpand\noexpand\noexpand}%
\edef\@tempa{\write\@auxout{\string
\newlabel{#1}{%
{\thesubequation}%
{\thepage}%
{\expandafter\strip@period\@currentlabstr\relax.\relax\@@@}%
{\@currentHref}{}%
}}}%
\expandafter}\@tempa
\if@nobreak \ifvmode\nobreak\fi\fi
\fi\@esphack}}
\def\@writetocindents@{%
\begingroup
\@for\@tempa:=-1,0,1,2,3\do{%
\immediate\write\@auxout{%
\string\newlabel{tocindent\@tempa}{%
\csname r@tocindent\@tempa\endcsname{}{}{}{}}}%
}%
\endgroup}
\let\old@sect\@sect
\def\@sect#1#2#3#4#5#6[#7]#8{%
\def\@currentlabelname{#7}%
\old@sect{#1}{#2}{#3}{#4}{#5}{#6}[{#7}]{\protect\Sectionformat{#8}{#2}}%
}
\let\old@ssect\@ssect
\def\@ssect#1#2#3#4#5{%
\def\@currentlabelname{#5}%
\old@ssect{#1}{#2}{#3}{#4}{\Sectionformat{#5}{#1}}%
}
\let\old@part\@part
\def\@part[#1]#2{%
\def\@currentlabelname{#1}%
\old@part[{#1}]{#2}%
}
\let\old@chapter\@chapter
\def\@chapter[#1]#2{%
\def\@currentlabelname{#1}%
\old@chapter[{#1}]{#2}%
}
\let\old@schapter\@schapter
\def\@schapter#1{%
\def\@currentlabelname{#1}%
\old@schapter{#1}%
}
\def\@currentlabelname{}
\def\@currentHref{}
\long\def\@firstoffive#1#2#3#4#5{#1}
\long\def\@secondoffive#1#2#3#4#5{#2}
\long\def\@thirdoffive#1#2#3#4#5{#3}
\long\def\@fourthoffive#1#2#3#4#5{#4}
\long\def\@fifthoffive#1#2#3#4#5{#5}
\def\T@ref#1{\expandafter\@setref\csname r@#1\endcsname\@firstoffive{#1}}
\def\T@pageref#1{\expandafter\@setref\csname r@#1\endcsname
\@secondoffive{#1}}
\def\ref{\protect\T@ref}
\def\pageref{\protect\T@pageref}
\def\T@nameref#1{\expandafter\@setref\csname r@#1\endcsname
\@thirdoffive{#1}}
\def\nameref{\protect\T@nameref}
\def\Nameref#1{`\nameref{#1}' on page~\pageref{#1}}
\def\Sectionformat#1#2{#1}
\ifx\csname @@vpageref\endcsname\relax\else
\def\@@vpageref#1[#2]#3{%
\leavevmode\unskip
\global\advance\c@vrcnt\@ne
\@ifundefined{r@\the\c@vrcnt @vr}%
{\@namedef{r@\the\c@vrcnt @vr}{{??}{??}{??}{??}{??}}}{}%
\edef\@tempa{\expandafter\expandafter\expandafter
\@secondoffive\csname r@\the\c@vrcnt @vr\endcsname}%
\@ifundefined{r@\the\c@vrcnt @xvr}%
{\@namedef{r@\the\c@vrcnt @xvr}{{??}{??}{??}{??}{??}}}{}%
\edef\@tempb{\expandafter\expandafter\expandafter
\@secondoffive\csname r@\the\c@vrcnt @xvr\endcsname}%
{\let\@currentlabel\@empty
\expandafter\label\expandafter{\the\c@vrcnt @xvr}}%
\ifx\@tempa\@tempb\else
\vref@err{\noexpand\vref at page boundary
\@tempb-\@tempa\space (may loop)%
}%
\fi
\@ifundefined{r@#3}{\@namedef{r@#3}{{??}{??}{??}{??}{??}}}{}%
\edef\@tempb{\expandafter\expandafter\expandafter
\@secondoffive\csname r@#3\endcsname}%
\space
\ifx\@tempa\@tempb
#1%
\else
#2%
\is@pos@number\@tempb
{%
\is@pos@number\@tempa
{\@tempcnta\@tempa
\advance\@tempcnta\@ne
}%
{\@tempcnta\maxdimen}%
\ifnum \@tempb =\@tempcnta
\ifodd\@tempcnta
\if@twoside
\reftextfaceafter
\else
\reftextafter
\fi
\else
\reftextafter
\fi
\else
\advance\@tempcnta-2
\ifnum \@tempb =\@tempcnta
\ifodd\@tempcnta
\reftextbefore
\else
\if@twoside
\reftextfacebefore
\else
\reftextbefore
\fi
\fi
\else
\reftextfaraway{#3}%
\fi
\fi
}%
{\reftextfaraway{#3}}%
\fi
{\let\@currentlabel\@empty
\expandafter\label\expandafter{\the\c@vrcnt @vr}}%
}%
\DeclareRobustCommand\vnameref[1]{%
\unskip~\nameref{#1}%
\@vpageref[\unskip]{#1}%
} \fi
\endinput
%%
%% End of file `nameref.sty'.
|