% APPENDIX AFTER EACH CHAPTER  (written by Dave Steiner from bk10.sty)
%
% The \appendix command must do the following:
%    -- save the chapter counter to be restored later
%    -- reset the chapter counter to zero
%    -- reset the section counter to zero
%    -- set \@chapapp to Appendix (for messages)
%    -- redefine the chapter counter to produce appendix numbers
%    -- redefine the \chapter command if appendix titles and headings are
%       to look different from chapter titles and headings.
%
% The \endappendix command must reset things to continue with chapters:
%    -- restore the chapter counter
%    -- set \@chapapp to Chapter
%    -- redefine the chapter counter to produce chapter numbers

\newcounter{savechapter}

\def\appendix{\par
  \setcounter{savechapter}{\value{chapter}}
  \setcounter{chapter}{0}
  \setcounter{section}{0}
  \def\@chapapp{Appendix}
  \def\thechapter{\Alph{chapter}}}

\def\endappendix{
  \setcounter{chapter}{\value{savechapter}}
  \def\@chapapp{Chapter}
  \def\thechapter{\arabic{chapter}}}