%%
%% This is file `pdfcol.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% pdfcol.dtx  (with options: `package')
%% 
%% This is a generated file.
%% 
%% Project: pdfcol
%% Version: 2007/12/12 v1.2
%% 
%% Copyright (C) 2007 by
%%    Heiko Oberdiek <heiko.oberdiek at googlemail.com>
%% 
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either
%% version 1.3c of this license or (at your option) any later
%% version. This version of this license is in
%%    http://www.latex-project.org/lppl/lppl-1-3c.txt
%% and the latest version of this license is in
%%    http://www.latex-project.org/lppl.txt
%% and version 1.3 or later is part of all distributions of
%% LaTeX version 2005/12/01 or later.
%% 
%% This work has the LPPL maintenance status "maintained".
%% 
%% This Current Maintainer of this work is Heiko Oberdiek.
%% 
%% The Base Interpreter refers to any `TeX-Format',
%% because some files are installed in TDS:tex/generic//.
%% 
%% This work consists of the main source file pdfcol.dtx
%% and the derived files
%%    pdfcol.sty, pdfcol.pdf, pdfcol.ins, pdfcol.drv, pdfcol-test1.tex,
%%    pdfcol-test2.tex, pdfcol-test3.tex, pdfcol-test4.tex.
%% 
\begingroup\catcode61\catcode48\catcode32=10\relax%
  \catcode13=5 % ^^M
  \endlinechar=13 %
  \catcode35=6 % #
  \catcode39=12 % '
  \catcode44=12 % ,
  \catcode45=12 % -
  \catcode46=12 % .
  \catcode58=12 % :
  \catcode64=11 % @
  \catcode123=1 % {
  \catcode125=2 % }
  \expandafter\let\expandafter\x\csname ver@pdfcol.sty\endcsname
  \ifx\x\relax % plain-TeX, first loading
  \else
    \def\empty{}%
    \ifx\x\empty % LaTeX, first loading,
      % variable is initialized, but \ProvidesPackage not yet seen
    \else
      \expandafter\ifx\csname PackageInfo\endcsname\relax
        \def\x#1#2{%
          \immediate\write-1{Package #1 Info: #2.}%
        }%
      \else
        \def\x#1#2{\PackageInfo{#1}{#2, stopped}}%
      \fi
      \x{pdfcol}{The package is already loaded}%
      \aftergroup\endinput
    \fi
  \fi
\endgroup%
\begingroup\catcode61\catcode48\catcode32=10\relax%
  \catcode13=5 % ^^M
  \endlinechar=13 %
  \catcode35=6 % #
  \catcode39=12 % '
  \catcode40=12 % (
  \catcode41=12 % )
  \catcode44=12 % ,
  \catcode45=12 % -
  \catcode46=12 % .
  \catcode47=12 % /
  \catcode58=12 % :
  \catcode64=11 % @
  \catcode91=12 % [
  \catcode93=12 % ]
  \catcode123=1 % {
  \catcode125=2 % }
  \expandafter\ifx\csname ProvidesPackage\endcsname\relax
    \def\x#1#2#3[#4]{\endgroup
      \immediate\write-1{Package: #3 #4}%
      \xdef#1{#4}%
    }%
  \else
    \def\x#1#2[#3]{\endgroup
      #2[{#3}]%
      \ifx#1\@undefined
        \xdef#1{#3}%
      \fi
      \ifx#1\relax
        \xdef#1{#3}%
      \fi
    }%
  \fi
\expandafter\x\csname ver@pdfcol.sty\endcsname
\ProvidesPackage{pdfcol}%
  [2007/12/12 v1.2 Handle new color stacks for pdfTeX (HO)]%
\begingroup\catcode61\catcode48\catcode32=10\relax%
  \catcode13=5 % ^^M
  \endlinechar=13 %
  \catcode123=1 % {
  \catcode125=2 % }
  \catcode64=11 % @
  \def\x{\endgroup
    \expandafter\edef\csname PDFCOL@AtEnd\endcsname{%
      \endlinechar=\the\endlinechar\relax
      \catcode13=\the\catcode13\relax
      \catcode32=\the\catcode32\relax
      \catcode35=\the\catcode35\relax
      \catcode61=\the\catcode61\relax
      \catcode64=\the\catcode64\relax
      \catcode123=\the\catcode123\relax
      \catcode125=\the\catcode125\relax
    }%
  }%
\x\catcode61\catcode48\catcode32=10\relax%
\catcode13=5 % ^^M
\endlinechar=13 %
\catcode35=6 % #
\catcode64=11 % @
\catcode123=1 % {
\catcode125=2 % }
\def\TMP@EnsureCode#1#2{%
  \edef\PDFCOL@AtEnd{%
    \PDFCOL@AtEnd
    \catcode#1=\the\catcode#1\relax
  }%
  \catcode#1=#2\relax
}
\TMP@EnsureCode{39}{12}% '
\TMP@EnsureCode{40}{12}% (
\TMP@EnsureCode{41}{12}% )
\TMP@EnsureCode{43}{12}% +
\TMP@EnsureCode{44}{12}% ,
\TMP@EnsureCode{46}{12}% .
\TMP@EnsureCode{47}{12}% /
\TMP@EnsureCode{91}{12}% [
\TMP@EnsureCode{93}{12}% ]
\TMP@EnsureCode{96}{12}% `
\edef\PDFCOL@AtEnd{\PDFCOL@AtEnd\noexpand\endinput}
\begingroup\expandafter\expandafter\expandafter\endgroup
\expandafter\ifx\csname RequirePackage\endcsname\relax
  \def\PDFCOL@RequirePackage#1[#2]{\input #1.sty\relax}%
