diff options
Diffstat (limited to 'Master/texmf-dist/source/latex/hyperref/hyperref.dtx')
-rw-r--r-- | Master/texmf-dist/source/latex/hyperref/hyperref.dtx | 297 |
1 files changed, 263 insertions, 34 deletions
diff --git a/Master/texmf-dist/source/latex/hyperref/hyperref.dtx b/Master/texmf-dist/source/latex/hyperref/hyperref.dtx index 7b3bc704dcf..a48c4bb61e4 100644 --- a/Master/texmf-dist/source/latex/hyperref/hyperref.dtx +++ b/Master/texmf-dist/source/latex/hyperref/hyperref.dtx @@ -45,7 +45,7 @@ %<puvnenc>\ProvidesFile{puvnenc.def} %<puarenc>\ProvidesFile{puarenc.def} %<psdextra>\ProvidesFile{psdextra.def} -%<!none> [2012/09/27 v6.83g % +%<!none> [2012/10/13 v6.83j % %<package> Hypertext links for LaTeX] %<nohyperref> Dummy hyperref (SR)] %<driver> Hyperref documentation driver file] @@ -147,7 +147,7 @@ \end{document} %</driver> % \fi -% \CheckSum{39329} +% \CheckSum{39588} % % \MakeShortVerb{|} % \StopEventually{} @@ -618,6 +618,7 @@ \RequirePackage{infwarerr}[2010/04/08] \RequirePackage{keyval}[1997/11/10] \RequirePackage{kvsetkeys}[2007/09/29] +\RequirePackage{kvdefinekeys}[2011/04/07] \RequirePackage{pdfescape}[2007/11/11] \RequirePackage{ifvtex} \RequirePackage{ifxetex}[2006/08/21] @@ -6601,15 +6602,22 @@ `\kv@key' is ignored% }% \else - \define@key{pdfinfo}{\HyInfo@Key}{% - \HyXeTeX@CheckUnicode - \HyPsd@XeTeXBigCharstrue - \HyPsd@PrerenderUnicode{##1}% - \pdfstringdef\HyInfo@Value{##1}% - \expandafter\let\csname HyInfo@Value@\HyInfo@Key\endcsname - \HyInfo@Value + \def\HyInfo@tmp##1{% + \kv@define@key{pdfinfo}{##1}{% + \HyXeTeX@CheckUnicode + \HyPsd@XeTeXBigCharstrue + \HyPsd@PrerenderUnicode{####1}% + \pdfstringdef\HyInfo@Value{####1}% + \global\expandafter + \let\csname HyInfo@Value@##1\endcsname + \HyInfo@Value + }% }% - \edef\HyInfo@AddonList{% + \expandafter\HyInfo@tmp\expandafter{\HyInfo@Key}% + \global\expandafter + \let\csname KV@pdfinfo@\HyInfo@Key\expandafter\endcsname + \csname KV@pdfinfo@\HyInfo@Key\endcsname + \xdef\HyInfo@AddonList{% \HyInfo@AddonList \HyInfo@do{\HyInfo@Key}% }% @@ -6651,7 +6659,7 @@ \x \fi } -\let\HyInfo@AddonList\ltx@empty +\global\let\HyInfo@AddonList\ltx@empty % \end{macrocode} % \begin{macrocode} \define@key{Hyp}{pdfview}{\calculate@pdfview#1 \\} @@ -6858,10 +6866,18 @@ % Add option |tex4ht| if package |tex4ht| is loaded. % \begin{macrocode} \@ifpackageloaded{tex4ht}{% - \@ifpackagewith{hyperref}{tex4ht}{}{% + \@ifpackagewith{hyperref}{tex4ht}{% + }{% \PassOptionsToPackage{tex4ht}{hyperref}% }% }{} +\ltx@IfUndefined{HCode}{% +}{% + \@ifpackagewith{hyperref}{tex4ht}{% + }{% + \PassOptionsToPackage{tex4ht}{hyperref}% + }% +} % \end{macrocode} % % \begin{macrocode} @@ -9260,6 +9276,14 @@ \Hy@temp{onblur} \Hy@temp{onenter} \Hy@temp{onexit} +% \end{macrocode} +% \begin{macrocode} +\let\Fld@calculate@sortkey\ltx@empty +\define@key{Field}{calculatesortkey}[1]{% + \def\Fld@calculate@sortkey{#1}% +} +% \end{macrocode} +% \begin{macrocode} \ifHy@texht \def\Hy@temp#1{% \define@key{Field}{#1}{% @@ -13438,7 +13462,12 @@ % % First, allow for some changes and additions to pdftex syntax: % \begin{macrocode} -\def\setpdflinkmargin#1{\pdflinkmargin#1} +\def\setpdflinkmargin#1{% + \begingroup + \setlength{\dimen@}{#1}% + \expandafter\endgroup + \expandafter\pdflinkmargin\the\dimen@\relax +} \ifx\pdfstartlink\@undefined% less than version 14 \let\pdfstartlink\pdfannotlink \let\pdflinkmargin\@tempdima @@ -16361,6 +16390,7 @@ \edef\@processme{\noexpand\pdf@toks={\the\pdf@defaulttoks}}% \@processme \let\pdf@type\relax + \let\pdf@objdef\ltx@empty \kvsetkeys{PDF}{#2}% \ifHy@pdfmarkerror \else @@ -16373,7 +16403,12 @@ \else \ifx\\#1\\% \literalps@out{% - [\the\pdf@toks\space\pdf@type\space pdfmark% + [% + \ifx\pdf@objdef\ltx@empty + \else + /_objdef\string{\pdf@objdef\string}% + \fi + \the\pdf@toks\space\pdf@type\space pdfmark% }% \else \ltx@IfUndefined{@\pdf@linktype color}{% @@ -16384,7 +16419,12 @@ }% \pdf@rect{#1}% \literalps@out{% - [\the\pdf@toks\space\pdf@type\space pdfmark% + [% + \ifx\pdf@objdef\ltx@empty + \else + /_objdef\string{\pdf@objdef\string}% + \fi + \the\pdf@toks\space\pdf@type\space pdfmark% }% \Hy@endcolorlink \fi @@ -16524,6 +16564,9 @@ % what is the link type? \define@key{PDF}{linktype}{\def\pdf@linktype{#1}} \def\pdf@linktype{link} +% named object? +\define@key{PDF}{objdef}{\edef\pdf@objdef{#1}} +\let\pdf@objdef\ltx@empty % parameter is a stream of PDF \define@key{PDF}{Raw}{\pdf@addtoksx{#1}} % parameter is a name @@ -16938,6 +16981,18 @@ \fi \Hy@DisableOption{setpagesize}% } +% \end{macrocode} +% \begin{macrocode} +\def\setpdflinkmargin#1{% + \begingroup + \setlength{\dimen@}{#1}% + \literalps@out{% + /HyperBorder{\strip@pt\dimen@\space PDFToDvips}def% + }% + \endgroup +} +% \end{macrocode} +% \begin{macrocode} %</dvips> % \end{macrocode} % @@ -17037,6 +17092,18 @@ } def% }% } +% \end{macrocode} +% \begin{macrocode} +\def\setpdflinkmargin#1{% + \begingroup + \setlength{\dimen@}{#1}% + \literalps@out{% + /HyperBorder{\strip@pt\dimen@}def% + }% + \endgroup +} +% \end{macrocode} +% \begin{macrocode} %</vtexpdfmark> % \end{macrocode} % @@ -17194,6 +17261,16 @@ } % \end{macrocode} % \begin{macrocode} +\def\setpdflinkmargin#1{% + \begingroup + \setlength{\dimen@}{#1}% + \literalps@out{% + /HyperBorder{\strip@pt\dimen@\space PDFToDvips}def% + }% + \endgroup +} +% \end{macrocode} +% \begin{macrocode} \Hy@AtBeginDocument{% \ifHy@colorlinks \headerps@out{/PDFBorder{/Border [0 0 0]}def}% @@ -17503,6 +17580,18 @@ } def% }% } +% \end{macrocode} +% \begin{macrocode} +\def\setpdflinkmargin#1{% + \begingroup + \setlength{\dimen@}{#1}% + \literalps@out{% + /HyperBorder{\strip@pt\dimen@\space PDFToDvips}def% + }% + \endgroup +} +% \end{macrocode} +% \begin{macrocode} %</dvipsone> % \end{macrocode} % @@ -17744,6 +17833,10 @@ /_objdef{afields}% /type/array% /OBJ pdfmark% +[% + /_objdef{corder}% + /type/array% +/OBJ pdfmark% {% [% /BBox[0 0 100 100]% @@ -17844,10 +17937,6 @@ /AcroForm{aform}% >>% /PUT pdfmark% -[% - /_objdef{corder}% - /type/array% -/OBJ pdfmark% dps }}% \kvsetkeys{Form}{#1}% } @@ -17855,7 +17944,42 @@ \def\@Gauge[#1]#2#3#4{% parameters, label, minimum, maximum \Hy@Message{Sorry, pdfmark drivers do not support FORM gauges}% } +% \end{macrocode} +% \begin{macrocode} +\newcount\HyField@AnnotCount +\HyField@AnnotCount=\z@ +\def\HyField@AdvanceAnnotCount{% + \global\advance\HyField@AnnotCount\@ne +} +\def\HyField@TheAnnotCount{% + \the\HyField@AnnotCount +} +% \end{macrocode} +% \begin{macrocode} \edef\Fld@pageobjref{/P\string{ThisPage\string}} +% \end{macrocode} +% \begin{macrocode} +\def\HyField@AddToFields#1{% + \pdfmark{% + pdfmark=/APPEND,% + Raw={% + \string{afields\string}% + \string{#1\HyField@TheAnnotCount\string}% + }% + }% + \ifx\Fld@calculate@code\ltx@empty + \else + \pdfmark{% + pdfmark=/APPEND,% + Raw={% + \string{corder\string}% + \string{#1\HyField@TheAnnotCount\string}% + }% + }% + \fi +} +% \end{macrocode} +% \begin{macrocode} \def\@TextField[#1]#2{% parameters, label \def\Fld@name{#2}% \let\Fld@default\ltx@empty @@ -17875,13 +17999,17 @@ \HyField@FlagsText \ifFld@hidden\def\Fld@width{1sp}\fi \ifx\Fld@value\@empty\def\Fld@value{\Fld@default}\fi + \HyField@AdvanceAnnotCount \LayoutTextField{#2}{% \leavevmode \Hy@escapeform\PDFForm@Text \pdfmark[\MakeTextField{\Fld@width}{\Fld@height}]{% - pdfmark=/ANN,Raw={\PDFForm@Text}% + pdfmark=/ANN,% + objdef=text\HyField@TheAnnotCount,% + Raw={\PDFForm@Text}% }% }% + \HyField@AddToFields{text}% \endgroup } \def\@ChoiceMenu[#1]#2#3{% parameters, label, choices @@ -17961,21 +18089,32 @@ \Hy@StepCount\Fld@listcount \@currDisplay\space \Hy@escapeform\PDFForm@Radio + \ifnum\Fld@listcount=1 % + \HyField@AdvanceAnnotCount + \fi \pdfmark[\MakeRadioField{\Fld@width}{\Fld@height}]{% pdfmark=/ANN,% + objdef=\ifnum\Fld@listcount=1 radio\HyField@TheAnnotCount\fi,% Raw={% \PDFForm@Radio /AP <</N <</\@currValue\space {Check}>> >>% }% } % deliberate space between radio buttons + \ifnum\Fld@listcount=1 % + \HyField@AddToFields{radio}% + \fi }% } \newcount\Fld@listcount \def\@@Listbox#1{% \HyField@PDFChoices{#1}% \Hy@escapeform\PDFForm@List + \HyField@AdvanceAnnotCount \pdfmark[\MakeChoiceField{\Fld@width}{\Fld@height}]{% - pdfmark=/ANN,Raw={\PDFForm@List}% + pdfmark=/ANN,% + objdef=list\HyField@TheAnnotCount,% + Raw={\PDFForm@List}% }% + \HyField@AddToFields{list}% } \def\@PushButton[#1]#2{% parameters, label \def\Fld@name{#2}% @@ -17994,13 +18133,17 @@ \else \HyField@FlagsPushButton \ifFld@hidden\def\Fld@width{1sp}\fi + \HyField@AdvanceAnnotCount \LayoutPushButtonField{% \leavevmode \Hy@escapeform\PDFForm@Push \pdfmark[\MakeButtonField{#2}]{% - pdfmark=/ANN,Raw={\PDFForm@Push}% + pdfmark=/ANN,% + objdef=push\HyField@TheAnnotCount,% + Raw={\PDFForm@Push}% }% }% + \HyField@AddToFields{push}% \fi \endgroup } @@ -18015,10 +18158,13 @@ \HyField@FlagsSubmit \ifFld@hidden\def\Fld@width{1sp}\fi \Hy@escapeform\PDFForm@Submit + \HyField@AdvanceAnnotCount \pdfmark[\MakeButtonField{#2}]{% pdfmark=/ANN,% - Raw={\PDFForm@Submit /AP << /N {Submit} /D {SubmitP} >>}% + objdef=submit\HyField@TheAnnotCount,% + Raw={\PDFForm@Submit /AP<</N{Submit}/D{SubmitP}>>}% }% + \HyField@AddToFields{submit}% \endgroup } \def\@Reset[#1]#2{% @@ -18038,9 +18184,13 @@ \HyField@FlagsPushButton \ifFld@hidden\def\Fld@width{1sp}\fi \Hy@escapeform\PDFForm@Reset + \HyField@AdvanceAnnotCount \pdfmark[\MakeButtonField{#2}]{% - pdfmark=/ANN,Raw={\PDFForm@Reset}% + pdfmark=/ANN,% + objdef=reset\HyField@TheAnnotCount,% + Raw={\PDFForm@Reset}% }% + \HyField@AddToFields{reset}% \fi \endgroup }% @@ -18055,13 +18205,17 @@ }% \HyField@FlagsCheckBox \ifFld@hidden\def\Fld@width{1sp}\fi + \HyField@AdvanceAnnotCount \LayoutCheckField{#2}{% \leavevmode \Hy@escapeform\PDFForm@Check \pdfmark[\MakeCheckField{\Fld@width}{\Fld@height}]{% - pdfmark=/ANN,Raw={\PDFForm@Check}% + pdfmark=/ANN,% + objdef=check\HyField@TheAnnotCount,% + Raw={\PDFForm@Check}% }% }% + \HyField@AddToFields{check}% \endgroup } %</pdfmark> @@ -18257,6 +18411,7 @@ % \hbox to 0pt{\hskip-\maxdimen{\pdfrefxform \the\pdflastxform}}% }% \let\HyField@afields\ltx@empty +\let\HyField@cofields\ltx@empty \begingroup\expandafter\expandafter\expandafter\endgroup \expandafter\ifx\csname pdflastlink\endcsname\relax \let\HyField@AddToFields\relax @@ -18269,12 +18424,53 @@ }% \else \let\HyField@AuxAddToFields\ltx@gobble + \let\HyField@AuxAddToCoFields\ltx@gobbletwo \def\HyField@AfterAuxOpen{\Hy@AtBeginDocument}% +% \end{macrocode} +% Insertion sort for calculation field list. +% In case of equal sort keys (for example, if `calculatesortkey` +% is not used at all) the keys keep document calling order. +% \begin{macrocode} + \def\HyField@ABD@AuxAddToCoFields#1#2{% + \begingroup + \Hy@safe@activestrue + \let\ltx@secondoftwo\relax + \ifx\HyField@cofields\ltx@empty + \xdef\HyField@cofields{% + \ltx@secondoftwo{#1}{ #2 0 R}% + }% + \else + \let\ltx@secondoftwo\relax + \def\HyField@AddCoField##1##2##3{% + \ifx##1\ltx@empty + \ltx@secondoftwo{#1}{ #2 0 R}% + \expandafter\ltx@gobble + \else + \ifnum\pdfstrcmp{##2}{#1}>\ltx@zero + \ltx@secondoftwo{#1}{ #2 0 R}% + \ltx@secondoftwo{##2}{##3}% + \expandafter\expandafter\expandafter\ltx@gobble + \else + \ltx@secondoftwo{##2}{##3}% + \fi + \fi + \HyField@AddCoField + }% + \xdef\HyField@cofields{% + \expandafter\HyField@AddCoField + \HyField@cofields\ltx@empty\ltx@empty\ltx@empty + }% + \fi + \endgroup + }% \Hy@AtBeginDocument{% \if@filesw \immediate\write\@mainaux{% \string\providecommand\string\HyField@AuxAddToFields[1]{}% }% + \immediate\write\@mainaux{% + \string\providecommand\string\HyField@AuxAddToCoFields[2]{}% + }% \fi \let\HyField@AfterAuxOpen\@firstofone \def\HyField@AuxAddToFields#1{% @@ -18287,11 +18483,30 @@ #1 0 R% }% }% + \let\HyField@AuxAddToCoFields\HyField@ABD@AuxAddToCoFields }% \def\HyField@AddToFields{% \expandafter\HyField@@AddToFields\expandafter{% \the\pdflastlink }% + \ifx\Fld@calculate@code\ltx@empty + \else + \begingroup + \Hy@safe@activestrue + \edef\Hy@temp{% + \endgroup + \if@filesw + \write\@mainaux{% + \string\HyField@AuxAddToCoFields{% + \Fld@calculate@sortkey + }{% + \the\pdflastlink + }% + }% + \fi + }% + \Hy@temp + \fi }% \def\HyField@@AddToFields#1{% \HyField@AfterAuxOpen{% @@ -18317,6 +18532,10 @@ \immediate\pdfobj{% <<% /Fields[\HyField@afields]% + \ifx\HyField@cofields\ltx@empty + \else + /CO[\romannumeral-`\Q\HyField@cofields]% + \fi /DR<<% /Font<<% /ZaDb \OBJ@ZaDb\space 0 R% @@ -18781,6 +19000,18 @@ % \end{macrocode} % \end{macro} % +% \begin{macro}{\HyField@AddToFields} +% \begin{macrocode} +\def\HyField@AddToFields#1{% + \@pdfm@mark{put @afields @#1\HyField@TheAnnotCount}% + \ifx\Fld@calculate@code\ltx@empty + \else + \@pdfm@mark{put @corder @#1\HyField@TheAnnotCount}% + \fi +} +% \end{macrocode} +% \end{macro} +% % \begin{macro}{\@TextField} % \begin{macrocode} \def\@TextField[#1]#2{% parameters, label @@ -18816,7 +19047,7 @@ }% }% \unhbox\pdfm@box - \@pdfm@mark{put @afields @text\HyField@TheAnnotCount}% + \HyField@AddToFields{text}% % record in @afields array \endgroup } @@ -18929,9 +19160,7 @@ }% \unhcopy\pdfm@box\space% deliberate space between radio buttons \ifnum\Fld@listcount=1 % - \@pdfm@mark{% - put @afields @radio\HyField@TheAnnotCount - }% + \HyField@AddToFields{radio}% \fi }% } @@ -18959,7 +19188,7 @@ <<\PDFForm@List>>% }% \unhbox\pdfm@box - \@pdfm@mark{put @afields @list\HyField@TheAnnotCount}% + \HyField@AddToFields{list}% } % \end{macrocode} % \end{macro} @@ -18996,7 +19225,7 @@ }% }% \unhbox\pdfm@box - \@pdfm@mark{put @afields @push\HyField@TheAnnotCount}% + \HyField@AddToFields{push}% \fi \endgroup } @@ -19025,7 +19254,7 @@ <<\PDFForm@Submit>>% }% \unhbox\pdfm@box% - \@pdfm@mark{put @afields @submit\HyField@TheAnnotCount}% + \HyField@AddToFields{submit}% \endgroup } % \end{macrocode} @@ -19058,7 +19287,7 @@ <<\PDFForm@Reset>>% }% \unhbox\pdfm@box - \@pdfm@mark{put @afields @reset\HyField@TheAnnotCount}% + \HyField@AddToFields{reset}% \fi \endgroup } @@ -19092,7 +19321,7 @@ <<\PDFForm@Check>>% }% \unhbox\pdfm@box - \@pdfm@mark{put @afields @check\HyField@TheAnnotCount}% + \HyField@AddToFields{check}% }% \endgroup } |