diff options
Diffstat (limited to 'Master/texmf-dist/tex/generic/tex4ht/hyperref.4ht')
-rw-r--r-- | Master/texmf-dist/tex/generic/tex4ht/hyperref.4ht | 190 |
1 files changed, 124 insertions, 66 deletions
diff --git a/Master/texmf-dist/tex/generic/tex4ht/hyperref.4ht b/Master/texmf-dist/tex/generic/tex4ht/hyperref.4ht index 34b2d499832..5571954fa57 100644 --- a/Master/texmf-dist/tex/generic/tex4ht/hyperref.4ht +++ b/Master/texmf-dist/tex/generic/tex4ht/hyperref.4ht @@ -1,6 +1,6 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% hyperref.4ht 2008-09-16-11:44 % -% Copyright (C) 1999--2008 Eitan M. Gurari % +% hyperref.4ht 2009-04-14-17:07 % +% Copyright (C) 1999--2009 Eitan M. Gurari % % % % This work may be distributed and/or modified under the % % conditions of the LaTeX Project Public License, either % @@ -24,7 +24,7 @@ % gurari@cse.ohio-state.edu % % http://www.cse.ohio-state.edu/~gurari % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\immediate\write-1{version 2008-09-16-11:44} +\immediate\write-1{version 2009-04-14-17:07} \csname end:hyperref\endcsname \@ifpackageloaded{nameref}{} @@ -48,21 +48,6 @@ \csname Hy@texhttrue\endcsname \fi -\expandafter\ifx \csname ifhy@texht\endcsname\relax - \ifx \pdf@bbox\:UnDef - \pend:defIII\@setref{\edef\RefArg{##3}} -\append:defIII\@setref{\let\:autoref\:gobble} -\AtBeginDocument{% - \edef\autoref{\noexpand\protect\expandafter\noexpand - \csname autoref \endcsname}} -\expandafter\def\csname autoref \endcsname{% - \@ifstar {\HyRef@autoref \@gobbletwo }{\HyRef@autoref \hyper@@link}} -\def\HyRef@autoref#1#2{% - \begingroup - \Hy@safe@activestrue - \expandafter\auto@setref \csname r@#2\endcsname \@firstoffive {#2}% - \endgroup -} \def\auto@setref#1#2#3{\@safe@activestrue \let\:autoref\::autoref \T@ref{#3}\@safe@activesfalse} @@ -109,39 +94,130 @@ \let\real@setref\@setref \fi -\let\:autoref\:gobble - \else - \let\:temp\real@setref -\let\real@setref\ref -\let\ref\o:ref -\let\o:ref\:temp +\DeclareRobustCommand*{\autoref}{% + \@ifstar{\HyRef@autoref\@gobbletwo}{\HyRef@autoref\hyper@@link}% +} +\def\HyRef@autoref#1#2{% + \begingroup + \Hy@safe@activestrue + \expandafter\HyRef@autosetref\csname r@#2\endcsname{#2}{#1}% + \endgroup +} -\let\end:hyperref\endinput -\pend:defIII\@setref{\edef\RefArg{##3}} -\append:defIII\@setref{\let\:autoref\:gobble +\DeclareRobustCommand*{\autopageref}{% + \@ifstar{% + \HyRef@autopagerefname\pageref*% + }\HyRef@autopageref +} +\def\HyRef@autopageref#1{% + \hyperref[{#1}]{\HyRef@autopagerefname\pageref*{#1}}% +} +\def\HyRef@autopagerefname{% + \@ifundefined{pageautorefname}{% + \@ifundefined{pagename}{% + \Hy@Warning{No autoref name for `page'}% + }{% + \pagename\nobreakspace + }% + }{% + \pageautorefname\nobreakspace + }% } - \fi -\else - \ifx \real@setref\:UnDef \else \let\o:ref\real@setref \fi -\let\r:ref\ref -\def\:refstar#1{\r:ref} -\def\real@setref{\@ifnextchar*{\:refstar}{\r:ref}} -\DeclareRobustCommand\ref{\@ifnextchar*{\@refstar}{\real@setref}} -\def\@refstar{\real@setref} -\def\@pagerefstar#1{% - \@safe@activestrue - \expandafter\@setref\csname r@#1\endcsname \@secondoftwo{#1}% - \@safe@activesfalse +\def\HyRef@autosetref#1#2#3{% link command, csname, refname + \HyRef@ShowKeysRef{#2}% + \ifcase 0\ifx#1\relax 1\fi\ifx#1\Hy@varioref@undefined 1\fi\relax + \edef\HyRef@thisref{% + \expandafter\@fourthoffive#1\@empty\@empty\@empty + }% + \expandafter\HyRef@testreftype\HyRef@thisref.\\% + \Hy@safe@activesfalse + #3{% + \expandafter\@fifthoffive#1\@empty\@empty\@empty + }{% + \expandafter\@fourthoffive#1\@empty\@empty\@empty + }{% + \HyRef@currentHtag + \expandafter\@firstoffive#1\@empty\@empty\@empty + \null + }% + \else + \protect\G@refundefinedtrue + \nfss@text{\reset@font\bfseries ??}% + \@latex@warning{% + Reference `#2' on page \thepage\space undefined% + }% + \fi } -\expandafter\pend:defI\csname autoref \endcsname{% - \let\:autoref\::autoref \edef\RefArg{##1}} -\expandafter\append:defI\csname autoref \endcsname{% - \let\:autoref\:gobble} -\fi +\def\HyRef@testreftype#1.#2\\{% + \@ifundefined{#1autorefname}{% + \@ifundefined{#1name}{% + \HyRef@StripStar#1\\*\\\@nil{#1}% + \@ifundefined{\HyRef@name autorefname}{% + \@ifundefined{\HyRef@name name}{% + \def\HyRef@currentHtag{}% + \Hy@Warning{No autoref name for `#1'}% + }{% + \edef\HyRef@currentHtag{% + \expandafter\noexpand\csname\HyRef@name name\endcsname + \noexpand~% + }% + }% + }{% + \edef\HyRef@currentHtag{% + \expandafter\noexpand\csname\HyRef@name autorefname\endcsname + \noexpand~% + }% + }% + }{% + \edef\HyRef@currentHtag{% + \expandafter\noexpand\csname#1name\endcsname + \noexpand~% + }% + }% + }{% + \edef\HyRef@currentHtag{% + \expandafter\noexpand\csname#1autorefname\endcsname + \noexpand~% + }% + }% +} + +\def\HyRef@StripStar#1*\\#2\@nil#3{% + \def\HyRef@name{#2}% + \ifx\HyRef@name\HyRef@CaseStar + \def\HyRef@name{#1}% + \else + \def\HyRef@name{#3}% + \fi +} +\def\HyRef@CaseStar{*\\} +\def\HyRef@currentHtag{} +\let\HyRef@ShowKeysRef\@gobble +\providecommand*\AMSautorefname{\equationautorefname} +\providecommand*\Hfootnoteautorefname{\footnoteautorefname} +\providecommand*\Itemautorefname{\itemautorefname} +\providecommand*\itemautorefname{item} +\providecommand*\equationautorefname{Equation} +\providecommand*\footnoteautorefname{footnote} +\providecommand*\itemautorefname{item} +\providecommand*\figureautorefname{Figure} +\providecommand*\tableautorefname{Table} +\providecommand*\partautorefname{Part} +\providecommand*\appendixautorefname{Appendix} +\providecommand*\chapterautorefname{chapter} +\providecommand*\sectionautorefname{section} +\providecommand*\subsectionautorefname{subsection} +\providecommand*\subsubsectionautorefname{subsubsection} +\providecommand*\paragraphautorefname{paragraph} +\providecommand*\subparagraphautorefname{subparagraph} +\providecommand*\FancyVerbLineautorefname{line} +\providecommand*\theoremautorefname{Theorem} +\providecommand*\pageautorefname{page} + \expandafter\ifx \csname H@item\endcsname\relax \def\:temp{dvi}\ifx \XR@ext\:temp \else \def\:temp{html}\ifx \XR@ext\:temp \else @@ -255,6 +331,9 @@ \def\hyper@linkurl#1#2{% \leavevmode \begingroup \hyper@chars \ifx \hyper:normalise\:UnDef + \expandafter\pend:defI\expandafter\:autoref + \expandafter{\HyRef@currentHtag}% + \let\HyRef@currentHtag\empty \Hy@colorlink{\@urlcolor}#1\Hy@endcolorlink \else \Link[#2]{}{}\Hy@colorlink{\@urlcolor}#1\Hy@endcolorlink\EndLink @@ -271,28 +350,7 @@ \def\hyperrefLabel{#2}% \Configure{ref} {\Link}{\EndLink}{\Configure{ref}{}{}{}#2}\ref{#1}}} -\expandafter\ifx \csname sectionautorefname\endcsname\relax - \let\:temp=\def - \def\def#1{\expandafter - \ifx \csname \expandafter\:gobble\string#1\endcsname\relax - \expandafter\:temp\expandafter#1\else - \expandafter\:gobble\fi } - \csname Hy@captionsenglish\endcsname - \let\def=\:temp -\fi -\def\::autoref#1{{% - \bgroup - \a:@newlabel - \expandafter\global \expandafter\let - \expandafter\:temp \csname #1autorefname\endcsname - \expandafter\global \expandafter\let - \expandafter\:tempa \csname #1name\endcsname - \egroup - \ifx \:temp\relax - \ifx \:tempa \relax #1% - \else \:tempa \fi - \else \:temp \fi ~}} -\let\:autoref\:gobble +\Configure{@newlabel}{\@onelevel@sanitize\@currentlabelname} \append:def\protect:wrtoc{\def\ref{\protect\o:ref}} \ifx \H@equation\:UnDef \else |