summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/xbmks/xbmks.dtx
blob: 8b69dd97b5e268553a2c138603437bea08dfd716 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
%\iffalse
% makeindex -s gglo.ist -o xbmks.gls xbmks.glo
% makeindex -s gind.ist -o xbmks.ind xbmks.idx
%<*copyright>
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% xbmks.sty package,                              %%
%% Copyright (C) 2016--2018                              %%
%%   dpstory@uakron.edu                                  %%
%%                                                       %%
%% This program can redistributed and/or modified under  %%
%% the terms of the LaTeX Project Public License         %%
%% Distributed from CTAN archives in directory           %%
%% macros/latex/base/lppl.txt; either version 1.2 of the %%
%% License, or (at your option) any later version.       %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%</copyright>
%<package>\NeedsTeXFormat{LaTeX2e}[1997/12/01]
%<package>\ProvidesPackage{xbmks}
%<package> [2018/06/11 v1.0 xbmks: Cross-document bookmarks (dps)]
%<*driver>
\documentclass{ltxdoc}
\usepackage[colorlinks,hyperindex=false]{hyperref}
\usepackage{fancyvrb,array,calc}
%\pdfstringdefDisableCommands{\let\\\textbackslash}
\EnableCrossrefs
\CodelineIndex
\RecordChanges
\bgroup\ttfamily
\gdef\brpr#1{\char123\relax#1\char125\relax}\egroup
\let\darg\brpr
\let\env\texttt
\let\opt\texttt
\let\pkg\textsf
\let\app\textsf
\def\visispace{\symbol{32}}
%\def\hardspace{{\fontfamily{cmtt}\selectfont\symbol{32}}}
\def\ameta#1{\ensuremath{\langle\textit{\texttt{#1}}\rangle}}
\def\meta#1{\textsl{\texttt{#1}}}
\def\SUB#1{\ensuremath{{}_{\mbox{\scriptsize\ttfamily#1}}}}
\def\cs#1{\texttt{\bslash#1}}
\DeclareRobustCommand{\tmspace}[3]{%
  \ifmmode\mskip#1#2\else\kern#1#3\fi\relax}
\renewcommand{\,}{\tmspace+\thinmuskip{.1667em}}
\let\thinspace\,
\renewcommand{\!}{\tmspace-\thinmuskip{.1667em}}
\let\negthinspace\!
\renewcommand{\:}{\tmspace+\medmuskip{.2222em}}
\let\medspace\:
\newcommand{\negmedspace}{\tmspace-\medmuskip{.2222em}}
\renewcommand{\;}{\tmspace+\thickmuskip{.2777em}}
\let\thickspace\;
\newcommand{\negthickspace}{\tmspace-\thickmuskip{.2777em}}
\makeatletter
\renewcommand{\paragraph}
    {\@startsection{paragraph}{4}{0pt}{6pt}{-3pt}
    {\normalfont\normalsize\bfseries}}
\renewenvironment{quote}[1][]
   {\def\@rgi{#1}\ifx\@rgi\@empty
    \let\rghtm\@empty\else\def\rghtm{\rightmargin\leftmargin}\fi
    \list{}{\rghtm} %{\rightmargin\leftmargin}%
    \item\relax}
   {\endlist}
\makeatother
\InputIfFileExists{aebdocfmt.def}{\PackageInfo{xbmks}{Inputting aebdocfmt.def}}
    {\def\IndexOpt{\DescribeMacro}\def\IndexKey{\DescribeMacro}\let\setupFullwidth\relax
     \PackageInfo{xbmks}{aebdocfmt.def cannot be found}}
\begin{document}
\def\CMD#1{\textbackslash#1}
  \GetFileInfo{xbmks.sty}
  \title{\textsf{xbmks}: Cross-document bookmarks}
  \author{D. P. Story\\
    Email: \texttt{dpstory@acrotex.net}}
  \date{processed \today}
  \maketitle
  \tableofcontents
  \let\Email\texttt
  \DocInput{xbmks.dtx}
\IfFileExists{\jobname.ind}{\newpage\setupFullwidth\par\PrintIndex}{\paragraph*{Index} The index goes here.\\Execute
    \texttt{makeindex -s gind.ist -o xbmks.ind xbmks.idx}\\on the command line and recompile
    \texttt{xbmks.dtx}.}
\IfFileExists{\jobname.gls}{\PrintChanges}{\paragraph*{Change History} The list of changes goes here.\\Execute
    \texttt{makeindex -s gglo.ist -o xbmks.gls xbmks.glo}\\on the command line and recompile
    \texttt{xbmks.dtx}.}
\end{document}
%</driver>
% \fi
% \MakeShortVerb{|}
%
% \InputIfFileExists{aebdonotindex.def}{\PackageInfo{web}{Inputting aebdonotindex.def}}
%    {\PackageInfo{web}{cannot find aebdonotindex.def}}
%
%    \begin{macrocode}
% Begin package
%<*package>
\RequirePackage{xkeyval}
\RequirePackage{ifpdf}[2006/02/20]
\RequirePackage{ifxetex}[2006/08/21]
%    \end{macrocode}
%
%\section{Description}
% More than a couple decades ago (counting back from 2018), I wrote two mathematics tutorials: \textsl{\href{http://www.math.uakron.edu/~dpstory/e-calculus.html}{eCalculus}} and
% \textsl{\href{http://www.math.uakron.edu/~dpstory/mpt_home.html}{Algebra Review in Ten Lessons}}. The tutorials consisted of a number of lessons, each in a separate PDF.
% The bookmarks of each lessons contained the table of contents for the whole tutorial. A student, in theory, could then
% jump from one lesson to another by selecting an entry of interest from the bookmarks. In the intervening years I have not seen
% a {\LaTeX} package for merging the table of contents of a set of PDFs and merge them in this each member of the
% set. This package attempts to do just that.
%
% \section{Drivers and options}
% We support the drivers \app{dvips} (and \app{dvipsone}), \app{pdflatex}, \app{lualatex}, and \app{xelatex}; these
% options are then named \opt{dvipsone}, \opt{dvips}, \opt{pdftex}, \opt{luatex}, and \opt{xetex}.
%    \begin{macrocode}
\def\xbmk@driver{bmks-pdfmark.def}
\DeclareOptionX{dvipsone}{\def\xbmk@driver{bmks-pdfmark.def}}
\DeclareOptionX{dvips}{\def\xbmk@driver{xbmks-pdfmark.def}}
\DeclareOptionX{pdftex}{\def\xbmk@driver{xbmks-pdftex.def}}
\DeclareOptionX{luatex}{\def\xbmk@driver{xbmks-pdftex.def}}
\DeclareOptionX{xetex}{\def\xbmk@driver{xbmks-xetex.def}}
%\AtEndOfPackage{\InputIfFileExists{\xbmk@driver}{}{}}
%    \end{macrocode}
%    \section{Process the options}
%    \begin{macrocode}
\ifpdf\ExecuteOptionsX{pdftex}\else
    \ifxetex\ExecuteOptionsX{xetex}\else
        \let\ExecuteOptions@SAVE\ExecuteOptions
        \let\ExecuteOptions\ExecuteOptionsX
        \InputIfFileExists{web.cfg}{}
        {\@ifundefined{l@tex@@@@driver}{\ExecuteOptionsX{dvips}}
            {\ExecuteOptionsX{dvipsone}}}%
        \let\ExecuteOptions\ExecuteOptions@SAVE
    \fi\fi
\ProcessOptionsX
%    \end{macrocode}
% \section{Requirements}
% The minimal requirement is \pkg{hyperref} and its built-in bookmark system. It is important to note that
% the \pkg{bookmark} package is not supported.
%    \begin{macrocode}
\RequirePackage{hyperref}
%    \end{macrocode}
%    \begin{macro}{\xbmksetup}
%    Set the cross-document options:
%\begin{quote}\ttfamily\obeylines
%\string\xbmksetup\darg{%
%\qquad docbundle=\darg{\ameta{doc\SUB1},\ameta{doc\SUB2},...,\ameta{doc\SUB{n}}},
%\qquad colors=\darg{intdoc=\ameta{color},extdoc=\ameta{color}},
%\qquad style=\darg{intbf,extbf,intit,extit}
%}
%\end{quote}
%This command must appear in one and only one of the document bundle, perhaps one
%of the documents you are calling the `main file'. It writes
%the key-values to the file \texttt{xbmks.cfg} which is then read back in by the other
%members of the document bundle, as specified by the \texttt{dobundle} key. The base names
%of the document bundle must match the name given to it by \cs{jobname}, exact spelling, case
%sensitive.
%    \begin{macrocode}
\define@key{xbmksetup}{docbundle}[]{\def\x@bmks@docs{#1}}
\let\x@bmks@docs\@empty
\define@key{xbmksetup}{colors}[]{\def\x@bmks@colors{#1}}
\let\x@bmks@colors\@empty
\define@key{xbmksetup}{style}[]{\def\x@bmks@style{#1}}
\let\x@bmks@style\@empty
\define@key{xbmk@colors}{intdoc}[]{%
  \HyColor@BookmarkColor{#1}{\xbmks@intdoc}{xbmks}{intdoc}%
  \ifx\xbmks@intdoc\@empty\else
  \edef\xbmks@intdoc{/C [\xbmks@intdoc]}\fi
}
\let\xbmks@intdoc\@empty
\define@key{xbmk@colors}{extdoc}[]{%
  \HyColor@BookmarkColor{#1}{\xbmks@extdoc}{xbmks}{extdoc}%
  \ifx\xbmks@extdoc\@empty\else
  \edef\xbmks@extdoc{/C [\xbmks@extdoc]}\fi
}
\let\xbmks@extdoc\@empty
\let\xbmks@Yes=y
\let\xbmks@No=n
\define@boolkey{xbmk@style}{intbf}[true]{} %\ifKV@xbmk@style@intbf
\define@boolkey{xbmk@style}{extbf}[true]{}
\define@boolkey{xbmk@style}{intit}[true]{}
\define@boolkey{xbmk@style}{extit}[true]{}
\newcommand{\xbmksetup}[1]{\write@xbmks@cfg{#1}}
\def\write@xbmks@cfg#1{%
  \newwrite\xbmks@setup \immediate\openout \xbmks@setup xbmks.cfg
  \set@display@protect
  \immediate\write\xbmks@setup{\protect\xbmksetupi{#1}}
  \set@typeset@protect
  \immediate\closeout\xbmks@setup
}
\newcommand{\xbmksetupi}[1]{%
  \setkeys{xbmksetup}{#1}%
  \ifx\x@bmks@docs\@empty
    \PackageWarning{xbmks}{The docbundle key is empty,\MessageBreak
    this key must have a value for cross-document bookmarks\MessageBreak
    to be generated}\else
    \edef\@exp@for{\noexpand\docbundle{\x@bmks@docs}}\expandafter
    \@exp@for\fi
    \edef\@exp@keys{\noexpand
      \setkeys{xbmk@colors}{\x@bmks@colors}}\@exp@keys
    \edef\@exp@keys{\noexpand
      \setkeys{xbmk@style}{\x@bmks@style}}\@exp@keys
      \def\xbmk@intF{}%
      \ifKV@xbmk@style@intit
        \ifKV@xbmk@style@intbf
          \def\xbmk@intF{/F 3}%
        \else
          \def\xbmk@intF{/F 1}%
        \fi
      \else
        \ifKV@xbmk@style@intbf
          \def\xbmk@intF{/F 2}%
        \fi
      \fi
      \def\xbmk@extF{}%
      \ifKV@xbmk@style@extit
        \ifKV@xbmk@style@extbf
          \def\xbmk@extF{/F 3}%
        \else
          \def\xbmk@extF{/F 1}%
        \fi
      \else
        \ifKV@xbmk@style@extbf
          \def\xbmk@extF{/F 2}%
        \fi
      \fi
}
%    \end{macrocode}
%    \end{macro}
%    \begin{macro}{\docbundle}
%    is a comma-delimited list of document base names:
%\begin{quote}\ttfamily\obeylines
%\string\docbundle\darg{\ameta{doc\SUB1},\ameta{doc\SUB2},...,\ameta{doc\SUB{n}}}
%\end{quote}
%This command is called internally by \cs{xbmksetup}.
%    \begin{macrocode}
\def\xbmk@csarg#1#2{\expandafter#1\csname#2\endcsname}
\xdef\xbmk@cnt{0}
\newcommand{\docbundle}[1]{\bgroup
  \def\thisDoc{\jobname}\count\z@=0 %
  \edef\@tmpexp{\noexpand\@for\noexpand\@arg:=#1}%
  \@tmpexp\do{%
    \advance\count\z@ by 1\relax
    \edef\@tmpexp{\noexpand\xbmk@recordDoc{\@arg}}\@tmpexp
  }%
  \xdef\xbmk@cnt{\the\count\z@}\egroup
}
\newcommand{\xbmk@recordDoc}[1]{%
  \xbmk@csarg\xdef{xbmk@doc\the\count\z@}{#1}}
%    \end{macrocode}
%    \end{macro}
%    \begin{macrocode}
% End package
%</package>
%<*pdfmark>
%    \end{macrocode}
%    \section{Driver dependent code}
%    \subsection{The pdfmark driver}
%    We redefine/modify the \cs{ReadBookmarks} command of \pkg{hyperref},
%    this definition is driver dependent.
%    \begin{macrocode}
\def\ReadBookmarks{%
  \pdf@ifdraftmode{}{%
    \begingroup
      \def\calc@bm@number##1{%
      \@tempcnta=\check@bm@number{##1}\relax
      \advance\@tempcnta by 1 %
      \expandafter\edef\csname B_##1\endcsname{\the\@tempcnta}%
      }%
      \def\do##1{%
        \ifnum\catcode`##1=\active
          \@makeother##1%
        \else
          \ifnum\catcode`##1=6 %
            \@makeother##1%
          \fi
        \fi
      }%
      \dospecials
      \Hy@safe@activestrue
      \escapechar=`\\%
      \ifx\WriteBookmarks\relax
        \global\let\WriteBookmarks\relax
      \fi
      \begingroup
        \def\WriteBookmarks{0}%
        \count\z@=0\relax
        \edef\xbmk@J{\jobname}%
        \@whilenum \count\z@<\xbmk@cnt\relax\do{%
          \advance\count\z@ by 1 %
          \edef\xbmk@thisdoc{xbmk@doc\the\count\z@}%
          \edef\xbmk@filename{\@nameuse{\xbmk@thisdoc}}%
          \@onelevel@sanitize\xbmk@filename
          \bgroup
          \def\@@BOOKMARK[##1][##2]##3##4##5{%
            \calc@bm@number{##5}%
          }%
          \InputIfFileExists{\xbmk@filename.out}{}{}%
          \def\@@BOOKMARK[##1][##2]##3##4##5{%
            \def\Hy@temp{##4}%
            \ifx\xbmk@J\xbmk@filename
              \pdfmark{%
                pdfmark=/OUT,%
                Count={##2\check@bm@number{##3}},%
                Raw={\xbmks@intdoc\xbmk@intF},%
                Dest={##3},%
                Title=\expandafter\strip@prefix\meaning\Hy@temp
              }%
            \else
              \pdfmark{%
                pdfmark=/OUT,%
                Count={##2\check@bm@number{##3}},%
                Raw={\xbmks@extdoc\xbmk@extF},%
                Action=/GoToR,%
                File={\xbmk@filename.pdf},%
                Dest={##3},%
                Title=\expandafter\strip@prefix\meaning\Hy@temp
              }%
            \fi
          }%
          \InputIfFileExists{\xbmk@filename.out}{}{}%
          \egroup
        }% \@whilenum
      \endgroup
    \endgroup
  }%
  \ifx\WriteBookmarks\relax\else
    \if@filesw
      \newwrite\@outlinefile
      \Hy@OutlineRerunCheck
     \immediate\openout\@outlinefile=\jobname.out\relax
      \ifHy@typexml
        \immediate\write\@outlinefile{<relaxxml>\relax}%
      \fi
    \fi
  \fi
}
%</pdfmark>
%    \end{macrocode}
%    \subsection{Code for pdftex/luatex driver}
%    We redefine/modify the \cs{ReadBookmarks} command of \pkg{hyperref},
%    this definition is driver dependent.
%    \begin{macrocode}
%<*pdftex>
\def\ReadBookmarks{%
  \pdf@ifdraftmode{}{%
    \begingroup
    \def\calc@bm@number##1{%
      \@tempcnta=\check@bm@number{##1}\relax
      \advance\@tempcnta by 1 %
      \expandafter\edef\csname B_##1\endcsname{\the\@tempcnta}%
    }%
    \def\Hy@OutlineName##1##2##3##4{\def\@rgi{##1}%
      \expandafter\pdfoutline\ifx\@rgi\@empty\else
      attr {##1} \fi
      user {##2} count##3{##4}%
    %  goto name{#2} count#3{#4}%
    }%
    \def\do##1{%
      \ifnum\catcode`##1=\active
        \@makeother##1%
      \else
        \ifnum\catcode`##1=6 %
          \@makeother##1%
        \fi
      \fi
    }%
    \dospecials
    \Hy@safe@activestrue
    \escapechar=`\\%
    \ifx\WriteBookmarks\relax
      \global\let\WriteBookmarks\relax
    \fi
    \begingroup
    \def\WriteBookmarks{0}%
    \count\z@=0\relax
%    \toks0=\expandafter{\jobname}%
%    \edef\xbmk@J{\the\toks0}%
    \edef\xbmk@J{\jobname}%
    \@whilenum \count\z@<\xbmk@cnt\relax\do{%
      \advance\count\z@ by 1 %
      \edef\xbmk@thisdoc{xbmk@doc\the\count\z@}%
      \edef\xbmk@filename{\@nameuse{\xbmk@thisdoc}}%
      \@onelevel@sanitize\xbmk@filename
      \bgroup
      \gdef\@@BOOKMARK[##1][##2]##3##4##5{%
        \calc@bm@number{##5}%
      }%
      \InputIfFileExists{\xbmk@filename.out}{}{}%
      \gdef\@@BOOKMARK[##1][##2]##3##4##5{%
        \def\Hy@temp{##4}%
        \Hy@pstringdef\Hy@pstringName{\HyperDestNameFilter{##3}}%
        \ifx\xbmk@J\xbmk@filename
          \Hy@OutlineName{\xbmks@intdoc\xbmk@intF}{<</S/GoTo%
            /D(\Hy@pstringName)>>}{%
            ##2\check@bm@number{\Hy@pstringName}%
          }{%
            \expandafter\strip@prefix\meaning\Hy@temp
          }%
        \else
          \Hy@OutlineName{\xbmks@extdoc\xbmk@extF}{<</S/GoToR%
            /F(\xbmk@filename.pdf)/D(\Hy@pstringName)>>}{%
            ##2\check@bm@number{##3}%
          }{%
            \expandafter\strip@prefix\meaning\Hy@temp
          }%
        \fi
      }% bookmark
      \InputIfFileExists{\xbmk@filename.out}{}{}%
      \egroup
    } % \@whilenum
    \endgroup
  }%
  \ifx\WriteBookmarks\relax
  \else
    \if@filesw
      \newwrite\@outlinefile
      \Hy@OutlineRerunCheck
      \immediate\openout\@outlinefile=\jobname.out\relax
      \ifHy@typexml
        \immediate\write\@outlinefile{<relaxxml>\relax}%
      \fi
    \fi
  \fi
}
%</pdftex>
%<*xetex>
%    \end{macrocode}
%    \subsection{Code for xetex driver}
%    We redefine/modify the \cs{ReadBookmarks} command of \pkg{hyperref},
%    this definition is driver dependent.
%    \begin{macrocode}
\def\ReadBookmarks{%
  \pdf@ifdraftmode{}{%
    \begingroup
      \def\calc@bm@number##1{%
        \@tempcnta=\check@bm@number{##1}\relax
        \advance\@tempcnta by 1 %
        \expandafter\edef\csname B_##1\endcsname{\the\@tempcnta}%
      }%
      \def\do##1{%
        \ifnum\catcode`##1=\active
          \@makeother##1%
        \else
          \ifnum\catcode`##1=6 %
            \@makeother##1%
          \fi
        \fi
      }%
      \dospecials
      \Hy@safe@activestrue
      \escapechar=`\\%
      \ifx\WriteBookmarks\relax
        \global\let\WriteBookmarks\relax
      \fi
      \begingroup
        \def\WriteBookmarks{0}%
        \count\z@=0\relax
        \edef\xbmk@J{\jobname}%
        \@whilenum \count\z@<\xbmk@cnt\relax\do{%
          \advance\count\z@ by 1 %
          \edef\xbmk@thisdoc{xbmk@doc\the\count\z@}%
          \edef\xbmk@filename{\@nameuse{\xbmk@thisdoc}}%
          \@onelevel@sanitize\xbmk@filename
          \bgroup
          \def\@@BOOKMARK[##1][##2]##3##4##5{%
            \calc@bm@number{##5}%
          }%
          \InputIfFileExists{\xbmk@filename.out}{}{}%
          \def\@@BOOKMARK[##1][##2]##3##4##5{%
            \def\Hy@temp{##4}%
            \Hy@pstringdef\Hy@pstringName{\HyperDestNameFilter{##3}}%
            \@pdfm@mark{%
              outline \ifHy@DvipdfmxOutlineOpen
                      [%
                      \ifnum##21>\z@
                      \else
                        -%
                      \fi
                      ] %
                    \fi
              ##1<<%
                /Title(\expandafter\strip@prefix\meaning\Hy@temp)%
                \ifx\xbmk@J\xbmk@filename
                  /A<<%
                    /S/GoTo%
                    /D(\Hy@pstringName)%
                  >>%
                  \xbmks@intdoc\xbmk@intF
                \else
                  /A<<%
                    /S/GoToR/F(\xbmk@filename.pdf)%
                    /D(\Hy@pstringName)%
                  >>%
                  \xbmks@extdoc\xbmk@extF
                \fi
              >>%
            }% \@pdfm@mark
          }% bookmark
          \InputIfFileExists{\xbmk@filename.out}{}{}%
          \egroup
        }% \@whilenum
      \endgroup
    \endgroup
  }%
  \ifx\WriteBookmarks\relax
  \else
    \if@filesw
      \newwrite\@outlinefile
      \Hy@OutlineRerunCheck
     \immediate\openout\@outlinefile=\jobname.out\relax
      \ifHy@typexml
        \immediate\write\@outlinefile{<relaxxml>\relax}%
      \fi
    \fi
  \fi
}
%</xetex>
%<*package>
\InputIfFileExists{xbmks.cfg}{}{}
\@ifpackageloaded{bookmark}{\PackageWarningNoLine{xbmks}{The
  bookmark package is not supported;\MessageBreak
  this package does nothing, as a result}}
{\InputIfFileExists{\xbmk@driver}{}{}}

%</package>
%    \end{macrocode}
%    \Finale