diff options
author | Karl Berry <karl@freefriends.org> | 2007-06-01 16:58:52 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2007-06-01 16:58:52 +0000 |
commit | 4d027ddb699c57025992eccbdd3cef0ec2836ee1 (patch) | |
tree | 7c9a8e252aa5133aa4c986aa37af12b8484ec44b /Master/texmf-dist/source/latex/hyperref/nameref.dtx | |
parent | ab8a652a0280de02179bbbdd79296f2bbd4073f7 (diff) |
hyperref update (30may07)
git-svn-id: svn://tug.org/texlive/trunk@4399 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/hyperref/nameref.dtx')
-rw-r--r-- | Master/texmf-dist/source/latex/hyperref/nameref.dtx | 261 |
1 files changed, 179 insertions, 82 deletions
diff --git a/Master/texmf-dist/source/latex/hyperref/nameref.dtx b/Master/texmf-dist/source/latex/hyperref/nameref.dtx index bb61b32ee3b..891bd49257a 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-6 Sebastian Rahtz, Heiko Oberdiek +% 2000-7 Sebastian Rahtz, Heiko Oberdiek % %% This file is part of the `Hyperref Bundle'. %% ------------------------------------------- @@ -24,35 +24,35 @@ %<driver>\ProvidesFile{nameref.drv} % \fi % \ProvidesFile{nameref.dtx} - [2006/12/27 v2.28 Cross-referencing by name of section] + [2007/05/29 v2.31 Cross-referencing by name of section]% % -% \CheckSum{473} +% \CheckSum{576} % % \iffalse %<*driver> \documentclass{ltxdoc} -\IfFileExists{bmhydoc.sty}{\usepackage{bmhydoc}}{} \usepackage[numbered]{hypdoc} +\usepackage{bmhydoc} \EnableCrossrefs \CodelineIndex \begin{document} - \GetFileInfo{nameref.sty} + \GetFileInfo{nameref.sty}% \title{% Section name references in \LaTeX \thanks{% - This file has version number \fileversion, + This file has version number \fileversion, % last revised \filedate.% }% - } - \author{Sebastian Rahtz} - \date{\filedate} + }% + \author{Sebastian Rahtz}% + \date{\filedate}% \maketitle \makeatletter \@ifundefined{HyperrefOverview}{}{% \HyperrefOverview*% }% \tableofcontents - \DocInput{nameref.dtx} + \DocInput{nameref.dtx}% \PrintIndex \end{document} %</driver> @@ -199,7 +199,8 @@ }% }% }% - \endgroup} + \endgroup +} % \end{macrocode} % % \subsection{Changes of section macros} @@ -261,6 +262,22 @@ } % \end{macrocode} % +% \begin{macrocode} +\AtBeginDocument{% + \@ifpackageloaded{longtable}{% + \let\NRorg@LT@c@ption\LT@c@ption + \def\LT@c@ption#1[#2]#3{% + \NRorg@LT@c@ption{#1}[{#2}]{#3}% + \def\@tempa{#2}% + \ifx\@tempa\@empty + \else + \def\@currentlabelname{#2}% + \fi + }% + }{}% +} +% \end{macrocode} +% % Compatibility for package titlesec. % \begin{macrocode} \AtBeginDocument{% @@ -274,6 +291,28 @@ } % \end{macrocode} % +% \subsubsection{Class beamer} +% +% \begin{macrocode} +\@ifclassloaded{beamer}{% + \def\NR@PatchBeamer#1{% + \expandafter\let\csname NRorg@beamer@#1\expandafter\endcsname + \csname beamer@#1\endcsname + \begingroup + \edef\x{\endgroup + \long\def\expandafter\noexpand\csname beamer@#1\endcsname[####1]{% + \def\noexpand\@currentlabelname{####1}% + \expandafter\noexpand\csname NRorg@beamer@#1\endcsname[{####1}]% + }% + }% + \x + }% + \NR@PatchBeamer{section}% + \NR@PatchBeamer{subsection}% + \NR@PatchBeamer{subsubsection}% +}{} +% \end{macrocode} +% % \subsection{Referencing stuff} % % We default the label and hypertext reference to be empty. @@ -417,91 +456,149 @@ % [This section was derived by Corey Minyard \texttt{minyard@acm.org} % from the varioref package] % \begin{macrocode} -\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}% +\AtBeginDocument{% + \ifx\csname @@vpageref\endcsname\relax + \else + \def\@@vpageref#1[#2]#3{% + \begingroup + \csname @safe@activestrue\endcsname + \edef\x{#3}% + \@onelevel@sanitize\x + \toks@{% + \NR@@vpageref{#1}[{#2}]% + }% + \edef\x{\endgroup + \the\toks@{\x}% + }% + \x }% - \ifx\@tempa\@tempb - \else - \vref@err{% - \noexpand\vref at page boundary - \@tempb-\@tempa\space (may loop)% + \def\NR@@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 }% - \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 + \@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)% }% - \ifnum \@tempb =\@tempcnta - \ifodd\@tempcnta - \if@twoside - \reftextfaceafter + \fi + \@ifundefined{r@#3}{\@namedef{r@#3}{{??}{??}{}{}{}}}{}% + \edef\thevpagerefnum{% + \expandafter\expandafter\expandafter + \@secondoffive\csname r@#3\endcsname + }% + \ifx\vref@space\@undefined + \space + \else + \vref@space + \fi + \ifx\@tempa\thevpagerefnum + #1% + \else + #2% + \is@pos@number\thevpagerefnum{% + \is@pos@number\@tempa{% + \@tempcnta\@tempa + \advance\@tempcnta\@ne + }{% + \@tempcnta\maxdimen + }% + \ifnum \thevpagerefnum =\@tempcnta + \ifodd\@tempcnta + \if@twoside + \reftextfaceafter + \else + \reftextafter + \fi \else \reftextafter \fi \else - \reftextafter - \fi - \else - \advance\@tempcnta-2 - \ifnum \@tempb =\@tempcnta - \ifodd\@tempcnta - \reftextbefore - \else - \if@twoside - \reftextfacebefore - \else + \advance\@tempcnta-2 % + \ifnum \thevpagerefnum =\@tempcnta + \ifodd\@tempcnta \reftextbefore + \else + \if@twoside + \reftextfacebefore + \else + \reftextbefore + \fi \fi + \else + \reftextfaraway{#3}% \fi - \else - \reftextfaraway{#3}% \fi - \fi - }{% - \reftextfaraway{#3}% + }{% + \reftextfaraway{#3}% + }% + \fi + {% + \let\@currentlabel\@empty + \expandafter\label\expandafter{\the\c@vrcnt @vr}% }% - \fi - {% - \let\@currentlabel\@empty - \expandafter\label\expandafter{\the\c@vrcnt @vr}% }% + \DeclareRobustCommand\vnameref[1]{% + \unskip~\nameref{#1}% + \@vpageref[\unskip]{#1}% + }% + \fi +} +% \end{macrocode} +% \begin{macrocode} +\@ifundefined{@Refstar}{% + \def\T@Ref#1{% + \NR@setref{#1}\NR@MakeUppercaseFirstOfFive{#1}% }% - \DeclareRobustCommand\vnameref[1]{% - \unskip~\nameref{#1}% - \@vpageref[\unskip]{#1}% - } -\fi + \def\NR@MakeUppercaseFirstOfFive#1#2#3#4#5{% + \MakeUppercase#1% + }% +}{}% +\AtBeginDocument{% + \@ifpackageloaded{varioref}{% + \@ifundefined{@Refstar}{% + \DeclareRobustCommand*{\Ref}[1]{% + \T@Ref{#1}% + }% + }{}% + }{}% +}% +% \end{macrocode} +% +% \subsection{Support for listings} +% +% \begin{macrocode} +\AtBeginDocument{% + \@ifpackageloaded{listings}{% + \let\NROrg@lst@MakeCaption\lst@MakeCaption + \def\lst@MakeCaption{% + \ifx\lst@label\@empty + \else + \let\@currentlabelname\lst@@caption + \fi + \NROrg@lst@MakeCaption + }% + }{}% +} +% \end{macrocode} +% +% \begin{macrocode} %</package> % \end{macrocode} % |