\else
  \def\PDFCOL@RequirePackage#1[#2]{%
    \RequirePackage{#1}[{#2}]%
  }%
\fi
\PDFCOL@RequirePackage{ltxcmds}[2010/03/01]
\ltx@newif\ifpdfcolAvailable
\pdfcolAvailabletrue
\ltx@newif\ifPDFCOL@luacolor
\begingroup\expandafter\expandafter\expandafter\endgroup
\expandafter\ifx\csname ver@luacolor.sty\endcsname\relax
  \PDFCOL@luacolorfalse
\else
  \PDFCOL@luacolortrue
\fi
\PDFCOL@RequirePackage{infwarerr}[2007/09/09]
\PDFCOL@RequirePackage{ifpdf}[2007/09/09]
\ifcase\ifpdf\ifPDFCOL@luacolor 1\fi\else 1\fi0 %
  \def\PDFCOL@Message{%
    \@PackageWarningNoLine{pdfcol}%
  }%
\else
  \pdfcolAvailablefalse
  \def\PDFCOL@Message{%
    \@PackageInfoNoLine{pdfcol}%
  }%
  \PDFCOL@Message{%
    Interface disabled because of %
    \ifPDFCOL@luacolor
      package `luacolor'%
    \else
      missing PDF mode of pdfTeX%
    \fi
  }%
\fi
\ifpdfcolAvailable
  \begingroup\expandafter\expandafter\expandafter\endgroup
  \expandafter\ifx\csname pdfcolorstack\endcsname\relax
    \pdfcolAvailablefalse
    \PDFCOL@Message{%
      Interface disabled because of too old pdfTeX.\MessageBreak
      Required is version 1.40+ for \string\pdfcolorstack
    }%
  \fi
\fi
\ifpdfcolAvailable
  \begingroup\expandafter\expandafter\expandafter\endgroup
  \expandafter\ifx\csname pdfcolorstack\endcsname\relax
    \pdfcolAvailablefalse
    \PDFCOL@Message{%
      Interface disabled because of too old pdfTeX.\MessageBreak
      Required is version 1.40+ for \string\pdfcolorstackinit
    }%
  \fi
\fi
\ifpdfcolAvailable
  \begingroup\expandafter\expandafter\expandafter\endgroup
  \expandafter\ifx\csname @pdfcolorstack\endcsname\relax
    \begingroup\expandafter\expandafter\expandafter\endgroup
    \expandafter\ifx\csname ver@color.sty\endcsname\relax
      \begingroup\expandafter\expandafter\expandafter\endgroup
      \expandafter\ifx\csname documentclass\endcsname\relax
      \else
        \RequirePackage[pdftex]{color}\relax
      \fi
    \fi
    \begingroup\expandafter\expandafter\expandafter\endgroup
    \expandafter\ifx\csname @pdfcolorstack\endcsname\relax
      \pdfcolAvailablefalse
      \PDFCOL@Message{%
        Interface disabled because `pdftex.def'\MessageBreak
        is not loaded or it is too old.\MessageBreak
        Required is version 0.04b or greater%
      }%
    \fi
  \fi
