summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/hyperref/hyperref.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/source/latex/hyperref/hyperref.dtx')
-rw-r--r--Master/texmf-dist/source/latex/hyperref/hyperref.dtx413
1 files changed, 286 insertions, 127 deletions
diff --git a/Master/texmf-dist/source/latex/hyperref/hyperref.dtx b/Master/texmf-dist/source/latex/hyperref/hyperref.dtx
index 3142fccba5e..4d442b0954e 100644
--- a/Master/texmf-dist/source/latex/hyperref/hyperref.dtx
+++ b/Master/texmf-dist/source/latex/hyperref/hyperref.dtx
@@ -44,7 +44,7 @@
%<puenc>\ProvidesFile{puenc.def}
%<puvnenc>\ProvidesFile{puvnenc.def}
%<puarenc>\ProvidesFile{puarenc.def}
-%<!none> [2010/03/19 v6.80r
+%<!none> [2010/03/30 v6.80u
%<package> Hypertext links for LaTeX]
%<nohyperref> Dummy hyperref (SR)]
%<driver> Hyperref documentation driver file]
@@ -126,7 +126,7 @@
\end{document}
%</driver>
% \fi
-% \CheckSum{26810}
+% \CheckSum{26960}
%
% \MakeShortVerb{|}
% \StopEventually{}
@@ -598,6 +598,48 @@
}{}%
% \end{macrocode}
% \end{macro}
+% \begin{macro}{\Hy@AtBeginDocument}
+% For the case that package `hyperref' is loaded
+% using \cs{AtBeginDocument}, we have to wrap the calls
+% of \cs{AtBeginDocument}/\cs{AfterBeginDocument} in
+% \cs{AtEndOfPackage}. However, packages must be
+% loaded in \cs{AtEndOfPackage} \emph{before} package
+% `kvoptions' has to perform its option cleanup.
+% Therefore we use a hook.
+% \begin{macrocode}
+\def\Hy@AtBeginDocument{%
+ \ltx@LocalAppendToMacro\Hy@AtBeginDocumentHook
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\Hy@AtEndOfPackage}
+% \begin{macrocode}
+\def\Hy@AtEndOfPackage{%
+ \ltx@LocalAppendToMacro\Hy@AtEndOfPackageHook
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\Hy@AtBeginDocumentHook}
+% \begin{macrocode}
+\def\Hy@AtBeginDocumentHook{}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\Hy@AtEndOfPackageHook}
+% \begin{macrocode}
+\def\Hy@AtEndOfPackageHook{}
+% \end{macrocode}
+% \end{macro}
+% Install the hook, before package `kvoptions' is loaded.
+% \begin{macrocode}
+\AtEndOfPackage{%
+ \Hy@AtEndOfPackageHook
+ \let\Hy@AtEndOfPackageHook\@undefined
+ \AfterBeginDocument{%
+ \Hy@AtBeginDocumentHook{}%
+ \let\Hy@AtBeginDocumentHook\@undefined
+ }%
+}
+% \end{macrocode}
%
% \subsection{Switches}
% \begin{macrocode}
@@ -1116,6 +1158,7 @@
}%
\HyPsd@GreekPatch
\HyPsd@SpanishPatch
+ \HyPsd@RussianPatch
% \end{macrocode}
% \begin{macrocode}
\HyPsd@BabelPatch
@@ -1776,7 +1819,7 @@
\let\c\HyLinguex@OrgC
\let\d\HyLinguex@OrgD
}%
- \AtEndOfPackage{%
+ \Hy@AtEndOfPackage{%
\pdfstringdefDisableCommands{%
\ltx@IfUndefined{oldb}{}{\let\b\oldb}%
\ltx@IfUndefined{oldc}{}{\let\c\oldc}%
@@ -2021,7 +2064,7 @@
}{}%
}
\Hy@temp
-\expandafter\AtBeginDocument\expandafter{\Hy@temp}
+\expandafter\Hy@AtBeginDocument\expandafter{\Hy@temp}
% \end{macrocode}
%
% \begin{macrocode}
@@ -2261,11 +2304,20 @@
% \end{macrocode}
% \begin{macrocode}
\def\HyPsd@SpanishPatch{%
- \begingroup\expandafter\expandafter\expandafter\endgroup
- \expandafter\ifx\csname es@save@dot\endcsname\relax
- \else
+ \ltx@IfUndefined{es@save@dot}{%
+ }{%
\let\.\es@save@dot
- \fi
+ }%
+}
+% \end{macrocode}
+% Shorthand |"-| of `russianb.ldf' is not expandable,
+% therefore it is disabled and replaced by |-|.
+% \begin{macrocode}
+\def\HyPsd@RussianPatch{%
+ \ltx@IfUndefined{russian@sh@"@-@}{%
+ }{%
+ \@namedef{russian@sh@"@-@}{-}%
+ }%
}
% \end{macrocode}
%
@@ -4046,7 +4098,7 @@
%
% \begin{macrocode}
\@ifclassloaded{memoir}{%
- \AtEndOfPackage{\RequirePackage{memhfixc}}%
+ \Hy@AtEndOfPackage{\RequirePackage{memhfixc}}%
}{}
% \end{macrocode}
%
@@ -4534,7 +4586,7 @@
\DeclareFontSubstitution{PU}{pdf}{m}{n}%
\global\let\HyPsd@LoadUnicode\relax
}
-\AtBeginDocument{%
+\Hy@AtBeginDocument{%
\ifx\HyPsd@LoadUnicode\relax
\else
\def\HyPsd@LoadUnicode{%
@@ -4596,7 +4648,7 @@
\RequirePackage{stringenc}[2009/12/15]%
\let\HyPsd@LoadStringEnc\relax
}
-\AtBeginDocument{%
+\Hy@AtBeginDocument{%
\@ifpackageloaded{stringenc}{%
\let\HyPsd@LoadStringEnc\relax
}{%
@@ -4643,7 +4695,7 @@
\def\Hy@driver{htex4ht}%
\def\MaybeStopEarly{%
\typeout{Hyperref stopped early}%
- \AfterBeginDocument{%
+ \Hy@AtBeginDocument{%
\PDF@FinishDoc
\gdef\PDF@FinishDoc{}%
}%
@@ -4697,7 +4749,7 @@
\def\Hy@driver{hvtexhtm}%
\def\MaybeStopEarly{%
\typeout{Hyperref stopped early}%
- \AfterBeginDocument{%
+ \Hy@AtBeginDocument{%
\PDF@FinishDoc
\gdef\PDF@FinishDoc{}%
}%
@@ -4745,7 +4797,7 @@
\def\Hy@driver{htexture}%
}
\define@key{Hyp}{latex2html}[true]{%
- \AtBeginDocument{\@@latextohtmlX}%
+ \Hy@AtBeginDocument{\@@latextohtmlX}%
}
% \end{macrocode}
% No more special treatment for ps2pdf. Let it sink or swim.
@@ -5232,7 +5284,7 @@
% \begin{macrocode}
\define@key{Hyp}{vietnamese}[]{%
\HyLang@addto\extrasvietnamese\HyLang@vietnamese
- \AtEndOfPackage{%
+ \Hy@AtEndOfPackage{%
\@ifundefined{T@PU}{}{%
\input{puvnenc.def}%
}%
@@ -5240,7 +5292,7 @@
}
\define@key{Hyp}{vietnam}[]{%
\HyLang@addto\extrasvietnam\HyLang@vietnamese
- \AtEndOfPackage{%
+ \Hy@AtEndOfPackage{%
\@ifundefined{T@PU}{}{%
\input{puvnenc.def}%
}%
@@ -5251,7 +5303,7 @@
% to PU encoding for Arabi.
% \begin{macrocode}
\define@key{Hyp}{arabic}[]{%
- \AtEndOfPackage{%
+ \Hy@AtEndOfPackage{%
\@ifundefined{T@PU}{}{%
\input{puarenc.def}%
}%
@@ -5268,7 +5320,7 @@
\define@key{Hyp}{ocgcolorlinks}[true]{%
\Hy@boolkey{ocgcolorlinks}{#1}%
}
-\AtBeginDocument{%
+\Hy@AtBeginDocument{%
\begingroup
\@ifundefined{OBJ@OCG@view}{%
\ifHy@ocgcolorlinks
@@ -5921,7 +5973,7 @@
\let\phantomsection\@empty
\let\special@paper\@empty
\def\HyperDestNameFilter#1{#1}
-\AtBeginDocument{%
+\Hy@AtBeginDocument{%
\begingroup
\edef\x{\@ifundefined{stockheight}\paperheight\stockheight}%
\dimen@=\x\relax
@@ -5994,7 +6046,7 @@
% After processing options.
%
% \begin{macrocode}
-\AtBeginDocument{%
+\Hy@AtBeginDocument{%
\ifHy@draft
\let\hyper@@anchor\@gobble
\gdef\hyper@link#1#2#3{#3}%
@@ -6117,7 +6169,7 @@
\Hy@Info{Backreferencing OFF}%
\fi
\ifHy@typexml
- \AtEndOfPackage{%
+ \Hy@AtEndOfPackage{%
\RequirePackage{color}%
\RequirePackage{nameref}%
}%
@@ -6129,13 +6181,13 @@
\typeout{Implicit mode OFF; no redefinition of LaTeX internals}%
\def\MaybeStopEarly{%
\typeout{Hyperref stopped early}%
- \AfterBeginDocument{%
+ \Hy@AtBeginDocument{%
\PDF@FinishDoc
\gdef\PDF@FinishDoc{}%
}%
\endinput
}%
- \AtBeginDocument{%
+ \Hy@AtBeginDocument{%
\let\autoref\ref
\let\autopageref\pageref
\ifx\@pdfpagemode\@empty
@@ -6143,7 +6195,7 @@
\fi
\global\Hy@backreffalse
}%
- \AtEndOfPackage{%
+ \Hy@AtEndOfPackage{%
\global\let\ReadBookmarks\relax
\global\let\WriteBookmarks\relax
}%
@@ -6154,7 +6206,7 @@
% \subsubsection{Driver loading}
%
% \begin{macrocode}
-\AtEndOfPackage{%
+\Hy@AtEndOfPackage{%
\@ifpackageloaded{tex4ht}{%
\def\Hy@driver{htex4ht}%
\Hy@texhttrue
@@ -6243,7 +6295,7 @@
\def\Hy@driver{hvtexhtm}%
\def\MaybeStopEarly{%
\typeout{Hyperref stopped early}%
- \AfterBeginDocument{%
+ \Hy@AtBeginDocument{%
\PDF@FinishDoc
\gdef\PDF@FinishDoc{}%
}%
@@ -6269,9 +6321,9 @@
\PassOptionsToPackage{dviwindo}{color}%
\fi
\fi
- \typeout{*hyperref using default driver \Hy@driver*}%
+ \typeout{* hyperref using default driver \Hy@driver\ltx@space*}%
\else
- \typeout{*hyperref using driver \Hy@driver*}%
+ \typeout{* hyperref using driver \Hy@driver\ltx@space*}%
\fi
\input{\Hy@driver.def}%
\let\@unprocessedoptions\relax
@@ -6314,7 +6366,7 @@
\Hy@DisableOption{latex2html}
\Hy@DisableOption{ps2pdf}
\Hy@DisableOption{xetex}
-\AtEndOfPackage{%
+\Hy@AtEndOfPackage{%
\Hy@DisableOption{pdfversion}%
}
% \end{macrocode}
@@ -6345,7 +6397,7 @@
\else
\def\@bookmarkopenstatus#1{}%
\Hy@Info{Bookmarks OFF}%
- \AtEndOfPackage{%
+ \Hy@AtEndOfPackage{%
\global\let\ReadBookmarks\relax
\global\let\WriteBookmarks\relax
}%
@@ -6402,7 +6454,7 @@
% |\HyColor@UseColor| expects a macro as argument. It contains
% the color specification.
% \begin{macrocode}
-\AtBeginDocument{%
+\Hy@AtBeginDocument{%
\ifHy@ocgcolorlinks
\setkeys{Hyp}{colorlinks}%
\ifHy@pdfa
@@ -6479,7 +6531,7 @@
\@ifstar\@pagerefstar\T@pageref
}%
}
-\AfterBeginDocument{%
+\Hy@AtBeginDocument{%
\ifHy@texht
\else
\Hy@CatcodeWrapper{%
@@ -6915,9 +6967,9 @@
\edef\filename@ext{\XR@ext}%
\fi
\def\use@file{\filename@area\filename@base.\filename@ext}%
- \ifx\filename@ext\XR@ext
+ \Hy@IfStringEndsWith\filename@ext\XR@ext{%
\hyper@linkfile{#2}{\use@file}{#3}%
- \else
+ }{%
\ifx\@baseurl\@empty
\hyper@linkurl{#2}{%
\Hy@linkfileprefix\use@file\ifx\\#3\\\else\hyper@hash#3\fi
@@ -6925,7 +6977,27 @@
\else
\hyper@linkurl{#2}{\use@file\ifx\\#3\\\else\hyper@hash#3\fi}%
\fi
- \fi
+ }%
+}
+% \end{macrocode}
+% \begin{macrocode}
+\def\Hy@IfStringEndsWith#1#2{%
+ \begingroup
+ \edef\x{#1}%
+ \@onelevel@sanitize\x
+ \edef\x{.\x$}%
+ \edef\y{#2}%
+ \@onelevel@sanitize\y
+ \edef\y{.\y$}%
+ \expandafter\def\expandafter\z\expandafter##\expandafter1\y##2\@nil{%
+ \endgroup
+ \ifx\relax##2\relax
+ \expandafter\ltx@secondoftwo
+ \else
+ \expandafter\ltx@firstoftwo
+ \fi
+ }%
+ \expandafter\expandafter\expandafter\z\expandafter\x\y\@nil
}
% \end{macrocode}
% Anchors have a name, and marked text.
@@ -7660,8 +7732,9 @@
\Form@htmltrue
\def\Fld@export{html}%
\else
- \typeout{hyperref: form `encoding' key set to #1 %
- -- unknown type%
+ \Hy@Warning{%
+ Form `encoding' key with \MessageBreak
+ unknown value `#1'%
}%
\Form@htmlfalse
\fi
@@ -7999,7 +8072,7 @@
% in backreferencing-by-section, to allow for cites before
% any sectioning commands. Set up PDF info.
% \begin{macrocode}
-\AfterBeginDocument{%
+\Hy@AtBeginDocument{%
\Hy@pdfstringtrue
\PDF@SetupDoc
\let\PDF@SetupDoc\@empty
@@ -8153,7 +8226,7 @@
% All the code is delayed to |\begin{document}|
% \begin{macrocode}
%<*package>
-\AfterBeginDocument{%
+\Hy@AtBeginDocument{%
% \end{macrocode}
% First the code to deal with removing the hyperref package from
% a document.
@@ -8169,42 +8242,44 @@
\immediate\write\@auxout{<relaxxml>\relax}%
\fi
\immediate\write\@auxout{%
-% \end{macrocode}
-%
-% \begin{macrocode}
- \string\ifx\string\hyper@anchor\string\@undefined^^J%
-% \end{macrocode}
-%
-% \begin{macrocode}
- \global\let\string\oldcontentsline\string\contentsline^^J%
- \gdef\string\contentsline%
- \string#1\string#2\string#3\string#4{%
- \string\oldcontentsline%
- {\string#1}{\string#2}{\string#3}}^^J%
- \global\let\string\oldnewlabel\string\newlabel^^J%
- \gdef\string\newlabel\string#1\string#2{%
- \string\newlabelxx{\string#1}\string#2}^^J%
- \gdef\string\newlabelxx%
- \string#1\string#2\string#3\string#4\string#5\string#6{%
- \string\oldnewlabel{\string#1}{{\string#2}{\string#3}}}^^J%
+ \string\providecommand\string\HyperFirstAtBeginDocument{%
+ \string\AtBeginDocument}^^J%
+ \string\HyperFirstAtBeginDocument{%
+ \string\ifx\string\hyper@anchor\string\@undefined^^J%
+ \string\global\string\let\string\oldcontentsline\string\contentsline^^J%
+ \string\gdef\string\contentsline%
+ \string#1\string#2\string#3\string#4{%
+ \string\oldcontentsline%
+ {\string#1}{\string#2}{\string#3}}^^J%
+ \string\global\string\let\string\oldnewlabel\string\newlabel^^J%
+ \string\gdef\string\newlabel\string#1\string#2{%
+ \string\newlabelxx{\string#1}\string#2}^^J%
+ \string\gdef\string\newlabelxx%
+ \string#1\string#2\string#3\string#4\string#5\string#6{%
+ \string\oldnewlabel{\string#1}{{\string#2}{\string#3}}}^^J%
% \end{macrocode}
%
% But the new aux file will be read again at the end, with the normal
% definitions expected, so better put things back as they were.
% \begin{macrocode}
- \string\AtEndDocument{%
- \let\string\contentsline\string\oldcontentsline^^J%
- \let\string\newlabel\string\oldnewlabel}^^J%
+ \string\AtEndDocument{%
+ \string\ifx\string\hyper@anchor\string\@undefined^^J%
+ \string\let\string\contentsline\string\oldcontentsline^^J%
+ \string\let\string\newlabel\string\oldnewlabel^^J%
+ \string\fi%
+ }^^J%
% \end{macrocode}
%
% If the document is being run with hyperref put this definition
% into the aux file, so we can spot it on the next run.
% \begin{macrocode}
- \string\else^^J%
- \global\let\string\hyper@last\relax^^J%
- \string\fi^^J%
+ \string\fi%
+ }^^J%
+ \string\global\string\let\string\hyper@last\relax^^J%
+ \string\gdef\string\HyperFirstAtBeginDocument\string#1{\string#1}%
}%
\fi
+ \def\HyperFirstAtBeginDocument#1{#1}%
% \end{macrocode}
%
% Now the code to deal with adding the hyperref package to a document
@@ -8742,10 +8817,10 @@
\ifx\HyPsd@temp\HyPsd@pdfencoding@auto
\let\HyPsd@pdfencoding\HyPsd@temp
\else
- \HyWarning{%
- XeTeX driver only supports `pdfencoding=unicode|auto.%
- \MessageBreak
- Ignoring option setting `pdfencoding=\HyPsd@temp'%
+ \Hy@Warning{%
+ XeTeX driver only supports\MessageBreak
+ `pdfencoding=unicode|auto'. Ignoring option\MessageBreak
+ setting `pdfencoding=\HyPsd@temp'%
}%
\fi
\fi
@@ -8816,7 +8891,7 @@
% A marker for the rerun warning is set and the /PageLabels
% is written.
% \begin{macrocode}
- \AfterBeginDocument{%
+ \Hy@AtBeginDocument{%
\if@filesw
\immediate\write\@mainaux{%
\string\providecommand\string*\string\HyPL@Entry[1]{}%
@@ -9065,9 +9140,9 @@
\fi
\ifHy@naturalnames
\let\textlatin\@firstofone
- \xdef\Hy@GlobalTempHlabel{\csname the#1\endcsname}%
+ \xdef\HyperGlobalCurrentHref{\csname the#1\endcsname}%
\else
- \xdef\Hy@GlobalTempHlabel{%
+ \xdef\HyperGlobalCurrentHref{%
\csname
the%
\expandafter\ifx\csname theH#1\endcsname\relax\else H\fi
@@ -9075,24 +9150,54 @@
\endcsname
}%
\fi
- \xdef\Hy@GlobalTempHref{%
- \Hy@param.\expandafter\strip@prefix\meaning\Hy@GlobalTempHlabel
+ \xdef\HyperGlobalCurrentHref{%
+ \Hy@param.\expandafter\strip@prefix\meaning\HyperGlobalCurrentHref
}%
\else
\Hy@GlobalStepCount\Hy@linkcounter
- \xdef\Hy@GlobalTempHref{\Hy@param.\the\Hy@linkcounter}%
+ \xdef\HyperGlobalCurrentHref{\Hy@param.\the\Hy@linkcounter}%
\fi
\endgroup
+ \let\HyperLocalCurrentHref\HyperGlobalCurrentHref
+ \ifHy@localanchorname
+ \let\@currentHref\HyperLocalCurrentHref
+ \else
+ \global\let\@currentHref\HyperGlobalCurrentHref
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\Hy@MakeCurrentHref}
+% \begin{macrocode}
+\def\Hy@MakeCurrentHref#1{%
+ \edef\HyperLocalCurrentHref{#1}%
+ \@onelevel@sanitize\HyperLocalCurrentHref
+ \global\let\HyperGlobalCurrentHref\HyperLocalCurrentHref
+ \let\HyperLocalCurrentHref\HyperGlobalCurrentHref
\ifHy@localanchorname
- \let\@currentHlabel\Hy@GlobalTempHlabel
- \let\@currentHref\Hy@GlobalTempHref
+ \let\@currentHref\HyperLocalCurrentHref
\else
- \global\let\@currentHlabel\Hy@GlobalTempHlabel
- \global\let\@currentHref\Hy@GlobalTempHref
+ \global\let\@currentHref\HyperGlobalCurrentHref
\fi
}
% \end{macrocode}
% \end{macro}
+% \begin{macro}{\Hy@MakeCurrentHrefAuto}
+% \begin{macrocode}
+\def\Hy@MakeCurrentHrefAuto#1{%
+ \Hy@GlobalStepCount\Hy@linkcounter
+ \Hy@MakeCurrentHref{#1.\the\Hy@linkcounter}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\@currentHlabel}
+% \cs{@currrentHlabel} is only defined for compatibility with
+% package `hypdvips'.
+% \begin{macrocode}
+\def\@currentHlabel{\@currentHref}
+% \end{macrocode}
+% \end{macro}
%
% \begin{macrocode}
\@ifpackageloaded{fancyvrb}{%
@@ -9118,7 +9223,7 @@
% The link will not work if option pageanchor is set to false.
% \begin{macro}{\lastpage@putlabel}
% \begin{macrocode}
-\AtBeginDocument{%
+\Hy@AtBeginDocument{%
\@ifclassloaded{revtex4}{%
\@namedef{ver@lastpage.sty}{1994/06/25}%
}{}%
@@ -9207,8 +9312,7 @@
% \begin{macrocode}
\@ifpackageloaded{titlesec}{%
\def\ttl@Hy@steplink#1{%
- \Hy@GlobalStepCount\Hy@linkcounter
- \xdef\@currentHref{#1*.\the\Hy@linkcounter}%
+ \Hy@MakeCurrentHrefAuto{#1*}%
\edef\ttl@Hy@saveanchor{%
\noexpand\Hy@raisedlink{%
\noexpand\hyper@anchorstart{\@currentHref}%
@@ -9284,7 +9388,6 @@
\expandafter\def\y[##1]##2{%
\H@refstepcounter{#1}%
\hyper@makecurrent{table}%
- \let\Hy@LT@currentHlabel\@currentHlabel
\let\Hy@LT@currentHref\@currentHref
#2\@sharp#####4%
}%
@@ -9299,7 +9402,6 @@
\endgroup
\def\LT@start{%
#1%
- \let\@currentHlabel\Hy@LT@currentHlabel
\let\@currentHref\Hy@LT@currentHref
\Hy@raisedlink{%
\hyper@anchorstart{\@currentHref}\hyper@anchorend
@@ -9495,6 +9597,7 @@
\else
\H@refstepcounter{#2}%
\hyper@makecurrent{#2}%
+ \let\Hy@dth@currentHref\@currentHref
\def\@tempa{%
\@oparg{\@begintheorem{#3}{\csname the#2\endcsname}}[]%
}%
@@ -9516,7 +9619,10 @@
\ifx\@empty\dth@counter
\else
\Hy@raisedlink{%
- \hyper@anchorstart{\@currentHref}\hyper@anchorend
+ \hyper@anchorstart{%
+ \ltx@ifundefined{Hy@dth@currentHref}%
+ \@currentHref\Hy@dth@currentHref
+ }\hyper@anchorend
}%
\fi
\unhbox\@labels
@@ -9590,7 +9696,6 @@
\Hy@footnote@currentHref
}{\relax}%
}%
- \let\@currentHlabel\Hy@footnote@currentHlabel
\let\@currentHref\Hy@footnote@currentHref
\let\@currentlabelname\@empty
#1%
@@ -9609,12 +9714,9 @@
\leavevmode
\ifhmode\edef\@x@sf{\the\spacefactor}\nobreak\fi
\stepcounter{Hfootnote}%
- \global\let\Hy@saved@currentHlabel\@currentHlabel
\global\let\Hy@saved@currentHref\@currentHref
\hyper@makecurrent{Hfootnote}%
- \global\let\Hy@footnote@currentHlabel\@currentHlabel
\global\let\Hy@footnote@currentHref\@currentHref
- \global\let\@currentHlabel\Hy@saved@currentHlabel
\global\let\@currentHref\Hy@saved@currentHref
\hyper@linkstart{link}{\Hy@footnote@currentHref}%
\@makefnmark
@@ -9649,29 +9751,27 @@
\noexpand\protected@xdef\noexpand\@thefnmark{%
\noexpand\thempfn
}%
- \expandafter\expandafter\expandafter\noexpand
- \expandafter\expandafter\expandafter\Hy@LT@footnotetext
- \expandafter\expandafter\expandafter{%
- \expandafter\Hy@footnote@currentHref\expandafter
- }\expandafter{\Hy@footnote@currentHlabel}%
+ \expandafter\noexpand\expandafter\Hy@LT@footnotetext
+ \expandafter{%
+ \Hy@footnote@currentHref
+ }%
}%
\global\LT@p@ftn\expandafter{%
\@tempa{#1}%
\endgroup
}%
}%
- \long\def\Hy@LT@footnotetext#1#2#3{%
+ \long\def\Hy@LT@footnotetext#1#2{%
\H@@footnotetext{%
\ifHy@nesting
- \hyper@@anchor{#1}{#3}%
+ \hyper@@anchor{#1}{#2}%
\else
\Hy@raisedlink{%
\hyper@@anchor{#1}{\relax}%
}%
- \def\@currentHlabel{#2}%
\def\@currentHref{#1}%
\let\@currentlabelname\@empty
- #3%
+ #2%
\fi
}%
}%
@@ -9701,7 +9801,6 @@
\Hy@footnote@currentHref
}{\relax}%
}%
- \let\@currentHlabel\Hy@footnote@currentHlabel
\let\@currentHref\Hy@footnote@currentHref
\let\@currentlabelname\@empty
\ignorespaces
@@ -10168,7 +10267,7 @@
% messages.
% \begin{macrocode}
\@ifpackageloaded{harvard}{%
- \AtBeginDocument{%
+ \Hy@AtBeginDocument{%
\Hy@Info{*** compatibility with harvard **** }%
\Hy@raiselinksfalse
\def\harvardcite#1#2#3#4{%
@@ -10489,8 +10588,7 @@
% \begin{macrocode}
\@ifpackageloaded{amsmath}{%
\def\Hy@make@anchor{%
- \Hy@GlobalStepCount\Hy@linkcounter
- \xdef\@currentHref{AMS.\the\Hy@linkcounter}%
+ \Hy@MakeCurrentHrefAuto{AMS}%
\Hy@raisedlink{\hyper@anchorstart{\@currentHref}\hyper@anchorend}%
}%
\def\Hy@make@df@tag@@#1{%
@@ -11101,7 +11199,7 @@
\def\@pagerefstar#1{%
\HyRef@StarSetRef{#1}\@secondoffive
}
-\AtBeginDocument{%
+\Hy@AtBeginDocument{%
\@ifpackageloaded{varioref}{%
\def\@Refstar#1{%
\HyRef@StarSetRef{#1}\HyRef@MakeUppercaseFirstOfFive
@@ -11253,7 +11351,7 @@
\@ifpackageloaded{showkeys}{%
\HyRef@ShowKeysInit
}{%
- \AtBeginDocument{%
+ \Hy@AtBeginDocument{%
\@ifpackageloaded{showkeys}{%
\HyRef@ShowKeysInit
}{}%
@@ -11496,7 +11594,7 @@
}%
}%
\x
- \AtBeginDocument{%
+ \Hy@AtBeginDocument{%
\def\Hy@colorlink#1{%
\begingroup
\ifHy@ocgcolorlinks
@@ -12081,7 +12179,7 @@
% \begin{macrocode}
%</pdftex>
%<*pdftex|xetex>
-\AtBeginDocument{%
+\Hy@AtBeginDocument{%
\ifHy@setpagesize
\expandafter\@firstofone
\else
@@ -12761,7 +12859,7 @@
}%
}%
}%
- \AtBeginDocument{%
+ \Hy@AtBeginDocument{%
\def\Hy@colorlink#1{%
\begingroup
\ifHy@ocgcolorlinks
@@ -13220,7 +13318,7 @@
\fi
}%
}%
- \AtBeginDocument{\VTeXInitMediaSize}%
+ \Hy@AtBeginDocument{\VTeXInitMediaSize}%
\fi
\Hy@DisableOption{setpagesize}%
\fi
@@ -14958,7 +15056,7 @@
% The Rect pair are called at the LL and UR corners of a box
% known to \TeX.
% \begin{macrocode}
-\AfterBeginDocument{%
+\Hy@AtBeginDocument{%
\headerps@out{%
% \end{macrocode}
% Textures lives in normal points, I think. So conversion from one
@@ -15003,7 +15101,7 @@
}
% \end{macrocode}
% \begin{macrocode}
-\AfterBeginDocument{%
+\Hy@AtBeginDocument{%
\ifHy@colorlinks
\headerps@out{/PDFBorder{/Border [0 0 0]}def}%
\fi
@@ -16034,8 +16132,8 @@
}%
\else
\def\HyField@AuxAddToFields#1{}%
- \def\HyField@AfterAuxOpen{\AtBeginDocument}%
- \AtBeginDocument{%
+ \def\HyField@AfterAuxOpen{\Hy@AtBeginDocument}%
+ \Hy@AtBeginDocument{%
\if@filesw
\immediate\write\@mainaux{%
\string\providecommand\string\HyField@AuxAddToFields[1]{}%
@@ -17297,8 +17395,7 @@
% to get bookmarks when used with a manual |\addcontentsline|
% \begin{macrocode}
\def\phantomsection{%
- \Hy@GlobalStepCount\Hy@linkcounter
- \xdef\@currentHref{section*.\the\Hy@linkcounter}%
+ \Hy@MakeCurrentHrefAuto{section*}%
\Hy@raisedlink{\hyper@anchorstart{\@currentHref}\hyper@anchorend}%
}
%</package>
@@ -17390,6 +17487,7 @@
\fi
\HyPsd@XeTeXBigCharstrue
\pdfstringdef\Hy@tempa{#2}%
+ \HyPsd@SanitizeForOutFile\Hy@tempa
\if@filesw
\stepcounter{bookmark@seq@number}%
\@ifundefined{@outlinefile}{%
@@ -17407,6 +17505,57 @@
}
\newcounter{bookmark@seq@number}
% \end{macrocode}
+% \begin{macrocode}
+\begingroup
+ \lccode`(=`{%
+ \lccode`)=`}%
+ \lccode`1=\z@
+ \lccode`2=\z@
+ \lccode`3=\z@
+ \lccode`5=\z@
+ \lccode`7=\z@
+ \lccode`\#=\z@
+ \lccode`\`=\z@
+ \lccode`\{=\z@
+ \lccode`\}=\z@
+\lowercase{%
+ \endgroup
+ \def\HyPsd@SanitizeForOutFile#1{%
+ \@onelevel@sanitize\Hy@tempa
+ \escapechar`\\%
+ \edef\Hy@tempa{%
+ \expandafter\HyPsd@SanitizeOut@BraceLeft\Hy@tempa(\@nil
+ }%
+ \edef\Hy@tempa{%
+ \expandafter\HyPsd@SanitizeOut@BraceRight\Hy@tempa)\@nil
+ }%
+ }%
+ \def\HyPsd@SanitizeOut@BraceLeft#1(#2\@nil{%
+ #1%
+ \ifx\\#2\\%
+ \expandafter\ltx@gobble
+ \else
+ \expandafter\ltx@firstofone
+ \fi
+ {%
+ \string\173%
+ \HyPsd@SanitizeOut@BraceLeft#2\@nil
+ }%
+ }%
+ \def\HyPsd@SanitizeOut@BraceRight#1)#2\@nil{%
+ #1%
+ \ifx\\#2\\%
+ \expandafter\ltx@gobble
+ \else
+ \expandafter\ltx@firstofone
+ \fi
+ {%
+ \string\175%
+ \HyPsd@SanitizeOut@BraceRight#2\@nil
+ }%
+ }%
+}
+% \end{macrocode}
% In the call of \cmd{\BOOKMARK} the braces around \verb|#4|
% are omitted, because it is not likely, that the level number
% contains \verb|]|.
@@ -17562,11 +17711,16 @@
\def\({(}%
\def\){)}%
\def\do##1{%
- \ifnum\the\catcode`##1=\active
+ \ifnum\catcode`##1=\active
\@makeother##1%
+ \else
+ \ifnum\catcode`##1=6 %
+ \@makeother##1%
+ \fi
\fi
}%
\dospecials
+ \Hy@safe@activestrue
\InputIfFileExists{\jobname.out}{}{}%
\endgroup
\ifx\WriteBookmarks\relax
@@ -17590,6 +17744,17 @@
%<*!vtex>
\def\ReadBookmarks{%
\begingroup
+ \def\do##1{%
+ \ifnum\catcode`##1=\active
+ \@makeother##1%
+ \else
+ \ifnum\catcode`##1=6 %
+ \@makeother##1%
+ \fi
+ \fi
+ }%
+ \dospecials
+ \Hy@safe@activestrue
\escapechar=`\\%
\let\escapechar\@gobble %
\def\@@BOOKMARK[##1][##2]##3##4##5{%
@@ -17639,8 +17804,8 @@
%</dvipdfm|xetex>
}%
{%
- \def\WriteBookmarks{0}%
- \InputIfFileExists{\jobname.out}{}{}%
+ \def\WriteBookmarks{0}%
+ \InputIfFileExists{\jobname.out}{}{}%
}%
%{\escapechar\m@ne\InputIfFileExists{\jobname.out}{}{}}%
\ifx\WriteBookmarks\relax
@@ -17706,8 +17871,7 @@
}
\let\H@old@ssect\@ssect
\def\@ssect#1#2#3#4#5{%
- \Hy@GlobalStepCount\Hy@linkcounter
- \xdef\@currentHref{section*.\the\Hy@linkcounter}%
+ \Hy@MakeCurrentHrefAuto{section*}%
\setlength{\Hy@SectionHShift}{#1}%
\begingroup
\toks@{\H@old@ssect{#1}{#2}{#3}{#4}}%
@@ -17723,8 +17887,7 @@
\def\@schapter#1{%
\begingroup
\let\@mkboth\@gobbletwo
- \Hy@GlobalStepCount\Hy@linkcounter
- \xdef\@currentHref{\Hy@chapapp*.\the\Hy@linkcounter}%
+ \Hy@MakeCurrentHrefAuto{\Hy@chapapp*}%
\Hy@raisedlink{%
\hyper@anchorstart{\@currentHref}\hyper@anchorend
}%
@@ -17741,8 +17904,7 @@
\let\Hy@org@chapter\@chapter
\def\@chapter{%
\def\Hy@next{%
- \Hy@GlobalStepCount\Hy@linkcounter
- \xdef\@currentHref{\Hy@chapapp*.\the\Hy@linkcounter}%
+ \Hy@MakeCurrentHrefAuto{\Hy@chapapp*}%
\Hy@raisedlink{%
\hyper@anchorstart{\@currentHref}\hyper@anchorend
}%
@@ -17776,8 +17938,7 @@
% \begin{macrocode}
\let\H@old@spart\@spart
\def\@spart#1{%
- \Hy@GlobalStepCount\Hy@linkcounter
- \xdef\@currentHref{part*.\the\Hy@linkcounter}%
+ \Hy@MakeCurrentHrefAuto{part*}%
\Hy@raisedlink{%
\hyper@anchorstart{\@currentHref}\hyper@anchorend
}%
@@ -17791,8 +17952,7 @@
\expandafter\@secondoftwo
\fi
{%
- \Hy@GlobalStepCount\Hy@linkcounter
- \xdef\@currentHref{section*.\the\Hy@linkcounter}%
+ \Hy@MakeCurrentHrefAuto{section*}%
\setlength{\Hy@SectionHShift}{#3}%
\begingroup
\toks@{\H@old@sect{#1}{#2}{#3}{#4}{#5}{#6}[{#7}]}%
@@ -17851,8 +18011,7 @@
\fi
\addtocontents{lof}{\protect\addvspace{10\p@}}%
\addtocontents{lot}{\protect\addvspace{10\p@}}%
- \Hy@GlobalStepCount\Hy@linkcounter
- \xdef\@currentHref{\Hy@chapapp*.\the\Hy@linkcounter}%
+ \Hy@MakeCurrentHrefAuto{\Hy@chapapp*}%
\Hy@raisedlink{%
\hyper@anchorstart{\@currentHref}\hyper@anchorend
}%