%%
%% This is file `subfig.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% subfig.dtx  (with options: `package')
%% 
%% Copyright © 2003, 2004, 2005 Steven Douglas Cochran.
%% 
%% This file is NOT the source for the subfig package, because almost
%% all comments have been stripped from it.  It is NOT the preferred form
%% of the subfig package for making modifications to it.
%% 
%% Therefore you can NOT redistribute and/or modify THIS file.  You can
%% however redistribute the complete source package (README, Makefile,
%% subfig.dtx, subfig.ins, and subfig.pdf as well as the test/example
%% files test[1-7].tex) and/or modify it under the terms of the LaTeX Project
%% Public License, either version 1.3 of this license or (at your option)
%% any later version.
%% 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 2003/12/01 or later.
%% 
%% This work has the LPPL maintenance status "author-maintained".
%% 
%% This Current Maintainer of this work is Steven Douglas Cochran.
%% 
%% This work consists of all files listed under "MANIFEST" in the
%% README file distributed with the subfig package.
%% 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% @LaTeX-style-file{
%%    author     = "Steven Douglas Cochran",
%%    version    = "1.3",
%%    date       = "2005/07/05",
%%    time       = "04:19:08",
%%    filename   = "subfig.sty",
%%    address    = "Digital Mapping Laboratory,
%%                  School of Computer Science
%%                  Carnegie-Mellon University,
%%                  5000 Forbes Avenue
%%                  Pittsburgh, PA 15213-3890
%%                  USA",
%%    telephone  = "+1 412.268.5654",
%%    fax        = "+1 412.268.5576",
%%    email      = "cochran@ieee.org",
%%    codetable  = "ISO/ASCII",
%%    keywords   = "LaTeX, float, sub-float, continued figure",
%%    supported  = "yes",
%%    abstract   = "LaTeX package for providing support for the
%%                  inclusion of small, `sub', figures and tables.  It
%%                  simplifies the positioning, captioning and
%%                  labeling of them within a single figure or table
%%                  environment.  In addition, this package allows
%%                  such sub-captions to be written to the List of
%%                  Figures or List of Tables if desired."
%% }
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


\NeedsTeXFormat{LaTeX2e}[1995/06/01]
\ProvidesPackage{subfig}[2005/06/28 ver: 1.3 subfig package]
\def\sf@floatfix#1#2{%
  \ifx#1#2%
    \ifx#1\@undefined\else
      \PackageWarningNoLine{subfig}{%
Your document class has a bad definition^^J
of \string#1, most likely^^J
\string\let\string#1=\string#2^^J
which has now been changed to^^J
\string\def\string#1{\string#2}^^J
because otherwise subsequent changes to \string#2^^J
(like done by several packages changing float behaviour)^^J
can't take effect on \string#1.^^J
Please complain to your document class author}%
      \def#1{#2}%
    \fi
  \fi}
\begingroup
\def\next#1#2{%
    \endgroup
  \sf@floatfix\endfigure\end@float
  \sf@floatfix\endtable\end@float
  \sf@floatfix#1\end@dblfloat
  \sf@floatfix#2\end@dblfloat}
\expandafter\next\csname endfigure*\expandafter\endcsname
  \csname endtable*\endcsname
\RequirePackage{keyval}[1999/03/16]
\def\sf@ifinlist#1#2{%
  \let\next\@secondoftwo
  \edef\caption@tempa{#1}%
  \@for\caption@tempb:={#2}\do{%
    \ifx\caption@tempa\caption@tempb
      \let\next\@firstoftwo
    \fi}%
  \next}
\def\sf@setbool#1#2{%
  \sf@ifinlist{#2}{1,true,yes,on}{%
    \@nameuse{#1true}%
  }{\sf@ifinlist{#2}{0,false,no,off}{%
    \@nameuse{#1false}%
  }{%
    \PackageError{subfig}{Undefined boolean value `#2'}{\@ehc}%
  }}}
