m17n-docs
[m17n/m17n-docs.git] / styles / hdvipdfm.def
1 %%
2 %% This is file `hdvipdfm.def',
3 %% generated with the docstrip utility.
4 %%
5 %% The original source files were:
6 %%
7 %% hyperref.dtx  (with options: `dvipdfm,pdfform,outlines')
8 %% 
9 %% File: hyperref.dtx Copyright 1995-2001 Sebastian Rahtz,
10 %% RCS: $Id: hyperref.dtx 6.71 2000/10/04 rahtz Exp rahtz $
11 %%
12 %% This file is part of the `Hyperref Bundle'.
13 %% -------------------------------------------
14 %%
15 %% It may be distributed under the conditions of the LaTeX Project Public
16 %% License, either version 1.2 of this license or (at your option) any
17 %% later version.  The latest version of this license is in
18 %%    http://www.latex-project.org/lppl.txt
19 %% and version 1.2 or later is part of all distributions of LaTeX
20 %% version 1999/12/01 or later.
21 %%
22 %% The list of all files belonging to the `Hyperref Bundle' is
23 %% given in the file `manifest.txt'.
24 %%
25 \ProvidesFile{hdvipdfm.def}
26   [2001/05/26 v6.71g
27   Hyperref driver for dvipdfm]
28 \def\Hy@PutCatalog#1{\@pdfm@mark{docview << #1 >>}}
29 \ifHy@pagelabels
30   \def\HyPL@StorePageLabel#1{%
31     \if@filesw
32       \begingroup
33         \edef\Hy@tempa{\the\Hy@abspage\space<< #1 >> }%
34         \immediate\write\@mainaux{%
35           \string\HyPL@Entry{\Hy@tempa}%
36         }%
37       \endgroup
38     \fi
39   }
40   \AfterBeginDocument{%
41     \if@filesw
42       \immediate\write\@mainaux{%
43         \string\providecommand\string*\string\HyPL@Entry[1]{}%
44       }%
45     \fi
46     \ifx\HyPL@Labels\@empty
47       \Hy@WarningNoLine{Rerun to get /PageLabels entry}%
48     \else
49       \HyPL@SetPageLabels
50     \fi
51     \let\HyPL@Entry\@gobble
52   }%
53   \def\HyPL@Entry#1{%
54     \expandafter\gdef\expandafter\HyPL@Labels\expandafter{%
55       \HyPL@Labels
56       #1%
57     }%
58   }
59 \fi
60 \newsavebox{\pdfm@box}
61 \def\@pdfm@mark#1{\special{pdf:#1}}
62 \def\@pdfm@dest#1{%
63   \Hy@SaveLastskip
64   \@pdfm@mark{dest (#1) [@thispage /\@pdfview\space @xpos @ypos]}%
65   \Hy@RestoreLastskip
66 }
67 \providecommand\@pdfview{XYZ}
68 \providecommand\@pdfborder{0 0 1}
69 \def\hyper@anchor#1{%
70   \@pdfm@dest{#1}%
71 }
72 \def\hyper@anchorstart#1{%
73   \Hy@activeanchortrue
74   \@pdfm@dest{#1}%
75 }
76 \def\hyper@anchorend{%
77   \Hy@activeanchorfalse
78 }
79 \def\Hy@undefinedname{UNDEFINED}
80 \def\hyper@linkstart#1#2{%
81   \protected@edef\Hy@testname{#2}%
82   \ifx\Hy@testname\@empty
83     \let\Hy@testname\Hy@undefinedname
84   \fi
85   \@pdfm@mark{%
86     bann <<
87       /Type /Annot
88       /Subtype /Link
89       /Border [\@pdfborder]
90       /C [\csname @#1bordercolor\endcsname]
91       /A <<
92         /S /GoTo
93         /D (\Hy@testname)
94       >>
95     >>
96   }%
97   \Hy@colorlink{\csname @#1color\endcsname}%
98 }
99 \def\hyper@linkend{%
100   \Hy@endcolorlink
101   \@pdfm@mark{eann}%
102 }
103 \def\hyper@link#1#2#3{%
104   \hyper@linkstart{#1}{#2}#3\hyper@linkend
105 }
106 \def\hyper@linkfile#1#2#3{%
107   \@pdfm@mark{%
108     bann <<
109       /Type /Annot
110       /Subtype /Link
111       /Border [\@pdfborder]
112       /C [\@filebordercolor]
113       /A <<
114         /S /GoToR
115         /F (#2)
116         /D \ifx\\#3\\[0 \@pdfstartview]\else(#3)\fi\space
117         \ifHy@newwindow /NewWindow true \fi
118       >>
119     >>%
120   }%
121   \Hy@colorlink{\@filecolor}#1\Hy@endcolorlink
122   \@pdfm@mark{eann}%
123 }
124 \def\@hyper@launch run:#1\\#2#3{% filename, anchor text linkname
125   \@pdfm@mark{%
126     bann <<
127       /Type /Annot
128       /Subtype /Link
129       /Border [\@pdfborder]
130       /C [\@filebordercolor]
131       /A <<
132         /S /Launch
133         /F (#1)
134         \ifHy@newwindow /NewWindow true \fi
135         \ifx\\#3\\%
136         \else
137           /Win << /P (#3) /F (#1) >>
138         \fi
139       >>
140     >>%
141   }%
142   \Hy@colorlink{\@filecolor}#2\Hy@endcolorlink
143   \@pdfm@mark{eann}%
144 }
145 \def\hyper@linkurl#1#2{%
146   \@pdfm@mark{%
147     bann <<
148       /Type /Annot
149       /Subtype /Link
150       /Border [\@pdfborder]
151       /C [\@urlbordercolor]
152       /A <<
153         /S /URI
154         /URI (#2)
155       >>
156     >>%
157   }%
158   \Hy@colorlink{\@urlcolor}#1\Hy@endcolorlink
159   \@pdfm@mark{eann}%
160 }
161 \def\Acrobatmenu#1#2{%
162   \@pdfm@mark{%
163     bann <<
164       /Type /Annot
165       /Subtype /Link
166       /A <<
167         /S /Named
168         /N /#1
169       >>
170       /Border [\@pdfborder]
171       /C [\@menubordercolor]
172     >>%
173   }%
174   \Hy@colorlink{\@menucolor}#2\Hy@endcolorlink
175   \@pdfm@mark{eann}%
176 }
177 \def\@pdfproducer{dvipdfm}
178 \def\PDF@FinishDoc{%
179   \@pdfm@mark{%
180     docinfo <<
181       /Title (\@pdftitle)
182       /Subject (\@pdfsubject)
183       /Creator (\@pdfcreator)
184       /Author (\@pdfauthor)
185       /Producer (\@pdfproducer)
186       /Keywords (\@pdfkeywords)
187     >>%
188   }%
189   \Hy@DisableOption{pdfauthor}%
190   \Hy@DisableOption{pdftitle}%
191   \Hy@DisableOption{pdfsubject}%
192   \Hy@DisableOption{pdfcreator}%
193   \Hy@DisableOption{pdfproducer}%
194   \Hy@DisableOption{pdfkeywords}%
195 }
196 \def\PDF@SetupDoc{%
197   \@pdfm@mark{%
198     docview <<
199       /Page \@pdfstartpage\space
200       /View \@pdfstartview\space
201       /URI << /Base (\@baseurl) >>
202       /PageMode \@pdfpagemode
203       /ViewerPreferences <<
204         \ifHy@toolbar\else /HideToolbar true \fi
205         \ifHy@menubar\else /HideMenubar true \fi
206         \ifHy@windowui\else /HideWindowUI true \fi
207         \ifHy@fitwindow /FitWindow true \fi
208         \ifHy@centerwindow /CenterWindow true \fi
209       >>
210       \ifx\pdf@pagelayout\@empty
211       \else
212         /PageLayout /\pdf@pagelayout\space
213       \fi
214     >>%
215   }%
216   \ifx\@pdfpagescrop\@empty
217   \else
218     \@pdfm@mark{put @pages << /CropBox [\@pdfpagescrop] >>}
219   \fi
220 }
221 \def\@Gauge[#1]#2#3#4{% parameters, label, minimum, maximum
222   \typeout{Sorry, dvipdfm does not support FORM gauges}%
223 }
224 \def\@Form[#1]{%
225   \@ifundefined{textcolor}{\let\textcolor\@gobble}{}%
226   \setkeys{Form}{#1}%
227   \@pdfm@mark{obj @afields [ ]}%
228   \@pdfm@mark{obj @corder [ ]}%
229   \@pdfm@mark{%
230     obj @aform <<
231       /Fields @afields
232       /DR << /Font << /ZaDb @OBJZaDb /Helv @OBJHelv >> >>
233       /DA (/Helv 10 Tf 0 g )
234       /CO @corder
235       /NeedAppearances true
236     >>%
237   }%
238   \@pdfm@mark{put @catalog << /AcroForm @aform >>}%
239 }
240 \def\@endForm{}
241 \def\dvipdfm@setdim{%
242   height \the\ht\pdfm@box\space
243   width  \the\wd\pdfm@box\space
244   depth  \the\dp\pdfm@box\space
245 }
246 \def\@TextField[#1]#2{% parameters, label
247   \def\Fld@name{#2}%
248   \def\Fld@default{}%
249   \let\Fld@value\@empty
250   \def\Fld@width{\DefaultWidthofText}%
251   \def\Fld@height{\DefaultHeightofText}%
252   \bgroup
253     \Field@toks={ }%
254     \setkeys{Field}{#1}%
255     \ifFld@hidden\def\Fld@width{1sp}\fi
256     \ifx\Fld@value\@empty\def\Fld@value{\Fld@default}\fi
257     \ifFld@multiline
258       \def\Fld@height{4\DefaultHeightofText}% DANGER
259     \fi
260     \setbox\pdfm@box=\hbox{%
261       \MakeTextField{\Fld@width}{\Fld@height}%
262     }%
263     \LayoutTextField{#2}{%
264       \@pdfm@mark{%
265         ann @\Fld@name\space \dvipdfm@setdim << \PDFForm@Text >>%
266       }%
267     }%
268     \unhbox\pdfm@box
269     \@pdfm@mark{put @afields @\Fld@name}% record in @afields array
270   \egroup
271 }
272 \def\@ChoiceMenu[#1]#2#3{% parameters, label, choices
273   \def\Fld@name{#2}%
274   \def\Fld@default{}%
275   \def\Fld@width{\DefaultWidthofChoiceMenu}%
276   \def\Fld@height{\DefaultHeightofChoiceMenu}%
277   \bgroup
278     \Fld@menulength=0
279     \@tempdima\z@
280     \@for\@curropt:=#3\do{%
281       \expandafter\Fld@checkequals\@curropt==\\%
282       \Hy@StepCount\Fld@menulength
283       \settowidth{\@tempdimb}{\@currDisplay}%
284       \ifdim\@tempdimb>\@tempdima\@tempdima\@tempdimb\fi
285     }%
286     \advance\@tempdima by 15\p@
287     \Field@toks={ }%
288     \setkeys{Field}{#1}%
289     \ifFld@hidden\def\Fld@width{1sp}\fi
290     \LayoutChoiceField{#2}{%
291       \ifFld@radio
292         \@@Radio{#3}%
293       \else
294         {%
295           \ifdim\Fld@width<\@tempdima
296             \ifdim\@tempdima<1cm\@tempdima1cm\fi
297             \edef\Fld@width{\the\@tempdima}%
298           \fi
299           \def\Fld@flags{}%
300           \ifFld@combo\def\Fld@flags{/Ff 917504}\fi
301           \ifFld@popdown\def\Fld@flags{/Ff 131072}\fi
302           \ifx\Fld@flags\@empty
303             \@tempdima=\the\Fld@menulength\Fld@charsize
304             \advance\@tempdima by \Fld@borderwidth bp
305             \advance\@tempdima by \Fld@borderwidth bp
306             \edef\Fld@height{\the\@tempdima}%
307           \fi
308           \@@Listbox{#3}%
309         }%
310       \fi
311     }%
312   \egroup
313 }
314 \def\@@Radio#1{%
315   \Fld@listcount=0
316   \setbox\pdfm@box=\hbox{\MakeRadioField{\Fld@width}{\Fld@height}}%
317   \@for\@curropt:=#1\do{%
318     \expandafter\Fld@checkequals\@curropt==\\%
319     \Hy@StepCount\Fld@listcount
320     \@currDisplay\space
321     \leavevmode
322     \@pdfm@mark{%
323       ann \ifnum\Fld@listcount=1 @\Fld@name\space\fi
324       \dvipdfm@setdim
325       <<
326         \PDFForm@Radio\space
327         /AP << /N << /\@currValue /null >> >>
328       >>%
329     }%
330     \unhcopy\pdfm@box\space% deliberate space between radio buttons
331     \ifnum\Fld@listcount=1\@pdfm@mark{put @afields @\Fld@name}\fi
332   }%
333 }
334 \newcount\Fld@listcount
335 \def\@@Listbox#1{%
336   \Choice@toks={ }%
337   \Fld@listcount=0
338   \@for\@curropt:=#1\do{%
339     \expandafter\Fld@checkequals\@curropt==\\%
340     \Hy@StepCount\Fld@listcount
341     \edef\@processme{%
342       \Choice@toks{\the\Choice@toks [(\@currValue) (\@currDisplay)]}%
343     }\@processme
344   }%
345   \setbox\pdfm@box=\hbox{\MakeChoiceField{\Fld@width}{\Fld@height}}%
346   \leavevmode
347   \@pdfm@mark{%
348     ann @\Fld@name\space\dvipdfm@setdim
349     << \PDFForm@List >>%
350   }%
351   \unhbox\pdfm@box
352   \@pdfm@mark{put @afields @\Fld@name}%
353 }
354 \def\@PushButton[#1]#2{% parameters, label
355   \def\Fld@name{#2}%
356   \bgroup
357     \Field@toks={ }%
358     \setkeys{Field}{#1}%
359     \ifFld@hidden\def\Fld@width{1sp}\fi
360     \setbox\pdfm@box=\hbox{\MakeButtonField{#2}}%
361     \LayoutPushButtonField{%
362       \leavevmode
363       \@pdfm@mark{%
364         ann @\Fld@name\space\dvipdfm@setdim
365         << \PDFForm@Push >>%
366       }%
367     }%
368     \unhbox\pdfm@box
369     \@pdfm@mark{put @afields @\Fld@name}%
370   \egroup
371 }
372 \def\@Submit[#1]#2{%
373   \Field@toks={ }%
374   \def\Fld@width{\DefaultWidthofSubmit}%
375   \def\Fld@height{\DefaultHeightofSubmit}%
376   \bgroup
377     \def\Fld@name{Submit}%
378     \setkeys{Field}{#1}%
379     \ifFld@hidden\def\Fld@width{1sp}\fi
380     \setbox\pdfm@box=\hbox{\MakeButtonField{#2}}%
381     \leavevmode
382     \@pdfm@mark{%
383       ann @\Fld@name\space\dvipdfm@setdim
384       << \PDFForm@Submit >>%
385     }%
386     \unhbox\pdfm@box%
387     \@pdfm@mark{put @afields @\Fld@name}%
388   \egroup
389 }
390 \def\@Reset[#1]#2{%
391   \Field@toks={ }%
392   \def\Fld@width{\DefaultWidthofReset}%
393   \def\Fld@height{\DefaultHeightofReset}%
394   \bgroup
395     \def\Fld@name{Reset}%
396     \setkeys{Field}{#1}%
397     \ifFld@hidden\def\Fld@width{1sp}\fi
398     \setbox\pdfm@box=\hbox{\MakeButtonField{#2}}%
399     \leavevmode
400     \@pdfm@mark{%
401       ann @\Fld@name\space\dvipdfm@setdim
402       << \PDFForm@Reset >>%
403     }%
404     \unhbox\pdfm@box
405     \@pdfm@mark{put @afields @\Fld@name}%
406   \egroup
407 }
408 \def\@CheckBox[#1]#2{% parameters, label
409   \def\Fld@name{#2}%
410   \def\Fld@default{0}%
411   \bgroup
412     \def\Fld@width{\DefaultWidthofCheckBox}%
413     \def\Fld@height{\DefaultHeightofCheckBox}%
414     \Field@toks={ }%
415     \setkeys{Field}{#1}%
416     \ifFld@hidden\def\Fld@width{1sp}\fi
417     \setbox\pdfm@box=\hbox{\MakeCheckField{\Fld@width}{\Fld@height}}%
418     \LayoutCheckField{#2}{%
419       \@pdfm@mark{%
420         ann @\Fld@name\space\dvipdfm@setdim
421         << \PDFForm@Check >>%
422       }%
423       \unhbox\pdfm@box
424       \@pdfm@mark{put @afields @\Fld@name}%
425     }%
426   \egroup
427 }
428 \@pdfm@mark{obj @OBJpdfdocencoding << /Type /Encoding /Differences [%
429    24 /breve /caron /circumflex /dotaccent /hungarumlaut /ogonek /ring
430       /tilde
431    39 /quotesingle
432    96 /grave
433   128 /bullet /dagger /daggerdbl /ellipsis /emdash /endash /florin
434       /fraction /guilsinglleft /guilsinglright /minus /perthousand
435       /quotedblbase /quotedblleft /quotedblright /quoteleft /quoteright
436       /quotesinglbase /trademark /fi /fl /Lslash /OE /Scaron /Ydieresis
437       /Zcaron /dotlessi /lslash /oe /scaron /zcaron
438   164 /currency
439   166 /brokenbar
440   168 /dieresis /copyright /ordfeminine
441   172 /logicalnot /.notdef /registered /macron /degree /plusminus
442       /twosuperior /threesuperior /acute /mu
443   183 /periodcentered /cedilla /onesuperior /ordmasculine
444   188 /onequarter /onehalf /threequarters
445   192 /Agrave /Aacute /Acircumflex /Atilde /Adieresis /Aring /AE
446       /Ccedilla /Egrave /Eacute /Ecircumflex /Edieresis /Igrave /Iacute
447       /Icircumflex /Idieresis /Eth /Ntilde /Ograve /Oacute /Ocircumflex
448       /Otilde /Odieresis /multiply /Oslash /Ugrave /Uacute /Ucircumflex
449       /Udieresis /Yacute /Thorn /germandbls /agrave /aacute /acircumflex
450       /atilde /adieresis /aring /ae /ccedilla /egrave /eacute
451       /ecircumflex /edieresis /igrave /iacute /icircumflex /idieresis
452       /eth /ntilde /ograve /oacute /ocircumflex /otilde /odieresis
453       /divide /oslash /ugrave /uacute /ucircumflex /udieresis /yacute
454       /thorn /ydieresis%
455   ] >>
456 }
457 \@pdfm@mark{obj @OBJZaDb
458   <<
459     /Type /Font
460     /Subtype /Type1
461     /Name /ZaDb
462     /BaseFont /ZapfDingbats
463   >>
464 }
465 \@pdfm@mark{obj @OBJHelv
466   <<
467     /Type /Font
468     /Subtype /Type1
469     /Name /Helv
470     /BaseFont /Helvetica
471     /Encoding @OBJpdfdocencoding
472   >>
473 }
474 \def\PDFForm@Check{%
475   /Subtype /Widget
476   \ifFld@hidden /F 6 \else /F 4 \fi
477   /T (\Fld@name)
478   /Q \Fld@align\space
479   /BS << /W \Fld@borderwidth\space /S /\Fld@borderstyle\space >>
480   /MK <<
481     /BC [\Fld@bordercolor]
482     \ifx\Fld@bcolor\@empty
483     \else
484       /BG [\Fld@bcolor]
485     \fi
486     /CA (\Fld@cbsymbol)
487   >>
488   /DA (/ZaDb \strip@pt\Fld@charsize\space Tf \Fld@color\space rg)
489   /FT /Btn
490   /H /P
491   \ifFld@checked /V /Yes \else /V /Off \fi
492 }
493 \def\PDFForm@Push{%
494   /Subtype /Widget
495   \ifFld@hidden /F 6 \else /F 4 \fi
496   /T (\Fld@name)
497   /FT /Btn
498   /Ff 65540
499   /H /P
500   /BS << /W \Fld@borderwidth\space /S /\Fld@borderstyle\space >>
501   /MK <<
502     /BC [\Fld@bordercolor]
503   >>
504   /A << /S /JavaScript /JS (\Fld@onclick;) >>
505 }
506 \def\PDFForm@List{%
507   /Subtype /Widget
508   \ifFld@hidden /F 6 \else /F 4 \fi
509   /T (\Fld@name)
510   /FT /Ch
511   /Q \Fld@align\space
512   /BS << /W \Fld@borderwidth\space /S /\Fld@borderstyle\space >>
513   /MK <<
514     /BC [\Fld@bordercolor]
515     \ifx\Fld@bcolor\@empty
516     \else
517       /BG [\Fld@bcolor]
518     \fi
519   >>
520   /DA (/Helv \strip@pt\Fld@charsize\space Tf \Fld@color\space rg )
521   /Opt [\the\Choice@toks]
522   /DV (\Fld@default)
523   \Fld@flags
524 }
525 \def\PDFForm@Radio{%
526   /Subtype /Widget
527   \ifFld@hidden /F 6 \else /F 4 \fi
528   /T (\Fld@name)
529   /FT /Btn
530   /Ff 49152
531   /H /P
532   /BS << /W \Fld@borderwidth\space /S /\Fld@borderstyle\space >>
533   /MK <<
534     /BC [\Fld@bordercolor]
535     \ifx\Fld@bcolor\@empty
536     \else
537       /BG [\Fld@bcolor]
538     \fi
539     /CA (H)
540   >>
541   /DA (/ZaDb \strip@pt\Fld@charsize\space Tf \Fld@color\space rg)
542   \ifx\@currValue\Fld@default
543     /V /\Fld@default\space
544   \else
545     /V /Off
546   \fi
547 }
548 \def\PDFForm@Text{%
549   /Subtype /Widget
550   \ifFld@hidden /F 6 \else /F 4 \fi
551   /T (\Fld@name)
552   /Q \Fld@align\space
553   /FT /Tx
554   /BS << /W \Fld@borderwidth\space /S /\Fld@borderstyle\space >>
555   /MK <<
556     /BC [\Fld@bordercolor]
557     \ifx\Fld@bcolor\@empty
558     \else
559       /BG [\Fld@bcolor]
560     \fi
561   >>
562   /DA (/Helv \strip@pt\Fld@charsize\space Tf \Fld@color\space rg )
563   /DV (\Fld@default)
564   /AA <<
565     \ifx\Fld@keystroke@code\@empty
566     \else
567       /K << /S /JavaScript /JS (\Fld@keystroke@code) >>
568     \fi
569     \ifx\Fld@format@code\@empty
570     \else
571       /F << /S /JavaScript /JS (\Fld@format@code) >>
572     \fi
573     \ifx\Fld@validate@code\@empty
574     \else
575       /V << /S /JavaScript /JS (\Fld@validate@code) >>
576     \fi
577     \ifx\Fld@calculate@code\@empty
578     \else
579       /C << /S /JavaScript /JS (\Fld@calculate@code) >>
580     \fi
581   >>
582   /V (\Fld@value)
583   \ifFld@multiline
584     \ifFld@readonly /Ff 4097 \else /Ff 4096 \fi
585   \else
586     \ifFld@password
587       \ifFld@readonly /Ff 8193 \else /Ff 8192 \fi
588     \fi
589   \fi
590   \ifnum\Fld@maxlen>0/MaxLen \Fld@maxlen \fi
591 }
592 \def\PDFForm@Submit{%
593   /Subtype /Widget
594   \ifFld@hidden /F 6 \else /F 4 \fi
595   /T (\Fld@name)
596   /FT /Btn
597   /Ff 65540
598   /H /P
599   /BS << /W \Fld@borderwidth\space /S /\Fld@borderstyle\space >>
600   /MK <<
601     /BC [\Fld@bordercolor]
602   >>
603   /A <<
604     /S /SubmitForm
605     /F <<
606       /FS /URL
607       /F (\Form@action)
608     >>
609     \ifForm@html /Flags 4 \fi
610   >>
611 }
612 \def\PDFForm@Reset{%
613   /Subtype /Widget
614   \ifFld@hidden /F 6 \else /F 4 \fi
615   /T (\Fld@name)
616   /FT /Btn
617   /H /P
618   /DA (/Helv \strip@pt\Fld@charsize\space Tf 0 0 1 rg)
619   /Ff 65540
620   /MK <<
621     /BC [\Fld@bordercolor]
622   >>
623   /BS << /W \Fld@borderwidth\space /S /\Fld@borderstyle\space >>
624   /A << /S /ResetForm >>
625 }
626 \newwrite\@outlinefile
627 \def\Hy@writebookmark#1#2#3#4#5{% section number, text, label, level, file
628  \ifx\WriteBookmarks\relax%
629  \else
630   \ifnum#4>\c@tocdepth
631   \else
632    \@@writetorep{#1}{#2}{#3}{#4}{#5}%
633   \fi
634  \fi}
635 \def\Hy@currentbookmarklevel{0}
636 \def\Hy@numberline#1{#1 }
637 \def\@@writetorep#1#2#3#4#5{%
638   \begingroup
639     \def\Hy@tempa{#5}%
640     \ifx\Hy@tempa\Hy@bookmarkstype
641       \edef\Hy@level{#4}%
642       \ifx\Hy@levelcheck Y%
643         \@tempcnta\Hy@level\relax
644         \advance\@tempcnta by -1
645         \ifnum\Hy@currentbookmarklevel<\@tempcnta
646           \advance\@tempcnta by -\Hy@currentbookmarklevel\relax
647           \advance\@tempcnta by 1
648           \Hy@Warning{%
649             Difference (\the\@tempcnta) between bookmark levels is %
650             greater \MessageBreak than one, level fixed%
651           }%
652           \@tempcnta\Hy@currentbookmarklevel
653           \advance\@tempcnta by 1
654           \edef\Hy@level{\the\@tempcnta}%
655         \fi
656       \else
657         \global\let\Hy@levelcheck Y%
658       \fi
659       \global\let\Hy@currentbookmarklevel\Hy@level
660       \@tempcnta\Hy@level\relax
661       \expandafter\xdef\csname Parent\Hy@level\endcsname{#3}%
662       \advance\@tempcnta by -1
663       \edef\Hy@tempa{#3}%
664       \edef\Hy@tempb{\csname Parent\the\@tempcnta\endcsname}%
665       \ifx\Hy@tempa\Hy@tempb
666         \Hy@Warning{%
667           The anchor of a bookmark and its parent's must not%
668           \MessageBreak be the same. Added a new anchor%
669         }%
670         \phantomsection
671       \fi
672       \ifHy@bookmarksnumbered
673         \let\numberline\Hy@numberline
674       \else
675         \let\numberline\@gobble
676       \fi
677       \pdfstringdef\Hy@tempa{#2}%
678       \protected@write\@outlinefile{}{%
679         \protect\BOOKMARK
680           [\Hy@level][\@bookmarkopenstatus{\Hy@level}]{#3}%
681           {\Hy@tempa}{\Hy@tempb}%
682       }%
683     \fi
684   \endgroup
685 }
686 \newcommand{\currentpdfbookmark}{%
687   \pdfbookmark[\Hy@currentbookmarklevel]%
688 }
689 \newcommand{\subpdfbookmark}{%
690   \@tempcnta\Hy@currentbookmarklevel
691   \Hy@StepCount\@tempcnta
692   \expandafter\pdfbookmark\expandafter[\the\@tempcnta]%
693 }
694 \newcommand{\belowpdfbookmark}[2]{%
695   \@tempcnta\Hy@currentbookmarklevel
696   \Hy@StepCount\@tempcnta
697   \expandafter\pdfbookmark\expandafter[\the\@tempcnta]{#1}{#2}%
698   \advance\@tempcnta by -1
699   \xdef\Hy@currentbookmarklevel{\the\@tempcnta}%
700 }
701 \renewcommand\pdfbookmark[3][0]{%
702   \Hy@writebookmark{}{#2}{#3.#1}{#1}{toc}%
703   \hyper@anchorstart{#3.#1}\hyper@anchorend
704 }
705 \def\BOOKMARK{\@ifnextchar[{\@BOOKMARK}{\@@BOOKMARK[1][-]}}
706 \def\@BOOKMARK[#1]{\@ifnextchar[{\@@BOOKMARK[#1]}{\@@BOOKMARK[#1][-]}}
707 \def\ReadBookmarks{%
708   \begingroup
709     \escapechar=`\\%
710     \let\escapechar\@gobble %
711     \def\@@BOOKMARK [##1][##2]##3##4##5{\calc@bm@number{##5}}%
712     \InputIfFileExists{\jobname.out}{}{}%
713     \ifx\WriteBookmarks\relax
714       \global\let\WriteBookmarks\relax
715     \fi
716     \def\@@BOOKMARK[##1][##2]##3##4##5{%
717       \def\Hy@temp{##4}%
718       \@pdfm@mark{%
719         outline ##1 <<
720           /Title (\expandafter\strip@prefix\meaning\Hy@temp)
721           /A <<
722             /S /GoTo
723             /D (##3)
724           >>
725         >>
726       }%
727    }%
728    {%
729     \def\WriteBookmarks{0}%
730     \InputIfFileExists{\jobname.out}{}{}%
731    }%
732    %{\escapechar\m@ne\InputIfFileExists{\jobname.out}{}{}}%
733    \ifx\WriteBookmarks\relax\else
734      \if@filesw\immediate\openout\@outlinefile=\jobname.out
735       \ifHy@typexml
736        \immediate\write\@outlinefile{<relaxxml>\relax}%
737       \fi
738      \fi
739    \fi
740    \endgroup
741 }
742 \def\check@bm@number#1{%
743   \expandafter\ifx\csname B_#1\endcsname\relax
744     0%
745   \else
746     \csname B_#1\endcsname
747   \fi
748 }
749 \def\calc@bm@number#1{%
750   \@tempcnta=\check@bm@number{#1}\relax
751   \advance\@tempcnta by1
752   \expandafter\xdef\csname B_#1\endcsname{\the\@tempcnta}%
753 }
754 \ifHy@implicit
755 \else
756   \def\@begindvi{%
757     \unvbox\@begindvibox
758     \HyPL@EveryPage
759     \global\let\@begindvi\HyPL@EveryPage
760   }%
761   \expandafter\endinput
762 \fi
763 \let\H@old@ssect\@ssect
764 \def\@ssect#1#2#3#4#5{%
765   \H@old@ssect{#1}{#2}{#3}{#4}{#5}%
766   \phantomsection
767 }
768 \let\H@old@schapter\@schapter
769 \def\@schapter#1{%
770   \H@old@schapter{#1}%
771   \begingroup
772     \let\@mkboth\@gobbletwo
773     \Hy@GlobalStepCount\Hy@linkcounter
774     \xdef\@currentHref{\Hy@chapapp*.\the\Hy@linkcounter}%
775     \Hy@raisedlink{\hyper@anchorstart{\@currentHref}\hyper@anchorend}%
776   \endgroup
777 }
778 \@ifundefined{@chapter}{}{%
779   \let\Hy@org@chapter\@chapter
780   \def\@chapter{%
781     \def\Hy@next{%
782       \Hy@GlobalStepCount\Hy@linkcounter
783       \xdef\@currentHref{\Hy@chapapp*.\the\Hy@linkcounter}%
784       \Hy@raisedlink{\hyper@anchorstart{\@currentHref}\hyper@anchorend}%
785     }%
786     \ifnum\c@secnumdepth>\m@ne
787       \@ifundefined{if@mainmatter}%
788       \iftrue{\csname if@mainmatter\endcsname}
789         \let\Hy@next\relax
790       \fi
791     \fi
792     \Hy@next
793     \Hy@org@chapter
794   }%
795 }
796 \let\H@old@spart\@spart
797 \def\@spart#1{%
798   \H@old@spart{#1}%
799   \Hy@GlobalStepCount\Hy@linkcounter
800   \xdef\@currentHref{part*.\the\Hy@linkcounter}%
801   \Hy@raisedlink{\hyper@anchorstart{\@currentHref}\hyper@anchorend}%
802 }
803 \let\H@old@sect\@sect
804 \def\@sect#1#2#3#4#5#6[#7]#8{%
805   \ifnum #2>\c@secnumdepth
806     \Hy@GlobalStepCount\Hy@linkcounter
807     \xdef\@currentHref{section*.\the\Hy@linkcounter}%
808   \fi
809   \H@old@sect{#1}{#2}{#3}{#4}{#5}{#6}[{#7}]{#8}%
810   \ifnum #2>\c@secnumdepth
811     \Hy@raisedlink{\hyper@anchorstart{\@currentHref}\hyper@anchorend}%
812   \fi
813 }
814 \expandafter\def\csname Parent-4\endcsname{}
815 \expandafter\def\csname Parent-3\endcsname{}
816 \expandafter\def\csname Parent-2\endcsname{}
817 \expandafter\def\csname Parent-1\endcsname{}
818 \expandafter\def\csname Parent0\endcsname{}
819 \expandafter\def\csname Parent1\endcsname{}
820 \expandafter\def\csname Parent2\endcsname{}
821 \expandafter\def\csname Parent3\endcsname{}
822 \expandafter\def\csname Parent4\endcsname{}
823 \def\Hy@tempa{%
824   \def\@addchap[##1]##2{%
825     \typeout{##2}%
826     \if@twoside
827       \@mkboth{##1}{}%
828     \else
829       \@mkboth{}{##1}%
830     \fi
831     \addtocontents{lof}{\protect\addvspace{10\p@}}%
832     \addtocontents{lot}{\protect\addvspace{10\p@}}%
833     \Hy@GlobalStepCount\Hy@linkcounter
834     \xdef\@currentHref{\Hy@chapapp*.\the\Hy@linkcounter}%
835     \Hy@raisedlink{\hyper@anchorstart{\@currentHref}\hyper@anchorend}%
836     \if@twocolumn
837        \@topnewpage[\@makeschapterhead{##2}]%
838     \else
839        \@makeschapterhead{##2}%
840        \@afterheading
841     \fi
842     \addcontentsline{toc}{chapter}{##1}%
843   }%
844 }
845 \@ifclassloaded{scrbook}{%
846   \@ifclasslater{scrbook}{2001/01/01}{%
847     \let\Hy@tempa\@empty
848   }{}%
849 }{%
850   \@ifclassloaded{scrreprt}{%
851     \@ifclasslater{scrreprt}{2001/01/01}{%
852       \let\Hy@tempa\@empty
853     }{}%
854   }{%
855     \let\Hy@tempa\@empty
856   }%
857 }%
858 \Hy@tempa
859 \endinput
860 %%
861 %% End of file `hdvipdfm.def'.