%%
%% This is file `xbmks.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% xbmks.dtx  (with options: `copyright,package')
%% 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% 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.       %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\NeedsTeXFormat{LaTeX2e}[1997/12/01]
\ProvidesPackage{xbmks}
 [2018/06/13 v1.1 xbmks: Cross-document bookmarks (dps)]
\RequirePackage{xkeyval}
\RequirePackage{ifpdf}[2006/02/20]
\RequirePackage{ifxetex}[2006/08/21]
\def\xbmk@driver{xbmks-pdfmark.def}
\DeclareOptionX{dvipsone}{\def\xbmk@driver{xbmks-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}}
\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
\RequirePackage{hyperref}
\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]{\setkeys{xbmksetup}{#1}%
  \ifx\x@bmks@docs\@empty
    \PackageInfo{xbmks}{The docbundle key of \string\xbmksetup\space
    is empty,\MessageBreak
    I will give it a value of `\jobname',\MessageBreak
    in hopes this is your intention}%
    \def\xbmks@next{\write@xbmks@cfg{docbundle={\jobname},#1}}\else
    \def\xbmks@next{\write@xbmks@cfg{#1}}\fi\xbmks@next
}
\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}%
    \edef\@exp@for{\noexpand\docbundle{\x@bmks@docs}}\expandafter
    \@exp@for
    \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
}
\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}}
\InputIfFileExists{xbmks.cfg}{}{}
\@ifpackageloaded{bookmark}{\PackageWarningNoLine{xbmks}{The
  bookmark package is not supported;\MessageBreak
  this package does nothing, as a result}}
{\InputIfFileExists{\xbmk@driver}{}{}}
\endinput
%%
%% End of file `xbmks.sty'.