\def\sf@split#1=#2=#3\relax{%
  \KV@@sp@def\@tempa{#1}%
  \ifx\@tempa\@empty
  \else\ifx\@tempa\KV@caption
    \sf@usecaptionfoundtrue
    \ifx\@empty#3\@empty
      \sf@usecaptiontrue
    \else
      \KV@@sp@def\@tempb{#2}%
      \sf@setbool{sf@usecaption}{\@tempb}%
    \fi
  \fi\fi}
\def\KV@caption{caption}
\newif\ifsf@usecaptionfound
\sf@usecaptionfoundfalse
\newif\ifsf@usecaption
\sf@usecaptiontrue
\edef\sf@temp{\@ptionlist{\@currname.\@currext}}
\let\caption@tempa\@empty
\@for\CurrentOption:=\sf@temp\do{%
  \expandafter\sf@split\CurrentOption==\relax}
\ifsf@usecaption
  \@ifpackageloaded{caption}{%
    \ifsf@usecaptionfound
      \PackageWarning{subfig}{%
          You cannot set the `caption' option here if the\MessageBreak
          caption package is already loaded (the option\MessageBreak
          `caption=true' is ignored)}%
    \fi
  }{%
    \RequirePackage{caption}[2005/06/28]
  }%
\else
  \RequirePackage{caption3}[2005/06/11]
\fi
\def\sf@ifpositiontop{%
  \ifx\caption@position\@firstoftwo \let\next\@firstoftwo \else
  \let\next\@secondoftwo \fi \next}
\def\DeclareCaptionListOfFormat#1{%
  \@namedef{caption@lstfmt@#1}##1##2}
\@onlypreamble\DeclareCaptionListOfFormat
\def\caption@setlistofformat#1{%
  \@ifundefined{caption@lstfmt@#1}{%
    \PackageError
      {subfig}%
      {Undefined caption list-of format `#1'}%
      {\caption@eh}%
  }{%
   \expandafter\let\expandafter\caption@lstfmt
         \csname caption@lstfmt@#1\endcsname}}
\DeclareCaptionListOfFormat{empty}{}
\DeclareCaptionListOfFormat{simple}{#1#2}
\DeclareCaptionListOfFormat{parens}{#1(#2)}
\DeclareCaptionListOfFormat{subsimple}{#2}
\DeclareCaptionListOfFormat{subparens}{(#2)}
\DeclareCaptionOption{listofformat}{\caption@setlistofformat{#1}}
\def\sf@indent{3.8em}
\define@key{caption}{listofindent}[3.8em]{\def\sf@indent{#1}}
\def\sf@numwidth{2.5em}
\define@key{caption}{listofnumwidth}[2.5em]{\def\sf@numwidth{#1}}
\def\DeclareSubrefFormat#1{%
  \@namedef{caption@subreffmt@#1}##1##2##3##4}
\@onlypreamble\DeclareSubrefFormat
\def\caption@setsubrefformat#1{%
  \@ifundefined{caption@subreffmt@#1}{%
    \PackageError
      {subfig}%
      {Undefined subref format `#1'}%
      {\caption@eh}%
  }{%
   \expandafter\let\expandafter\caption@subreffmt
         \csname caption@subreffmt@#1\endcsname}}
\DeclareSubrefFormat{empty}{}
\DeclareSubrefFormat{simple}{#1#2}
\DeclareSubrefFormat{parens}{#1(#2)}
\DeclareSubrefFormat{subsimple}{#2}
\DeclareSubrefFormat{subparens}{(#2)}
\DeclareCaptionOption{subrefformat}{\caption@setsubrefformat{#1}}
\newcounter{KVtest}
\def\KV@config{config}
\def\sf@split#1=#2=#3\relax{%
  \setcounter{KVtest}{1}%
  \KV@@sp@def\@tempa{#1}%
  \ifx\@tempa\@empty
  \else\ifx\@tempa\KV@caption
    \setcounter{KVtest}{2}%
  \else\ifx\@tempa\KV@config
    \setcounter{KVtest}{2}%
    \expandafter\let\expandafter\@tempc
        \csname\KV@prefix\@tempa\endcsname
    \ifx\@tempc\relax
      \KV@errx
          {\@tempa\space undefined}%
    \else\ifx\@empty#3\@empty
      \KV@default
    \else
      \KV@@sp@def\@tempb{#2}%
      \expandafter\@tempc\expandafter{\@tempb}\relax
    \fi\fi
  \fi\fi\fi}
\def\ProcessPackageOptions{%
  \def\KV@prefix{KV@\@currname @}%
  \let\@tempc\relax
  \let\caption@tempa\@empty
  \@for\CurrentOption:=\@classoptionslist\do{%
    \@ifundefined{KV@caption@\CurrentOption}{}{%
      \edef\caption@tempa{\caption@tempa,\CurrentOption,}%
      \@expandtwoargs\@removeelement\CurrentOption
        \@unusedoptionlist\@unusedoptionlist}}%
  \edef\caption@tempb{\@ptionlist{\@currname.\@currext}}%
  \@for\CurrentOption:=\caption@tempb\do{%
    \expandafter\sf@split\CurrentOption==\relax
    \ifnum\c@KVtest<2\relax
      \edef\caption@tempa{\caption@tempa,\CurrentOption,}%
    \fi}%
  \edef\caption@tempa{%
    \noexpand\captionsetup[subfloat]{\caption@tempa}}%
  \caption@tempa}
\def\@dottedxxxline#1#2#3#4#5#6#7{%
  \begingroup
    \@ifundefined{caption@setfloattype}%
      \caption@settype
      \caption@setfloattype
          {#1}
    \caption@settype{subfloat}%
    \caption@settype{sub#1}%
    \ifnum #3>\@nameuse{c@#2depth}\else
      \@dottedtocline{\z@}{#4}{#5}{#6}{#7}%
    \fi
  \endgroup}
\newif\ifmaincaptiontop
\def\newsubfloat{%
  \@ifnextchar[  %] bracket matching
    {\@newsubfloat}
    {\@newsubfloat[]}}
\def\@newsubfloat[#1]#2{%
  \@ifundefined{c@sub#2}{%
    \newcounter{sub#2}[#2]
    \newcounter{sub#2@save}%
    \@namedef{sub#2name}{}%
    \@namedef{p@sub#2}{\@nameuse{the#2}}%
    \@namedef{thesub#2}{\alph{sub#2}}%
    \@namedef{ext@sub#2}{\@nameuse{ext@#2}}%
    \@namedef{l@sub#2}{%
        \@dottedxxxline{#2}%
            {\@nameuse{ext@sub#2}}{2}{\sf@indent}{\sf@numwidth}}%
    \@ifundefined{c@\@nameuse{ext@#2}depth}{%
      \expandafter\newcounter\expandafter{\@nameuse{ext@#2}depth}%
      \expandafter\addtocounter\expandafter{\@nameuse{ext@#2}depth}\@ne}{}%
    \@namedef{KV@caption@\@nameuse{ext@#2}depth@default\expandafter}%
        \expandafter{\csname KV@caption@\@nameuse{ext@#2}depth\endcsname{2}}%
    \@namedef{KV@caption@\@nameuse{ext@#2}depth}##1{%
        \setcounter{\@nameuse{ext@#2}depth}{##1}}%
    \edef\sf@counterlist{%
      \@ifundefined{sf@counterlist}{}%
        {\sf@counterlist,}sub#2}%
    \captionsetup[sub#2]{#1}%
  }{%
    \PackageWarning{subfig}{%
        The sub#2\space type is already defined.}%
  }}
\@onlypreamble\@newsubfloat
\@onlypreamble\newsubfloat
\newskip\sf@farskip
\sf@farskip 10\p@
\define@key{caption}{farskip}[10\p@]{\sf@farskip=#1}
\newdimen\sf@captopadj
\sf@captopadj \z@
\define@key{caption}{topadjust}[\z@]{\sf@captopadj=#1}
\newskip\sf@capskip
\sf@capskip 4\p@
\define@key{caption}{captionskip}[4\p@]{\sf@capskip=#1}
\newskip\sf@nearskip
\sf@nearskip \z@
\define@key{caption}{nearskip}[5\p@]{\sf@nearskip=#1}
\let\sf@old@caption\@caption
\def\@caption{\caption@}
\captionsetup[subfloat]{%
    font=footnotesize,
    labelformat=parens,labelsep=space,
    listofformat=subparens,subrefformat=subsimple}
\define@key{subfig}{config}[subfig]{%
  \InputIfFileExists{#1.cfg}{%
    \typeout{***********************************************^^J%
             * Subfig configuration file #1.cfg used ^^J%
             ***********************************************}%
  }{%
    \PackageWarning{subfig}{Configuration file #1.cfg not found}}%
}
\ProcessPackageOptions
\@ifundefined{c@subfigure}{\newsubfloat{figure}}{}
\@ifundefined{c@subtable}{\newsubfloat{table}}{}
\AtEndOfPackage{%
  \global\let\ifsf@usecaption\relax
  \global\let\sf@usecaptiontrue\relax
  \global\let\sf@usecaptionfalse\relax
  \global\let\ifsf@usecaptionfound\relax
  \global\let\sf@usecaptionfoundtrue\relax
  \global\let\sf@usecaptionfoundfalse\relax
  \global\let\KV@caption\relax
  \global\let\KV@subfig@caption\relax
  \global\let\KV@subfig@caption@default\relax
  \global\let\KV@config\relax
  \global\let\KV@subfig@config\relax
  \global\let\KV@subfig@config@default\relax
  \global\let\ProcessPackageOptions\relax
  \global\let\@unprocessedoptions\relax
  \let\CurrentOption\@empty
}
\newskip\sf@top
\newskip\sf@bottom
\def\subfloat{%
  \ifx\@captype\@undefined
    \@latex@error{\noexpand\subfloat outside float}\@ehd
     \expandafter\@gobble
  \else
    \expandafter\@firstofone
  \fi
  {\sf@subfloat}}
\def\sf@subfloat{%
  \begingroup
    \@ifundefined{caption@setfloattype}%
      \caption@settype
      \caption@setfloattype
          \@captype
    \sf@ifpositiontop{%
      \maincaptiontoptrue
    }{%
      \maincaptiontopfalse
    }%
    \caption@settype{subfloat}%
    \caption@settype{sub\@captype}%
    \let\sf@oldlabel=\label
    \let\label=\subfloat@label
    \ifmaincaptiontop\else
      \advance\@nameuse{c@\@captype}\@ne
    \fi
    \refstepcounter{sub\@captype}%
    \setcounter{sub\@captype @save}{\value{sub\@captype}}%
    \@ifnextchar [%  %] match left bracket
      {\sf@@subfloat}%
      {\sf@@subfloat[\@empty]}}
\long\def\sf@@subfloat[#1]{%
    \@ifnextchar [%  %] match left bracket
      {\sf@@@subfloat{sub\@captype}[{#1}]}%
      {\sf@@@subfloat{sub\@captype}[\@empty{#1}][{#1}]}}
\long\def\sf@@@subfloat#1[#2][#3]#4{%
    \@ifundefined{FBsc@max}{}%
        {\FB@readaux{\let\FBsuboheight\relax}}%
    \@tempcnta=\@ne
    \if@minipage
      \@tempcnta=\z@
    \else\ifdim \lastskip=\z@ \else
      \@tempcnta=\tw@
    \fi\fi
    \ifmaincaptiontop
      \sf@top=\sf@nearskip
      \sf@bottom=\sf@farskip
    \else
      \sf@top=\sf@farskip
      \sf@bottom=\sf@nearskip
    \fi
    \leavevmode
    \setbox\@tempboxa \hbox{#4}%
    \@tempdima=\wd\@tempboxa
    \@ifundefined{FBsc@max}{}%
        {\global\advance\Xhsize-\wd\@tempboxa
         \dimen@=\ht\@tempboxa
         \advance\dimen@\dp\@tempboxa
         \ifdim\dimen@>\FBso@max
           \global\FBso@max\dimen@
         \fi}%
    \vtop\bgroup
      \vbox\bgroup
        \ifcase\@tempcnta
          \@minipagefalse
        \or
          \vskip\sf@top
        \or
          \ifdim \lastskip=\z@ \else
            \@tempskipb\sf@top\relax\@xaddvskip
          \fi
        \fi
        \sf@ifpositiontop{%
          \ifx \@empty#3\relax \else
            \sf@subcaption{#1}{#2}{#3}%
            \vskip\sf@capskip
            \vskip\sf@captopadj
          \fi\egroup
          \hrule width0pt height0pt depth0pt
          \box\@tempboxa
        }{%
        \@ifundefined{FBsc@max}%
            {\box\@tempboxa}%
            {\ifx\FBsuboheight\relax
               \box\@tempboxa
             \else
               \vbox to \FBsuboheight{\FBafil\box\@tempboxa\FBbfil}%
             \fi}%
          \egroup
          \ifx \@empty#3\relax \else
            \vskip\sf@capskip
            \hrule width0pt height0pt depth0pt
            \sf@subcaption{#1}{#2}{#3}%
         \fi
        }%
      \vskip\sf@bottom
    \egroup
    \@ifundefined{FBsc@max}{}%
        {\addtocounter{FRobj}{-1}%
         \ifnum\c@FRobj=0\else
           \subfloatrowsep
         \fi}%
    \ifmaincaptiontop\else
      \global\advance\@nameuse{c@\@captype}\m@ne
    \fi
  \endgroup\ignorespaces}
\def\sf@updatecaptionlist#1#2#3#4{%
  \xdef\sf@captionlist{%
    \sf@captionlist,%
        {\protect\numberline{\@subcaplabel}\noexpand{\ignorespaces #2}}%
        {#1.#3.#4}}}
\long\def\sf@subcaption#1#2#3{%
  \ifx \relax#2\relax \else
    \bgroup
      \let\label=\@gobble
      \let\protect=\string
      \def\@subcaplabel{%
        \caption@lstfmt{\@nameuse{p@#1}}{\@nameuse{the#1}}}%
      \sf@updatecaptionlist{#1}{#2}{\the\value{\@captype}}{\the\value{#1}}%
    \egroup
  \fi
  \bgroup
    \ifx \relax#3\relax
      \let\captionlabelsep=\relax
    \fi
    \setbox0\vbox{%
      \hb@xt@\the\@tempdima{%
        \hss
        \parbox[t]{\the\@tempdima}{%
          \caption@make
              {\@nameuse{sub\@captype name}}%
              {\@nameuse{thesub\@captype}}%
              {#3}}%
          \hss}}%
    \@ifundefined{FBsc@max}%
        {\box0}%
        {\dimen@\ht0%
         \advance\dimen@\dp0%
         \ifdim\dimen@>\FBsc@max
           \global\FBsc@max\dimen@
         \fi
         \FB@readaux{\let\FBsubcheight\relax}%
         \ifx\FBsubcheight\relax
           \def\next{\parbox[t]{\the\@tempdima}}%
         \else
           \def\next{\parbox[t][\FBsubcheight][t]{\the\@tempdima}}%
         \fi
         \vbox{%
           \hb@xt@\the\@tempdima{%
             \hss
             \next{%
               \caption@make
                   {\@nameuse{sub\@captype name}}%
                   {\@nameuse{thesub\@captype}}%
                   {#3}}%
             \hss}}}%
  \egroup}
\def\listsubcaptions{%
  \@ifstar
    {\gdef\sf@captionlist{}}%
    {\@listsubcaptions{\@captype}}}
\def\sf@captionlist{}
\def\@listsubcaptions#1{%
  \@ifundefined{@captype}{}{%
    \@ifundefined{ext@sub#1}{}{%
      \@for \sf@temp:=\sf@captionlist \do {%
        \ifx \@empty\sf@temp\relax \else
          \begingroup
            \def\@currentHref{\expandafter\@secondoftwo\sf@temp}%
            \sf@addcontentsline
              {\@nameuse{ext@sub#1}}%
              {sub#1}%
              {\expandafter\@firstoftwo\sf@temp}%
          \endgroup
        \fi}}}%
  \gdef\sf@captionlist{}}
\long\def\caption@#1[#2]#3{%
  \@ifundefined{caption@setfloattype}%
    \caption@settype
    \caption@setfloattype
        \@captype
  \sf@ifpositiontop{%
    \@listsubcaptions{#1}%
    \sf@old@caption{#1}[{#2}]{#3}%
  }{%
    \sf@old@caption{#1}[{#2}]{#3}%
    \@listsubcaptions{#1}%
  }}
\AtBeginDocument{%
  \let\sf@addcontentsline=\addcontentsline}
\def\subfloat@label{%
  \@ifnextchar(%   %) match left parenthesis
    {\sf@sub@label}
    {\sf@sub@label(Sub\@captype\space
                   \@ifundefined{thechapter}{}{\@nameuse{thechapter}\space}%
                   \@nameuse{p@sub\@captype}%
                   \@nameuse{thesub\@captype}.)}}

\newif\ifhyperrefloaded
\def\sf@sub@label(#1)#2{%
  \ifhyperrefloaded
    \protected@edef\@currentlabelname{%
      \expandafter\strip@period #1\relax.\relax\@@@}%
  \fi
  \sf@@sub@label{#2}}
\def\sf@@sub@label#1{%
  \@bsphack
  \sf@oldlabel{#1}%
  \ifhyperrefloaded
    \begingroup
      \edef\@currentlabstr{%
        \expandafter\strip@prefix\meaning\@currentlabelname}%
      \protected@write\@auxout{}{%
          \string\newlabel{sub@#1}{%
              {\caption@lstfmt
                {\@nameuse{p@sub\@captype}}%
                {\@nameuse{thesub\@captype}}}%
              {\caption@subreffmt
                {\@nameuse{p@sub\@captype}}%
                {\@nameuse{thesub\@captype}}%
                {\the\value{\@captype}}%
                {\the\value{sub\@captype}}}%
              {\expandafter\strip@period\@currentlabelname\relax.\relax\@@@}%
              {\@currentHref}%
              {}}}%
    \endgroup
  \else
    \protected@write\@auxout{}{%
        \string\newlabel{sub@#1}{%
            {\caption@lstfmt
              {\@nameuse{p@sub\@captype}}%
              {\@nameuse{thesub\@captype}}}%
            {\caption@subreffmt
              {\@nameuse{p@sub\@captype}}%
              {\@nameuse{thesub\@captype}}%
              {\the\value{\@captype}}%
              {\the\value{sub\@captype}}}}}%
  \fi
  \@esphack}
\def\subref{%
  \@ifstar
    \sf@@subref
    \sf@subref}
\def\sf@subref#1{\ref{sub@#1}}
\def\sf@@subref#1{\pageref{sub@#1}}
\newif\if@ccflag
\@ccflagfalse
\AtBeginDocument{%
  \let\sf@refstepcounter=\refstepcounter
  \@ifpackageloaded{captcont}{}{%
    \def\refsteponlycounter#1{%
      \if@ccflag
        \global\expandafter\advance\csname c@#1\endcsname\@ne
        \let\sf@temp\protect
        \def\protect{\noexpand\protect\noexpand}%
        \edef\@currentlabel{\csname p@#1\endcsname\csname the#1\endcsname}%
        \let\protect\sf@temp
      \else
        \sf@refstepcounter{#1}%
      \fi
      \@ccflagfalse}%
  }%
  \def\ContinuedFloat{%
    \ifx\@captype\@undefined
      \@latex@error{\noexpand\ContinuedFloat outside float}\@ehd
    \else
      \addtocounter{\@captype}{\m@ne}%
      \caption@ContinuedFloat\@captype
      \@ifundefined{c@sub\@captype}{}{%
        \setcounter{sub\@captype}{\value{sub\@captype @save}}%
        \@ccflagtrue}%
    \fi}}
  \providecommand*\caption@ContinuedFloat[1]{}
\def\sf@caption{%
  \let\refstepcounter=\refsteponlycounter
  \sf@savecaption}
\AtBeginDocument{%
  \let\sf@savecaption=\caption
  \let\caption=\sf@caption
}
\let\sf@end@float=\end@float
\let\sf@end@dblfloat=\end@dblfloat
\def\end@float{%
  \@ifundefined{sf@counterlist}{}{%
    \@for\sf@temp:=\sf@counterlist\do{%
      \setcounter{\sf@temp}{\z@}}%
    \@listsubcaptions{\@captype}}%
  \sf@end@float}%
\def\end@dblfloat{%
  \@ifundefined{sf@counterlist}{}{%
    \@for\sf@temp:=\sf@counterlist\do{%
      \setcounter{\sf@temp}{\z@}}%
    \@listsubcaptions{\@captype}}%
  \sf@end@dblfloat}
\AtBeginDocument{%
  \@ifpackageloaded{hyperref}{%
    \hyperrefloadedtrue
    %
    \def\sf@setref#1sub#2\relax{%
      \@namedef{theHsub#2\expandafter}{\@nameuse{the#2}.\arabic{sub#2}}%
      \@namedef{toclevel@sub#2}{1}%
    }
    %
    \@for\sf@temp:=\sf@counterlist\do{%
      \expandafter\sf@setref\sf@temp\relax}%
    %
    \global\let\sf@setref\relax
    %
    \let\sf@Hrefstepcounter\H@refstepcounter
    \def\H@refstepcounter#1{%
      \sf@Hrefstepcounter{#1}%
      \@ifundefined{c@sub#1}{}{%
        \if@ccflag
          \setcounter{sub#1}{\value{sub#1@save}}%
        \fi
        \@ccflagfalse}}%
    %
  }{}%
  \@ifpackageloaded{float}{%
    \let\sf@endfloatbox=\@endfloatbox
    \def\@endfloatbox{%
      \listsubcaptions
      \sf@endfloatbox}%
  }{}%
  \@ifpackageloaded{fixltx2e}{%
    \def\end@dblfloat{%
      \if@twocolumn
        \@ifundefined{sf@counterlist}{}{%
          \@for\sf@temp:=\sf@counterlist\do{%
            \setcounter{\sf@temp}{\z@}}%
          \@listsubcaptions{\@captype}}%
        \@endfloatbox
        \ifnum\@floatpenalty <\z@
          \@largefloatcheck
          \global\dp\@currbox1sp %
          \expandafter\@gobble\sf@end@float
        \fi
      \else
        \end@float
      \fi}%
  }{%
    \@ifpackageloaded{fix2col}{%
      \def\end@dblfloat{%
        \if@twocolumn
          \@ifundefined{sf@counterlist}{}{%
            \@for\sf@temp:=\sf@counterlist\do{%
              \setcounter{\sf@temp}{\z@}}%
            \@listsubcaptions{\@captype}}%
          \@endfloatbox
          \ifnum\@floatpenalty <\z@
            \@largefloatcheck
            \global\dp\@currbox1sp %
            \expandafter\@gobble\sf@end@float
          \fi
        \else
          \end@float
        \fi}}{}%
  }
}
\endinput
%%
%% End of file `subfig.sty'.
