summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/hyperref/pdfmark.def
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex/hyperref/pdfmark.def')
-rw-r--r--Master/texmf-dist/tex/latex/hyperref/pdfmark.def386
1 files changed, 297 insertions, 89 deletions
diff --git a/Master/texmf-dist/tex/latex/hyperref/pdfmark.def b/Master/texmf-dist/tex/latex/hyperref/pdfmark.def
index 1f4d65eefec..8050bf2e0f6 100644
--- a/Master/texmf-dist/tex/latex/hyperref/pdfmark.def
+++ b/Master/texmf-dist/tex/latex/hyperref/pdfmark.def
@@ -7,7 +7,6 @@
%% hyperref.dtx (with options: `pdfmark,pdfmarkbase,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{pdfmark.def}
- [2003/11/30 v6.74m
+ [2006/08/16 v6.75c
Hyperref definitions for pdfmark specials]
\def\Hy@PutCatalog#1{%
\pdfmark{pdfmark=/PUT,Raw={\string{Catalog\string} << #1 >>}}%
@@ -59,6 +58,55 @@
}%
}
\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
\def\Hy@DistillerDestFix{%
\begingroup
\let\x\literalps@out
@@ -126,7 +174,7 @@
\else
\leavevmode\hbox\bgroup
\fi
- \Hy@colorlink{\csname @#1color\endcsname}%
+ \expandafter\Hy@colorlink\csname @#1color\endcsname
\literalps@out{H.S}%
\xdef\hyper@currentanchor{#2}%
\gdef\hyper@currentlinktype{#1}%
@@ -141,6 +189,7 @@
Dest=\hyper@currentanchor,%
AcroHighlight=\@pdfhighlight,%
Border=\@pdfborder,%
+ BorderStyle=\@pdfborderstyle,%
Color=\Hy@temp,%
Raw=H.B%
}%
@@ -217,6 +266,7 @@
linktype={#1},%
AcroHighlight=\@pdfhighlight,%
Border=\@pdfborder,%
+ BorderStyle=\@pdfborderstyle,%
pdfmark=/ANN,%
Subtype=/Link,%
Dest=\Hy@testname
@@ -226,19 +276,41 @@
\newtoks\pdf@docset
\def\PDF@FinishDoc{%
\Hy@UseMaketitleInfos
- \pdfmark{%
+ \let\Hy@temp\@empty
+ \ifx\@pdfcreationdate\@empty
+ \else
+ \def\Hy@temp{CreationDate=\@pdfcreationdate,}%
+ \fi
+ \ifx\@pdfmoddate\@empty
+ \else
+ \expandafter\def\expandafter\Hy@temp\expandafter{%
+ \Hy@temp
+ ModDate=\@pdfmoddate,%
+ }%
+ \fi
+ \ifx\@pdfproducer\relax
+ \else
+ \expandafter\def\expandafter\Hy@temp\expandafter{%
+ \Hy@temp
+ Producer=\@pdfproducer,%
+ }%
+ \fi
+ \expandafter
+ \pdfmark\expandafter{%
+ \Hy@temp
pdfmark=/DOCINFO,%
Title=\@pdftitle,%
Subject=\@pdfsubject,%
Creator=\@pdfcreator,%
Author=\@pdfauthor,%
- Producer=\@pdfproducer,%
Keywords=\@pdfkeywords
}%
\Hy@DisableOption{pdfauthor}%
\Hy@DisableOption{pdftitle}%
\Hy@DisableOption{pdfsubject}%
\Hy@DisableOption{pdfcreator}%
+ \Hy@DisableOption{pdfcreationdate}%
+ \Hy@DisableOption{pdfmoddate}%
\Hy@DisableOption{pdfproducer}%
\Hy@DisableOption{pdfkeywords}%
}
@@ -265,6 +337,7 @@
/NonFullScreenPageMode\@pdfnonfullscreenpagemode
\fi
}%
+ \Hy@pstringdef\Hy@pstringB{\@baseurl}%
\pdfmark{%
pdfmark=/PUT,%
Raw={%
@@ -279,18 +352,22 @@
\fi
\ifx\@baseurl\@empty
\else
- /URI << /Base (\@baseurl) >>%
+ /URI << /Base (\Hy@pstringB) >>%
\fi
>>%
}%
}%
}
+\newif\ifHy@pdfmarkerror
\def\pdfmark{\@ifnextchar[{\pdfmark@}{\pdfmark@[]}}
\def\pdfmark@[#1]#2{%
- \edef\@processme{\noexpand\pdf@toks={\the\pdf@defaulttoks}}%
- \@processme
- \let\pdf@type\relax
- \setkeys{PDF}{#2}%
+ \Hy@pdfmarkerrorfalse
+ \edef\@processme{\noexpand\pdf@toks={\the\pdf@defaulttoks}}%
+ \@processme
+ \let\pdf@type\relax
+ \setkeys{PDF}{#2}%
+ \ifHy@pdfmarkerror
+ \else
\ifx\pdf@type\relax
\Hy@WarningNoLine{no pdfmark type specified in #2!!}%
\ifx\\#1\\\relax\else\pdf@rect{#1}\fi
@@ -298,27 +375,41 @@
\ifx\\#1\\\relax
\literalps@out{[\the\pdf@toks\space\pdf@type\space pdfmark}%
\else
- \Hy@colorlink{\@ifundefined{@\pdf@linktype color}%
- {\@linkcolor}%
- {\csname @\pdf@linktype color\endcsname}}%
+ \@ifundefined{@\pdf@linktype color}{%
+ \Hy@colorlink\@linkcolor
+ }{%
+ \expandafter\Hy@colorlink
+ \csname @\pdf@linktype color\endcsname
+ }%
\pdf@rect{#1}%
\literalps@out{[\the\pdf@toks\space\pdf@type\space pdfmark}%
\Hy@endcolorlink
\fi
\fi
+ \fi
}
\newsavebox{\pdf@box}
+\providecommand{\Hy@setouterhbox}{\sbox}
+\providecommand{\Hy@breaklinksunhbox}{\unhbox}
\def\pdf@rect#1{%
\leavevmode
- \sbox\pdf@box{#1}%
+ \ifHy@breaklinks
+ \Hy@setouterhbox\pdf@box{#1}%
+ \else
+ \sbox\pdf@box{#1}%
+ \fi
\dimen@\ht\pdf@box
- \leavevmode
\ifdim\dp\pdf@box=\z@
\literalps@out{H.S}%
\else
\lower\dp\pdf@box\hbox{\literalps@out{H.S}}%
\fi
- \ifHy@breaklinks\unhbox\else\box\fi\pdf@box
+ \ifHy@breaklinks
+ \expandafter\Hy@breaklinksunhbox
+ \else
+ \expandafter\box
+ \fi
+ \pdf@box
\ifdim\dimen@=\z@
\literalps@out{H.R}%
\else
@@ -345,7 +436,20 @@
\def\pdf@linktype{link}
\define@key{PDF}{Raw}{\pdf@addtoksx{#1}}
\define@key{PDF}{Action}{\pdf@addtoks{#1}{Action}}
-\define@key{PDF}{Border}{\pdf@addtoks{[#1]}{Border}}
+\define@key{PDF}{Border}{%
+ \edef\Hy@temp{#1}%
+ \ifx\Hy@temp\@empty
+ \else
+ \pdf@addtoks{[#1]}{Border}%
+ \fi
+}
+\define@key{PDF}{BorderStyle}{%
+ \edef\Hy@temp{#1}%
+ \ifx\Hy@temp\@empty
+ \else
+ \pdf@addtoks{<<#1>>}{BS}%
+ \fi
+}
\define@key{PDF}{Color}{\pdf@addtoks{[#1]}{Color}}
\define@key{PDF}{Contents}{\pdf@addtoks{(#1)}{Contents}}
\define@key{PDF}{Count}{\pdf@addtoks{#1}{Count}}
@@ -353,16 +457,22 @@
\define@key{PDF}{DOSFile}{\pdf@addtoks{(#1)}{DOSFile}}
\define@key{PDF}{DataSource}{\pdf@addtoks{(#1)}{DataSource}}
\define@key{PDF}{Dest}{%
- \begingroup
- \edef\x{#1}%
- \expandafter\endgroup
- \ifx\x\@empty\else\pdf@addtoks{(#1) cvn}{Dest}\fi
+ \Hy@pstringdef\Hy@pstringDest{#1}%
+ \ifx\Hy@pstringDest\@empty
+ \Hy@pdfmarkerrortrue
+ \Hy@Warning{Destination with empty name ignored}%
+ \else
+ \pdf@addtoks{(\Hy@pstringDest) cvn}{Dest}%
+ \fi
}
\define@key{PDF}{DestAnchor}{%
- \begingroup
- \edef\x{#1}%
- \expandafter\endgroup
- \ifx\x\@empty\else\pdf@addtoks{(#1) cvn}{Dest}\fi
+ \Hy@pstringdef\Hy@pstringDest{#1}%
+ \ifx\Hy@pstringDest\@empty
+ \Hy@pdfmarkerrortrue
+ \Hy@Warning{Destination with empty name ignored}%
+ \else
+ \pdf@addtoks{(\Hy@pstringDest) cvn}{Dest}%
+ \fi
}
\define@key{PDF}{Dir}{\pdf@addtoks{(#1)}{Dir}}
\define@key{PDF}{File}{\pdf@addtoks{(#1)}{File}}
@@ -385,8 +495,9 @@
\define@key{PDF}{View}{\pdf@addtoks{[#1]}{View}}
\define@key{PDF}{WinFile}{\pdf@addtoks{(#1)}{WinFile}}
\define@key{PDF}{Author}{\pdf@addtoks{(#1)}{Author}}
-\define@key{PDF}{CreationDate}{\pdf@addtoks{(#1)}{CreationDate}}
\define@key{PDF}{Creator}{\pdf@addtoks{(#1)}{Creator}}
+\define@key{PDF}{CreationDate}{\pdf@addtoks{(#1)}{CreationDate}}
+\define@key{PDF}{ModDate}{\pdf@addtoks{(#1)}{ModDate}}
\define@key{PDF}{Producer}{\pdf@addtoks{(#1)}{Producer}}
\define@key{PDF}{Subject}{\pdf@addtoks{(#1)}{Subject}}
\define@key{PDF}{Keywords}{\pdf@addtoks{(#1)}{Keywords}}
@@ -399,20 +510,37 @@
pdfmark=/ANN,%
AcroHighlight=\@pdfhighlight,%
Border=\@pdfborder,%
+ BorderStyle=\@pdfborderstyle,%
Action={<< /Subtype /Named /N /#1 >>},%
Subtype=/Link%
}%
}
\def\PDFNextPage{\@ifnextchar[{\PDFNextPage@}{\PDFNextPage@[]}}
\def\PDFNextPage@[#1]#2{%
- \pdfmark[{#2}]{#1,Border=\@pdfborder,Color=.2 .1 .5,
- pdfmark=/ANN,Subtype=/Link,Page=/Next}}
+ \pdfmark[{#2}]{%
+ #1,%
+ Border=\@pdfborder,%
+ BorderStyle=\@pdfborderstyle,%
+ Color=.2 .1 .5,
+ pdfmark=/ANN,%
+ Subtype=/Link,%
+ Page=/Next%
+ }%
+}
\def\PDFPreviousPage{%
\@ifnextchar[{\PDFPreviousPage@}{\PDFPreviousPage@[]}%
}
\def\PDFPreviousPage@[#1]#2{%
- \pdfmark[{#2}]{#1,Border=\@pdfborder,Color=.4 .4 .1,
- pdfmark=/ANN,Subtype=/Link,Page=/Prev}}
+ \pdfmark[{#2}]{%
+ #1,%
+ Border=\@pdfborder,%
+ BorderStyle=\@pdfborderstyle,%
+ Color=.4 .4 .1,%
+ pdfmark=/ANN,%
+ Subtype=/Link,%
+ Page=/Prev%
+ }%
+}
\def\PDFOpen#1{%
\pdfmark{#1,pdfmark=/DOCVIEW}%
}
@@ -424,6 +552,7 @@
Page={#2},%
AcroHighlight=\@pdfhighlight,%
Border=\@pdfborder,%
+ BorderStyle=\@pdfborderstyle,%
Color=\@pagebordercolor,%
pdfmark=/ANN,%
Subtype=/Link%
@@ -438,6 +567,7 @@
\fi}
\def\hyper@linkurl#1#2{%
\begingroup
+ \Hy@pstringdef\Hy@pstringURI{#2}%
\hyper@chars
\leavevmode
\pdfmark[{#1}]{%
@@ -445,46 +575,56 @@
linktype=url,%
AcroHighlight=\@pdfhighlight,%
Border=\@pdfborder,%
+ BorderStyle=\@pdfborderstyle,%
Color=\@urlbordercolor,%
- Action={<< /Subtype /URI /URI (#2) >>},%
+ Action={<< /Subtype /URI /URI (\Hy@pstringURI) >>},%
Subtype=/Link%
}%
\endgroup
}
\def\hyper@linkfile#1#2#3{%
\begingroup
+ \Hy@pstringdef\Hy@pstringF{#2}%
+ \Hy@pstringdef\Hy@pstringD{#3}%
\leavevmode
\pdfmark[{#1}]{%
pdfmark=/ANN,%
Subtype=/Link,
AcroHighlight=\@pdfhighlight,%
Border=\@pdfborder,%
+ BorderStyle=\@pdfborderstyle,%
linktype=file,%
Color=\@filebordercolor,%
Action={<<
/S /GoToR
\ifHy@newwindow /NewWindow true \fi
- /F (#2)
- /D \ifx\\#3\\[0 \@pdfstartview]\else(#3) cvn\fi
+ /F (\Hy@pstringF)
+ /D \ifx\\#3\\[0 \@pdfstartview]\else(\Hy@pstringD) cvn\fi
>>}%
}%
\endgroup
}
\def\@hyper@launch run:#1\\#2#3{%
\begingroup
+ \Hy@pstringdef\Hy@pstringF{#1}%
+ \Hy@pstringdef\Hy@pstringP{#3}%
\leavevmode
\pdfmark[{#2}]{%
pdfmark=/ANN,%
Subtype=/Link,%
AcroHighlight=\@pdfhighlight,%
Border=\@pdfborder,%
+ BorderStyle=\@pdfborderstyle,%
linktype=file,%
Color=\@filebordercolor,%
Action={<<
/S /Launch
\ifHy@newwindow /NewWindow true \fi
- /F (#1)
- \ifx\\#3\\\else /Win << /P (#3) /F (#1) >> \fi
+ /F (\Hy@pstringF)
+ \ifx\\#3\\%
+ \else
+ /Win << /P (\Hy@pstringP) /F (\Hy@pstringF) >>
+ \fi
>>}%
}%
\endgroup
@@ -548,24 +688,26 @@
[ /_objdef {afields}
/type /array
/OBJ pdfmark
-[/BBox [0 0 100 100] /_objdef {Check} /BP pdfmark
-1 0 0 setrgbcolor /ZapfDingbats 80 selectfont 20 20 moveto (4) show
-[/EP pdfmark
-[/BBox [0 0 100 100] /_objdef {Cross} /BP pdfmark
-1 0 0 setrgbcolor /ZapfDingbats 80 selectfont 20 20 moveto (8) show
-[/EP pdfmark
-[/BBox [0 0 250 100] /_objdef {Submit} /BP pdfmark 0.6 setgray 0 0 250
-100 rectfill 1 setgray 2 2 moveto 2 98 lineto 248 98 lineto 246 96
-lineto 4 96 lineto 4 4 lineto fill 0.34 setgray 248 98 moveto 248 2
-lineto 2 2 lineto 4 4 lineto 246 4 lineto 246 96 lineto fill
-/Helvetica 76 selectfont 0 setgray 8 22.5 moveto (Submit) show
-[/EP pdfmark
-[/BBox [0 0 250 100] /_objdef {SubmitP} /BP pdfmark 0.6 setgray 0 0
-250 100 rectfill 0.34 setgray 2 2 moveto 2 98 lineto 248 98 lineto 246
-96 lineto 4 96 lineto 4 4 lineto fill 1 setgray 248 98 moveto 248 2
-lineto 2 2 lineto 4 4 lineto 246 4 lineto 246 96 lineto fill
-/Helvetica 76 selectfont 0 setgray 10 20.5 moveto (Submit) show
-[/EP pdfmark
+{
+ [/BBox [0 0 100 100] /_objdef {Check} /BP pdfmark
+ 1 0 0 setrgbcolor /ZapfDingbats 80 selectfont 20 20 moveto (4) show
+ [/EP pdfmark
+ [/BBox [0 0 100 100] /_objdef {Cross} /BP pdfmark
+ 1 0 0 setrgbcolor /ZapfDingbats 80 selectfont 20 20 moveto (8) show
+ [/EP pdfmark
+ [/BBox [0 0 250 100] /_objdef {Submit} /BP pdfmark 0.6 setgray 0 0 250
+ 100 rectfill 1 setgray 2 2 moveto 2 98 lineto 248 98 lineto 246 96
+ lineto 4 96 lineto 4 4 lineto fill 0.34 setgray 248 98 moveto 248 2
+ lineto 2 2 lineto 4 4 lineto 246 4 lineto 246 96 lineto fill
+ /Helvetica 76 selectfont 0 setgray 8 22.5 moveto (Submit) show
+ [/EP pdfmark
+ [/BBox [0 0 250 100] /_objdef {SubmitP} /BP pdfmark 0.6 setgray 0 0
+ 250 100 rectfill 0.34 setgray 2 2 moveto 2 98 lineto 248 98 lineto 246
+ 96 lineto 4 96 lineto 4 4 lineto fill 1 setgray 248 98 moveto 248 2
+ lineto 2 2 lineto 4 4 lineto 246 4 lineto 246 96 lineto fill
+ /Helvetica 76 selectfont 0 setgray 10 20.5 moveto (Submit) show
+ [/EP pdfmark
+} ?pdfmark
[ {aform}
<<
/Fields {afields}
@@ -609,6 +751,7 @@ lineto 2 2 lineto 4 4 lineto 246 4 lineto 246 96 lineto fill
\ifFld@hidden\def\Fld@width{1sp}\fi
\ifx\Fld@value\@empty\def\Fld@value{\Fld@default}\fi
\LayoutTextField{#2}{%
+ \Hy@escapeform\PDFForm@Text
\pdfmark[\MakeTextField{\Fld@width}{\Fld@height}]{%
pdfmark=/ANN,Raw={\PDFForm@Text}%
}%
@@ -663,6 +806,7 @@ lineto 2 2 lineto 4 4 lineto 246 4 lineto 246 96 lineto fill
\expandafter\Fld@checkequals\@curropt==\\%
\Hy@StepCount\Fld@listcount
\@currDisplay\space
+ \Hy@escapeform\PDFForm@Radio
\pdfmark[\MakeRadioField{\Fld@width}{\Fld@height}]{%
pdfmark=/ANN,%
Raw={\PDFForm@Radio /AP <</N <</\@currValue\space {Check}>> >>}%
@@ -680,6 +824,7 @@ lineto 2 2 lineto 4 4 lineto 246 4 lineto 246 96 lineto fill
\Choice@toks{\the\Choice@toks [(\@currValue) (\@currDisplay)]}%
}\@processme
}%
+ \Hy@escapeform\PDFForm@List
\pdfmark[\MakeChoiceField{\Fld@width}{\Fld@height}]{%
pdfmark=/ANN,Raw={\PDFForm@List}%
}%
@@ -691,6 +836,7 @@ lineto 2 2 lineto 4 4 lineto 246 4 lineto 246 96 lineto fill
\setkeys{Field}{#1}%
\ifFld@hidden\def\Fld@width{1sp}\fi
\LayoutPushButtonField{%
+ \Hy@escapeform\PDFForm@Push
\pdfmark[\MakeButtonField{#2}]{%
pdfmark=/ANN,Raw={\PDFForm@Push}%
}%
@@ -705,6 +851,7 @@ lineto 2 2 lineto 4 4 lineto 246 4 lineto 246 96 lineto fill
\def\Fld@name{Submit}%
\setkeys{Field}{#1}%
\ifFld@hidden\def\Fld@width{1sp}\fi
+ \Hy@escapeform\PDFForm@Submit
\pdfmark[\MakeButtonField{#2}]{%
pdfmark=/ANN,%
Raw={\PDFForm@Submit /AP << /N {Submit} /D {SubmitP} >>}%
@@ -719,6 +866,7 @@ lineto 2 2 lineto 4 4 lineto 246 4 lineto 246 96 lineto fill
\def\Fld@name{Reset}%
\setkeys{Field}{#1}%
\ifFld@hidden\def\Fld@width{1sp}\fi
+ \Hy@escapeform\PDFForm@Reset
\pdfmark[\MakeButtonField{#2}]{%
pdfmark=/ANN,Raw={\PDFForm@Reset}%
}%
@@ -734,16 +882,58 @@ lineto 2 2 lineto 4 4 lineto 246 4 lineto 246 96 lineto fill
\setkeys{Field}{#1}%
\ifFld@hidden\def\Fld@width{1sp}\fi
\LayoutCheckField{#2}{%
+ \Hy@escapeform\PDFForm@Check
\pdfmark[\MakeCheckField{\Fld@width}{\Fld@height}]{%
pdfmark=/ANN,Raw={\PDFForm@Check}%
}%
}%
\egroup
}
+\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 <<
@@ -752,7 +942,7 @@ lineto 2 2 lineto 4 4 lineto 246 4 lineto 246 96 lineto fill
\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
@@ -762,7 +952,7 @@ lineto 2 2 lineto 4 4 lineto 246 4 lineto 246 96 lineto fill
\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
@@ -770,56 +960,56 @@ lineto 2 2 lineto 4 4 lineto 246 4 lineto 246 96 lineto fill
/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 >>
@@ -832,14 +1022,14 @@ lineto 2 2 lineto 4 4 lineto 246 4 lineto 246 96 lineto fill
>>
/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
@@ -863,7 +1053,7 @@ lineto 2 2 lineto 4 4 lineto 246 4 lineto 246 96 lineto fill
\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 >>
@@ -875,8 +1065,8 @@ lineto 2 2 lineto 4 4 lineto 246 4 lineto 246 96 lineto fill
\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
@@ -892,7 +1082,7 @@ lineto 2 2 lineto 4 4 lineto 246 4 lineto 246 96 lineto fill
\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
@@ -904,7 +1094,7 @@ lineto 2 2 lineto 4 4 lineto 246 4 lineto 246 96 lineto fill
/S /SubmitForm
/F <<
/FS /URL
- /F (\Form@action)
+ /F (\Hy@escapestring{\Form@action})
>>
\ifForm@html /Flags 4 \fi
>>
@@ -912,7 +1102,7 @@ lineto 2 2 lineto 4 4 lineto 246 4 lineto 246 96 lineto fill
\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)
@@ -923,11 +1113,10 @@ lineto 2 2 lineto 4 4 lineto 246 4 lineto 246 96 lineto fill
/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
@@ -975,11 +1164,13 @@ lineto 2 2 lineto 4 4 lineto 246 4 lineto 246 96 lineto fill
\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
}
@@ -1015,10 +1206,11 @@ lineto 2 2 lineto 4 4 lineto 246 4 lineto 246 96 lineto fill
\fi
\def\@@BOOKMARK[##1][##2]##3##4##5{%
\def\Hy@temp{##4}%
+ \Hy@pstringdef\Hy@pstringName{##3}%
\pdfmark{%
pdfmark=/OUT,%
Count={##2\check@bm@number{##3}},%
- Dest={##3},%
+ Dest={\Hy@pstringName},%
Title=\expandafter\strip@prefix\meaning\Hy@temp
}%
}%
@@ -1027,11 +1219,14 @@ lineto 2 2 lineto 4 4 lineto 246 4 lineto 246 96 lineto fill
\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
@@ -1090,6 +1285,19 @@ lineto 2 2 lineto 4 4 lineto 246 4 lineto 246 96 lineto fill
\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}%