\fi
\let\pdfcolAvailabletrue\relax
\let\pdfcolAvailablefalse\relax
\ifpdfcolAvailable
  \let\pdfcolErrorNoStacks\relax
  \expandafter\ifx\csname pdfcol@Value\endcsname\relax
    \def\pdfcol@Value{0 g 0 G}%
  \fi
  \expandafter\ifx\csname pdfcol@LiteralModifier\endcsname\relax
    \def\pdfcol@LiteralModifier{direct}%
  \fi
  \def\pdfcolInitStack#1{%
    \expandafter\ifx\csname pdfcol@Stack@#1\endcsname\relax
      \global\expandafter\chardef\csname pdfcol@Stack@#1\endcsname=%
          \pdfcolorstackinit\pdfcol@LiteralModifier{\pdfcol@Value}%
          \relax
      \@PackageInfo{pdfcol}{%
        New color stack `#1' = \number\csname pdfcol@Stack@#1\endcsname
      }%
    \else
      \@PackageError{pdfcol}{%
        Stack `#1' is already defined%
      }\@ehc
    \fi
  }%
  \def\pdfcolIfStackExists#1{%
    \expandafter\ifx\csname pdfcol@Stack@#1\endcsname\relax
      \expandafter\@secondoftwo
    \else
      \expandafter\@firstoftwo
    \fi
  }%
  \expandafter\ifx\csname @firstoftwo\endcsname\relax
    \long\def\@firstoftwo#1#2{#1}%
  \fi
  \expandafter\ifx\csname @secondoftwo\endcsname\relax
    \long\def\@secondoftwo#1#2{#2}%
  \fi
  \def\pdfcolSwitchStack#1{%
    \pdfcolIfStackExists{#1}{%
      \expandafter\let\expandafter\@pdfcolorstack
                      \csname pdfcol@Stack@#1\endcsname
    }{%
      \pdfcol@ErrorNoStack{#1}%
    }%
  }%
  \def\pdfcolSetCurrentColor{%
    \pdfcolorstack\@pdfcolorstack set{\current@color}%
  }%
  \def\pdfcolSetCurrent#1{%
    \ifx\\#1\\%
      \pdfcolorstack\@pdfcolorstack current\relax
    \else
      \pdfcolIfStackExists{#1}{%
        \pdfcolorstack\csname pdfcol@Stack@#1\endcsname current\relax
      }{%
        \pdfcol@ErrorNoStack{#1}%
      }%
    \fi
  }%
  \def\pdfcol@ErrorNoStack#1{%
    \@PackageError{pdfcol}{Stack `#1' does not exists}\@ehc
  }%
\else
  \def\pdfcolErrorNoStacks{%
    \@PackageError{pdfcol}{%
      Color stacks are not available%
    }{%
      Update pdfTeX (1.40) and `pdftex.def' (0.04b) %
          if necessary.\MessageBreak
      Ensure that `pdftex.def' is loaded %
          (package `color' or `xcolor').\MessageBreak
      Further messages can be found in TeX's %
          protocol file `\jobname.log'.\MessageBreak
      \MessageBreak
      \@ehc
    }%
    \global\let\pdfcolErrorNoStacks\relax
  }%
  \def\PDFCOL@Disabled{%
    \PDFCOL@Message{%
      pdfTeX's color stacks are not available%
    }%
    \global\let\PDFCOL@Disabled\relax
  }%
  \def\pdfcolInitStack#1{%
    \PDFCOL@Disabled
  }%
  \long\def\pdfcolIfStackExists#1#2#3{#3}%
  \def\pdfcolSwitchStack#1{%
    \PDFCOL@Disabled
  }%
  \def\pdfcolSetCurrentColor{%
    \PDFCOL@Disabled
  }%
  \def\pdfcolSetCurrent#1{%
    \PDFCOL@Disabled
  }%
\fi
\PDFCOL@AtEnd%
\endinput
%%
%% End of file `pdfcol.sty'.
