%%
%% This is file `pgfopts.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% pgfopts.dtx  (with options: `package')
%% ----------------------------------------------------------------
%% achemso --- LaTeX package options with pgfkeys
%% E-mail: joseph.wright@morningstar2.co.uk
%% Released under the LaTeX Project Public License v1.3c or later
%% See http://www.latex-project.org/lppl.txt
%% ----------------------------------------------------------------
%% 
\ProvidesClass{pgfopts}
  [2011/06/02 v2.1 LaTeX package options with pgfkeys]
\RequirePackage{pgfkeys}
\newif\ifpgfopts@process@class
\newcommand*\pgfopts@options@clist{}
\newcommand*\pgfopts@options@execute{}
\newcommand*\pgfopts@key@path{}
\newcommand\pgfopts@process@options[1]{%
  \def\pgfopts@options@clist{}%
  \def\pgfopts@options@execute{}%
  \def\pgfopts@key@path{#1/}%
  \ifx\@currext\@clsextension\else
    \expandafter\pgfopts@check@class@options
  \fi
  \pgfopts@process@local@options
  \pgfopts@options@execute
  \let\CurrentOption\@empty
  \AtEndOfPackage{\let\@unprocessedoptions\relax}%
}
\newcommand*\pgfopts@current@option{}
\newcommand*\pgfopts@check@class@options{%
  \ifpgfopts@process@class
    \ifx\@classoptionslist\relax\else
      \expandafter\expandafter\expandafter
        \pgfopts@check@class@options@aux
    \fi
  \fi
}
\newcommand*\pgfopts@check@class@options@aux{%
  \@for\pgfopts@current@option:=\@classoptionslist\do
    {%
      \pgfkeysifdefined
        {%
          \pgfopts@key@path
          \pgfopts@get@key@name\pgfopts@current@option
          /.@cmd%
        }%
        {%
          \pgfopts@list@add\pgfopts@options@clist\pgfopts@current@option
          \@expandtwoargs\@removeelement\pgfopts@current@option
            \@unusedoptionlist\@unusedoptionlist
        }%
        {}%
    }%
}
\newcommand*\pgfopts@local@options{}
\newcommand*\pgfopts@process@local@options{%
  \begingroup
    \@ifundefined{opt@\@currname.\@currext}%
      {\endgroup}%
      {%
        \toks@\expandafter\expandafter\expandafter
          {\csname opt@\@currname.\@currext\endcsname}%
        \expandafter\endgroup
        \expandafter\def\expandafter\pgfopts@local@options
          \expandafter{\the\toks@}%
        \pgfopts@process@local@options@aux@i
      }%
}
\newcommand*\pgfopts@process@local@options@aux@i{%
  \ifx\@currext\@clsextension
    \expandafter\pgfopts@process@local@options@class
  \else
    \expandafter\pgfopts@process@local@options@package
  \fi
  \ifx\pgfopts@options@clist\@empty\else
    \expandafter\pgfopts@process@local@options@aux@ii
  \fi
}
\newcommand*\pgfopts@process@local@options@aux@ii{%
  \begingroup
    \toks@\expandafter{\pgfopts@options@clist}%
    \edef\pgfopts@options@execute
      {%
        \noexpand\pgfkeys
          {%
            \pgfopts@key@path .cd,%
            \the\toks@
          }%
      }%
  \expandafter\endgroup
  \expandafter\def\expandafter\pgfopts@options@execute
    \expandafter{\pgfopts@options@execute}%
}
\newcommand*\pgfopts@process@local@options@class
  {%
    \pgfkeysifdefined{\pgfopts@key@path .unknown/.@cmd}%
      {\pgfopts@list@add\pgfopts@options@clist\@classoptionslist}
      {\pgfopts@process@local@options@class@aux}%
  }
\newcommand*\pgfopts@process@local@options@class@aux{%
  \@for\pgfopts@current@option:=\pgfopts@local@options\do{%
    \pgfkeysifdefined
      {%
        \pgfopts@key@path
        \pgfopts@get@key@name\pgfopts@current@option
        /.@cmd%
      }%
      {\pgfopts@list@add\pgfopts@options@clist\pgfopts@current@option}%
      {\pgfopts@list@add\@unusedoptionlist\pgfopts@current@option}%
  }%
}
\newcommand*\pgfopts@process@local@options@package{%
  \pgfopts@list@add\pgfopts@options@clist\pgfopts@local@options
}
\newcommand\pgfopts@get@key@name[1]{%
  \expandafter\pgfopts@get@key@name@aux#1=\@nil
}
\def\pgfopts@get@key@name@aux#1=#2\@nil{#1}
\newtoks\pgfopts@list@add@a@toks
\newtoks\pgfopts@list@add@b@toks
\newcommand*\pgfopts@list@add@temp{}
\newcommand\pgfopts@list@add[2]{%
  \pgfopts@list@add@a@toks\expandafter{#2}%
  \def\pgfopts@list@add@temp{#2}%
  \pgfopts@list@add@b@toks\expandafter{#1}%
  \ifx\pgfopts@options@clist\@empty
    \edef#1{\the\pgfopts@list@add@a@toks}%
  \else
    \ifx\pgfopts@list@add@temp\@empty\else
      \edef#1%
        {\the\pgfopts@list@add@b@toks,\the\pgfopts@list@add@a@toks}%
    \fi
  \fi
}
\newcommand*\ProcessPgfOptions{%
  \pgfopts@process@classtrue
  \pgfopts@star@check
}
\newcommand*\ProcessPgfPackageOptions{%
  \pgfopts@process@classfalse
  \pgfopts@star@check
}
\newcommand*\pgfopts@star@check{%
  \@ifstar
    {%
      \begingroup
      \edef\@tempa
        {%
          \endgroup
          \noexpand\pgfopts@process@options{/\@currname}%
        }%
      \@tempa
    }%
    {\pgfopts@process@options}%
}
\@onlypreamble\ProcessPgfOptions
\@onlypreamble\ProcessPgfPackageOptions
%% 
%% Copyright (C) 2008-2011 by
%%   Joseph Wright <joseph.wright@morningstar2.co.uk>
%% 
%% It may be distributed and/or modified under the conditions of
%% the LaTeX Project Public License (LPPL), either version 1.3c of
%% this license or (at your option) any later version.  The latest
%% version of this license is in the file:
%% 
%%    http://www.latex-project.org/lppl.txt
%% 
%% This work is "maintained" (as per LPPL maintenance status) by
%%   Joseph Wright.
%% 
%% This work consists of the file  pgfopts.dtx
%%           and the derived files pgfopts.ins and
%%                                 pgfopts.pdf.
%% 
%%
%% End of file `pgfopts.sty'.
