summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/hyperref/hdvipdfm.def
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex/hyperref/hdvipdfm.def')
-rw-r--r--Master/texmf-dist/tex/latex/hyperref/hdvipdfm.def253
1 files changed, 196 insertions, 57 deletions
diff --git a/Master/texmf-dist/tex/latex/hyperref/hdvipdfm.def b/Master/texmf-dist/tex/latex/hyperref/hdvipdfm.def
index c9203673486..746d8608377 100644
--- a/Master/texmf-dist/tex/latex/hyperref/hdvipdfm.def
+++ b/Master/texmf-dist/tex/latex/hyperref/hdvipdfm.def
@@ -7,7 +7,6 @@
%% hyperref.dtx (with options: `dvipdfm,pdfform,outlines')
%%
%% File: hyperref.dtx Copyright 1995-2001 Sebastian Rahtz,
-%% RCS: $Id: hyperref.dtx 6.71 2000/10/04 rahtz Exp rahtz $
%%
%% This file is part of the `Hyperref Bundle'.
%% -------------------------------------------
@@ -23,7 +22,7 @@
%% given in the file `manifest.txt'.
%%
\ProvidesFile{hdvipdfm.def}
- [2003/11/30 v6.74m
+ [2006/08/16 v6.75c
Hyperref driver for dvipdfm]
\def\Hy@PutCatalog#1{\@pdfm@mark{docview << #1 >>}}
\ifHy@pagelabels
@@ -57,15 +56,66 @@
}%
}
\fi
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname pdfescapestring\endcsname\relax
+ \begingroup
+ \catcode`\|=0 %
+ \@makeother\\%
+ |@firstofone{|endgroup
+ |def|Hy@pstringdef#1#2{%
+ |edef#1{#2}%
+ |@onelevel@sanitize#1%
+ |edef#1{|expandafter|Hy@ExchangeBackslash#1\|@nil}%
+ |edef#1{|expandafter|Hy@ExchangeLeftParenthesis#1(|@nil}%
+ |edef#1{|expandafter|Hy@ExchangeRightParenthesis#1)|@nil}%
+ }%
+ |def|Hy@ExchangeBackslash#1\#2|@nil{%
+ #1%
+ |ifx|\#2|\%
+ |else
+ \\%
+ |Hy@ReturnAfterFi{%
+ |Hy@ExchangeBackslash#2|@nil
+ }%
+ |fi
+ }%
+ }
+ \def\Hy@ExchangeLeftParenthesis#1(#2\@nil{%
+ #1%
+ \ifx\\#2\\%
+ \else
+ \@backslashchar(%
+ \Hy@ReturnAfterFi{%
+ \Hy@ExchangeLeftParenthesis#2\@nil
+ }%
+ \fi
+ }
+ \def\Hy@ExchangeRightParenthesis#1)#2\@nil{%
+ #1%
+ \ifx\\#2\\%
+ \else
+ \@backslashchar)%
+ \Hy@ReturnAfterFi{%
+ \Hy@ExchangeRightParenthesis#2\@nil
+ }%
+ \fi
+ }
+\else
+ \def\Hy@pstringdef#1#2{%
+ \edef#1{\pdfescapestring{#2}}%
+ }%
+\fi
\newsavebox{\pdfm@box}
\def\@pdfm@mark#1{\special{pdf:#1}}
\def\@pdfm@dest#1{%
\Hy@SaveLastskip
- \@pdfm@mark{dest (#1) [@thispage /\@pdfview\space @xpos @ypos]}%
+ \Hy@pstringdef\Hy@pstringDest{#1}%
+ \@pdfm@mark{dest (\Hy@pstringDest) [@thispage /\@pdfview\space @xpos @ypos]}%
\Hy@RestoreLastskip
}
\providecommand\@pdfview{XYZ}
\providecommand\@pdfborder{0 0 1}
+\providecommand*\@pdfborderstyle{}
\def\hyper@anchor#1{%
\@pdfm@dest{#1}%
}
@@ -81,12 +131,14 @@
\protected@edef\Hy@testname{#2}%
\ifx\Hy@testname\@empty
\let\Hy@testname\Hy@undefinedname
+ \else
+ \Hy@pstringdef\Hy@testname\Hy@testname
\fi
\@pdfm@mark{%
bann <<
/Type /Annot
/Subtype /Link
- /Border [\@pdfborder]
+ \Hy@setpdfborder
/C [\csname @#1bordercolor\endcsname]
/A <<
/S /GoTo
@@ -94,7 +146,7 @@
>>
>>
}%
- \Hy@colorlink{\csname @#1color\endcsname}%
+ \expandafter\Hy@colorlink\csname @#1color\endcsname
}
\def\hyper@linkend{%
\Hy@endcolorlink
@@ -104,58 +156,63 @@
\hyper@linkstart{#1}{#2}#3\hyper@linkend
}
\def\hyper@linkfile#1#2#3{%
+ \Hy@pstringdef\Hy@pstringF{#2}%
+ \Hy@pstringdef\Hy@pstringD{#3}%
\@pdfm@mark{%
bann <<
/Type /Annot
/Subtype /Link
- /Border [\@pdfborder]
+ \Hy@setpdfborder
/C [\@filebordercolor]
/A <<
/S /GoToR
- /F (#2)
- /D \ifx\\#3\\[0 \@pdfstartview]\else(#3)\fi\space
+ /F (\Hy@pstringF)
+ /D \ifx\\#3\\[0 \@pdfstartview]\else(\Hy@pstringD)\fi\space
\ifHy@newwindow /NewWindow true \fi
>>
>>%
}%
- \Hy@colorlink{\@filecolor}#1\Hy@endcolorlink
+ \Hy@colorlink\@filecolor#1\Hy@endcolorlink
\@pdfm@mark{eann}%
}
\def\@hyper@launch run:#1\\#2#3{% filename, anchor text linkname
+ \Hy@pstringdef\Hy@pstringF{#1}%
+ \Hy@pstringdef\Hy@pstringP{#3}%
\@pdfm@mark{%
bann <<
/Type /Annot
/Subtype /Link
- /Border [\@pdfborder]
+ \Hy@setpdfborder
/C [\@filebordercolor]
/A <<
/S /Launch
- /F (#1)
+ /F (\Hy@pstringF)
\ifHy@newwindow /NewWindow true \fi
\ifx\\#3\\%
\else
- /Win << /P (#3) /F (#1) >>
+ /Win << /P (\Hy@pstringP) /F (\Hy@pstringF) >>
\fi
>>
>>%
}%
- \Hy@colorlink{\@filecolor}#2\Hy@endcolorlink
+ \Hy@colorlink\@filecolor#2\Hy@endcolorlink
\@pdfm@mark{eann}%
}
\def\hyper@linkurl#1#2{%
+ \Hy@pstringdef\Hy@pstringURI{#2}%
\@pdfm@mark{%
bann <<
/Type /Annot
/Subtype /Link
- /Border [\@pdfborder]
+ \Hy@setpdfborder
/C [\@urlbordercolor]
/A <<
/S /URI
- /URI (#2)
+ /URI (\Hy@pstringURI)
>>
>>%
}%
- \Hy@colorlink{\@urlcolor}#1\Hy@endcolorlink
+ \Hy@colorlink\@urlcolor#1\Hy@endcolorlink
\@pdfm@mark{eann}%
}
\def\Acrobatmenu#1#2{%
@@ -167,14 +224,16 @@
/S /Named
/N /#1
>>
- /Border [\@pdfborder]
+ \Hy@setpdfborder
/C [\@menubordercolor]
>>%
}%
- \Hy@colorlink{\@menucolor}#2\Hy@endcolorlink
+ \Hy@colorlink\@menucolor#2\Hy@endcolorlink
\@pdfm@mark{eann}%
}
-\def\@pdfproducer{dvipdfm}
+\ifx\@pdfproducer\relax
+ \def\@pdfproducer{dvipdfm}
+\fi
\def\PDF@FinishDoc{%
\Hy@UseMaketitleInfos
\@pdfm@mark{%
@@ -182,8 +241,19 @@
/Title (\@pdftitle)
/Subject (\@pdfsubject)
/Creator (\@pdfcreator)
+ \ifx\@pdfcreationdate\@empty
+ \else
+ /CreationDate(\@pdfcreationdate) %
+ \fi
+ \ifx\@pdfmoddate\@empty
+ \else
+ /ModDate(\@pdfmoddate) %
+ \fi
/Author (\@pdfauthor)
- /Producer (\@pdfproducer)
+ \ifx\@pdfproducer\relax
+ \else
+ /Producer (\@pdfproducer)
+ \fi
/Keywords (\@pdfkeywords)
>>%
}%
@@ -191,6 +261,8 @@
\Hy@DisableOption{pdftitle}%
\Hy@DisableOption{pdfsubject}%
\Hy@DisableOption{pdfcreator}%
+ \Hy@DisableOption{pdfcreationdate}%
+ \Hy@DisableOption{pdfmoddate}%
\Hy@DisableOption{pdfproducer}%
\Hy@DisableOption{pdfkeywords}%
}
@@ -207,6 +279,7 @@
/NonFullScreenPageMode\@pdfnonfullscreenpagemode
\fi
}%
+ \Hy@pstringdef\Hy@pstringB{\@baseurl}%
\@pdfm@mark{%
docview <<%
\ifx\@pdfstartview\@empty
@@ -215,7 +288,7 @@
\fi
\ifx\@baseurl\@empty
\else
- /URI<</Base(\@baseurl)>>%
+ /URI<</Base(\Hy@pstringB)>>%
\fi
/PageMode \@pdfpagemode
\ifx\Hy@temp\@empty
@@ -282,6 +355,7 @@
\MakeTextField{\Fld@width}{\Fld@height}%
}%
\LayoutTextField{#2}{%
+ \Hy@escapeform\PDFForm@Text
\@pdfm@mark{%
ann @\Fld@name\space \dvipdfm@setdim << \PDFForm@Text >>%
}%
@@ -340,6 +414,7 @@
\Hy@StepCount\Fld@listcount
\@currDisplay\space
\leavevmode
+ \Hy@escapeform\PDFForm@Radio
\@pdfm@mark{%
ann \ifnum\Fld@listcount=1 @\Fld@name\space\fi
\dvipdfm@setdim
@@ -365,6 +440,7 @@
}%
\setbox\pdfm@box=\hbox{\MakeChoiceField{\Fld@width}{\Fld@height}}%
\leavevmode
+ \Hy@escapeform\PDFForm@List
\@pdfm@mark{%
ann @\Fld@name\space\dvipdfm@setdim
<< \PDFForm@List >>%
@@ -381,6 +457,7 @@
\setbox\pdfm@box=\hbox{\MakeButtonField{#2}}%
\LayoutPushButtonField{%
\leavevmode
+ \Hy@escapeform\PDFForm@Push
\@pdfm@mark{%
ann @\Fld@name\space\dvipdfm@setdim
<< \PDFForm@Push >>%
@@ -400,6 +477,7 @@
\ifFld@hidden\def\Fld@width{1sp}\fi
\setbox\pdfm@box=\hbox{\MakeButtonField{#2}}%
\leavevmode
+ \Hy@escapeform\PDFForm@Submit
\@pdfm@mark{%
ann @\Fld@name\space\dvipdfm@setdim
<< \PDFForm@Submit >>%
@@ -418,6 +496,7 @@
\ifFld@hidden\def\Fld@width{1sp}\fi
\setbox\pdfm@box=\hbox{\MakeButtonField{#2}}%
\leavevmode
+ \Hy@escapeform\PDFForm@Reset
\@pdfm@mark{%
ann @\Fld@name\space\dvipdfm@setdim
<< \PDFForm@Reset >>%
@@ -437,6 +516,7 @@
\ifFld@hidden\def\Fld@width{1sp}\fi
\setbox\pdfm@box=\hbox{\MakeCheckField{\Fld@width}{\Fld@height}}%
\LayoutCheckField{#2}{%
+ \Hy@escapeform\PDFForm@Check
\@pdfm@mark{%
ann @\Fld@name\space\dvipdfm@setdim
<< \PDFForm@Check >>%
@@ -492,10 +572,51 @@
/Encoding @OBJpdfdocencoding
>>
}
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname pdfescapestring\endcsname\relax
+ \let\Hy@escapestring\@firstofone
+ \def\Hy@escapeform#1{%
+ \ifHy@escapeform
+ \def\Hy@escapestring##1{%
+ \noexpand\Hy@escapestring{\noexpand##1}%
+ }%
+ \edef\Hy@temp{#1}%
+ \expandafter\Hy@@escapeform\Hy@temp\Hy@escapestring{}\@nil
+ \def\Hy@escapestring##1{%
+ \@ifundefined{Hy@esc@\string##1}{%
+ ##1%
+ \ThisShouldNotHappen
+ }{%
+ \csname Hy@esc@\string##1\endcsname
+ }%
+ }%
+ \else
+ \let\Hy@escapestring\@firstofone
+ \fi
+ }%
+ \def\Hy@@escapeform#1\Hy@escapestring#2#3\@nil{%
+ \ifx\\#3\\%
+ \else
+ \expandafter\Hy@pstringdef\csname Hy@esc@\string#2\endcsname{#2}%
+ \Hy@ReturnAfterFi{%
+ \Hy@@escapeform#3\@nil
+ }%
+ \fi
+ }%
+\else
+ \def\Hy@escapeform#1{%
+ \ifHy@escapeform
+ \let\Hy@escapestring\pdfescapestring
+ \else
+ \let\Hy@escapestring\@firstofone
+ \fi
+ }%
+ \Hy@escapeform{}%
+\fi
\def\PDFForm@Check{%
/Subtype /Widget
\ifFld@hidden /F 6 \else /F 4 \fi
- /T (\Fld@name)
+ /T (\Hy@escapestring{\Fld@name})
/Q \Fld@align\space
/BS << /W \Fld@borderwidth\space /S /\Fld@borderstyle\space >>
/MK <<
@@ -504,7 +625,7 @@
\else
/BG [\Fld@bcolor]
\fi
- /CA (\Fld@cbsymbol)
+ /CA (\Hy@escapestring{\Fld@cbsymbol})
>>
/DA (/ZaDb \strip@pt\Fld@charsize\space Tf \Fld@color\space rg)
/FT /Btn
@@ -514,7 +635,7 @@
\def\PDFForm@Push{%
/Subtype /Widget
\ifFld@hidden /F 6 \else /F 4 \fi
- /T (\Fld@name)
+ /T (\Hy@escapestring{\Fld@name})
/FT /Btn
/Ff 65540
/H /P
@@ -522,56 +643,56 @@
/MK <<
/BC [\Fld@bordercolor]
>>
- /A << /S /JavaScript /JS (\Fld@onclick;) >>
+ /A << /S /JavaScript /JS (\Hy@escapestring{\Fld@onclick}) >>
}
\def\Fld@additionalactions{%
/AA <<
\ifx\Fld@keystroke@code\@empty
\else
- /K << /S /JavaScript /JS (\Fld@keystroke@code) >>
+ /K << /S /JavaScript /JS (\Hy@escapestring{\Fld@keystroke@code}) >>
\fi
\ifx\Fld@format@code\@empty
\else
- /F << /S /JavaScript /JS (\Fld@format@code) >>
+ /F << /S /JavaScript /JS (\Hy@escapestring{\Fld@format@code}) >>
\fi
\ifx\Fld@validate@code\@empty
\else
- /V << /S /JavaScript /JS (\Fld@validate@code) >>
+ /V << /S /JavaScript /JS (\Hy@escapestring{\Fld@validate@code}) >>
\fi
\ifx\Fld@calculate@code\@empty
\else
- /C << /S /JavaScript /JS (\Fld@calculate@code) >>
+ /C << /S /JavaScript /JS (\Hy@escapestring{\Fld@calculate@code}) >>
\fi
\ifx\Fld@onfocus@code\@empty
\else
- /Fo << /S /JavaScript /JS (\Fld@onfocus@code) >>
+ /Fo << /S /JavaScript /JS (\Hy@escapestring{\Fld@onfocus@code}) >>
\fi
\ifx\Fld@onblur@code\@empty
\else
- /Bl << /S /JavaScript /JS (\Fld@onblur@code) >>
+ /Bl << /S /JavaScript /JS (\Hy@escapestring{\Fld@onblur@code}) >>
\fi
\ifx\Fld@onmousedown@code\@empty
\else
- /D << /S /JavaScript /JS (\Fld@onmousedown@code) >>
+ /D << /S /JavaScript /JS (\Hy@escapestring{\Fld@onmousedown@code}) >>
\fi
\ifx\Fld@onmouseup@code\@empty
\else
- /U << /S /JavaScript /JS (\Fld@onmouseup@code) >>
+ /U << /S /JavaScript /JS (\Hy@escapestring{\Fld@onmouseup@code}) >>
\fi
\ifx\Fld@onenter@code\@empty
\else
- /E << /S /JavaScript /JS (\Fld@onenter@code) >>
+ /E << /S /JavaScript /JS (\Hy@escapestring{\Fld@onenter@code}) >>
\fi
\ifx\Fld@onexit@code\@empty
\else
- /X << /S /JavaScript /JS (\Fld@onexit@code) >>
+ /X << /S /JavaScript /JS (\Hy@escapestring{\Fld@onexit@code}) >>
\fi
>>
}
\def\PDFForm@List{%
/Subtype /Widget
\ifFld@hidden /F 6 \else /F 4 \fi
- /T (\Fld@name)
+ /T (\Hy@escapestring{\Fld@name})
/FT /Ch
/Q \Fld@align\space
/BS << /W \Fld@borderwidth\space /S /\Fld@borderstyle\space >>
@@ -584,14 +705,14 @@
>>
/DA (/Helv \strip@pt\Fld@charsize\space Tf \Fld@color\space rg )
/Opt [\the\Choice@toks]
- /DV (\Fld@default)
+ /DV (\Hy@escapestring{\Fld@default})
\Fld@additionalactions
\Fld@flags
}
\def\PDFForm@Radio{%
/Subtype /Widget
\ifFld@hidden /F 6 \else /F 4 \fi
- /T (\Fld@name)
+ /T (\Hy@escapestring{\Fld@name})
/FT /Btn
/Ff 49152
/H /P
@@ -615,7 +736,7 @@
\def\PDFForm@Text{%
/Subtype /Widget
\ifFld@hidden /F 6 \else /F 4 \fi
- /T (\Fld@name)
+ /T (\Hy@escapestring{\Fld@name})
/Q \Fld@align\space
/FT /Tx
/BS << /W \Fld@borderwidth\space /S /\Fld@borderstyle\space >>
@@ -627,8 +748,8 @@
\fi
>>
/DA (/Helv \strip@pt\Fld@charsize\space Tf \Fld@color\space rg )
- /DV (\Fld@default)
- /V (\Fld@value)
+ /DV (\Hy@escapestring{\Fld@default})
+ /V (\Hy@escapestring{\Fld@value})
\Fld@additionalactions
\ifFld@multiline
\ifFld@readonly /Ff 4097 \else /Ff 4096 \fi
@@ -644,7 +765,7 @@
\def\PDFForm@Submit{%
/Subtype /Widget
\ifFld@hidden /F 6 \else /F 4 \fi
- /T (\Fld@name)
+ /T (\Hy@escapestring{\Fld@name})
/FT /Btn
/Ff 65540
/H /P
@@ -656,7 +777,7 @@
/S /SubmitForm
/F <<
/FS /URL
- /F (\Form@action)
+ /F (\Hy@escapestring{\Form@action})
>>
\ifForm@html /Flags 4 \fi
>>
@@ -664,7 +785,7 @@
\def\PDFForm@Reset{%
/Subtype /Widget
\ifFld@hidden /F 6 \else /F 4 \fi
- /T (\Fld@name)
+ /T (\Hy@escapestring{\Fld@name})
/FT /Btn
/H /P
/DA (/Helv \strip@pt\Fld@charsize\space Tf 0 0 1 rg)
@@ -675,11 +796,10 @@
/BS << /W \Fld@borderwidth\space /S /\Fld@borderstyle\space >>
/A << /S /ResetForm >>
}
-\newwrite\@outlinefile
\def\Hy@writebookmark#1#2#3#4#5{% section number, text, label, level, file
\ifx\WriteBookmarks\relax%
\else
- \ifnum#4>\c@tocdepth
+ \ifnum#4>\Hy@bookmarksdepth\relax
\else
\@@writetorep{#1}{#2}{#3}{#4}{#5}%
\fi
@@ -727,11 +847,13 @@
\let\numberline\@gobble
\fi
\pdfstringdef\Hy@tempa{#2}%
- \protected@write\@outlinefile{}{%
- \protect\BOOKMARK
- [\Hy@level][\@bookmarkopenstatus{\Hy@level}]{#3}%
- {\Hy@tempa}{\Hy@tempb}%
- }%
+ \if@filesw
+ \protected@write\@outlinefile{}{%
+ \protect\BOOKMARK
+ [\Hy@level][\@bookmarkopenstatus{\Hy@level}]{#3}%
+ {\Hy@tempa}{\Hy@tempb}%
+ }%
+ \fi
\fi
\endgroup
}
@@ -767,12 +889,13 @@
\fi
\def\@@BOOKMARK[##1][##2]##3##4##5{%
\def\Hy@temp{##4}%
+ \Hy@pstringdef\Hy@pstringName{##3}%
\@pdfm@mark{%
outline ##1 <<
/Title (\expandafter\strip@prefix\meaning\Hy@temp)
/A <<
/S /GoTo
- /D (##3)
+ /D (\Hy@pstringName)
>>
>>
}%
@@ -782,11 +905,14 @@
\InputIfFileExists{\jobname.out}{}{}%
}%
%{\escapechar\m@ne\InputIfFileExists{\jobname.out}{}{}}%
- \ifx\WriteBookmarks\relax\else
- \if@filesw\immediate\openout\@outlinefile=\jobname.out
- \ifHy@typexml
- \immediate\write\@outlinefile{<relaxxml>\relax}%
- \fi
+ \ifx\WriteBookmarks\relax
+ \else
+ \if@filesw
+ \newwrite\@outlinefile
+ \immediate\openout\@outlinefile=\jobname.out
+ \ifHy@typexml
+ \immediate\write\@outlinefile{<relaxxml>\relax}%
+ \fi
\fi
\fi
\endgroup
@@ -845,6 +971,19 @@
\Hy@org@chapter
}%
}
+\let\H@old@part\@part
+\begingroup\expandafter\expandafter\expandafter\endgroup
+\expandafter\ifx\csname chapter\endcsname\relax
+ \let\Hy@secnum@part\z@
+\else
+ \let\Hy@secnum@part\m@ne
+\fi
+\def\@part{%
+ \ifnum\Hy@secnum@part>\c@secnumdepth
+ \phantomsection
+ \fi
+ \H@old@part
+}
\let\H@old@spart\@spart
\def\@spart#1{%
\H@old@spart{#1}%