%%%
%%% camnum.sty
%%%
%%% Praise for this style file to Arieh Iserles.
%%% Complaints to be kept to oneself.

% camnum.sty 28.8.96 version 3.1.2

\typeout{Numerical Analysis Group, DAMTP, Cambridge}
\typeout{Document Style `camnum' <5 September 1996>, version 3.1.3.}

\usepackage{latexsym}
\usepackage[dvips]{graphics}
\usepackage[dvips]{color}

\textheight=558pt
\textwidth=372pt
\topmargin=70pt
\headsep=22pt
\oddsidemargin=45pt
\evensidemargin=45pt



% Various fonts

\font\Bbb=msbm10 scaled 1000
\font\sBbb=msbm7 scaled 1000
\font\gothic=eufm10 scaled 1100
\font\smallgothic=eufm7 scaled 1100

\def\bb#1{\mbox{\sBbb #1}}             % Shell capitals in subscript
\def\BB#1{\mbox{\Bbb #1}}              % Shell capitals
\def\CC#1{\mathrm{#1}}                 % Roman
\def\Gg#1{\mbox{\smallgothic #1}}      % Gothic in subscript
\def\GG#1{\mbox{\gothic #1}}           % Gothic
\def\Mm#1{\mbox{\boldmath$\scriptstyle #1$\unboldmath}}
                                       % Math-bold in subscript 
\def\MM#1{\mbox{\boldmath$#1$\unboldmath}}
                                       % Math-bold
% New environments

%\newenvironment{aside}[1]{\begin{list}{$\Diamond$}{
%          \setlength{\leftmargin}{1pc}
%          \setlength{\rightmargin}{1pc}}
%       \item
%       \parindent=0pt 
%       \parskip=2pt
%       \textbf{\hspace*{-4pt} #1 }\hspace*{-2pt}       }{
%       \end{list}
%        \begin{flushright}\vspace*{-22pt}$\Diamond$
%        \end{flushright}     }         

% Extra commands

\def\R#1{$(\ref{#1})$}

\def\O#1{{\cal O}\!\left(#1\right)}
\def\Frac#1#2{{\textstyle \frac{#1}{#2}}}

\def\theequation{\arabic{section}.\arabic{equation}}

\def\Re{\CC{Re}\,}
\def\Im{\CC{Im}\,}
\def\D{\,\CC{d}}
\def\I{\CC{i}}
\def\E{\CC{e}}

\newcommand{\QED}{\hspace*{2em}\hfill$\Box$}
\newcommand{\Exclaim}{\mbox{\Large\boldmath $\star$\unboldmath}}
\newcommand{\dint}[1]{\scalebox{1.3}{$\displaystyle\int\!\!\!\!\int$}
  _{\hspace*{-5pt}#1}}       % double integral


\def\C#1{\multicolumn{1}{c}{#1}}                % Centering in an
                                                % array or table
\newcommand{\Vgap}{\vspace*{8pt}}
\newcommand{\Hgap}{\hspace*{8pt}}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% alison's macros

\def\captionsize{\@setsize\captionsize{10}\viiipt\@viiipt}%       8/10
\def\chaptitlesize{\@setsize\chaptitlesize{20pt}\xviipt\@xviipt}% 17/20
\newfont{\chapfont}{cmbxti10 scaled \magstep 3}

\newdimen\SFB@indent \SFB@indent\z@
\newdimen\SFB@headwidth
\SFB@headwidth\textwidth
\addtolength{\SFB@headwidth}{-\SFB@indent}

\newif\ifSFB@appendix
\newif\ifSFB@indentsty
\newif\ifSFB@largesty

\def\ls{\kern.15em} % for letterspacing
\def\ns{\kern.5em} % for name-spacing
\def\sixhrulefill{\leaders\hrule height 6pt\hfill\kern\z@}

\newenvironment{aside}[1]%
  {\begin{list}{$\Diamond$}{%
    \setlength{\leftmargin}{1.5pc}%
    \setlength{\rightmargin}{1.5pc}%
    }%
  \item
  \parindent=0pt%
  \parskip=2pt%
  \textbf{\hspace*{-4pt} #1 }\hspace*{-2pt}%
  }%
  {\hspace*{0em plus 1000fil}\nolinebreak 
   \hbox to-6pt{$\Diamond$}\end{list}}

\def\@makechapterhead#1{{\normalsize
  \parindent 0pt
  \vspace*{-0.5\baselineskip}
  \ifnum \c@secnumdepth >\m@ne
   \raisebox{0.5\baselineskip}[0pt][0pt]{\mbox{\hspace*{\SFB@indent}}%
    \begin{minipage}[t]{\SFB@headwidth}
     \centering
     \ifSFB@appendix {\hbox to \textwidth{%
       \sixhrulefill\hspace{7pt}\huge\bf Appendix \thechapter
       \hspace{7pt}\sixhrulefill}}%
     \else {\hbox to \textwidth{%
       \sixhrulefill\hspace{7pt}\huge\bf{\thechapter}%
       \hspace{7pt}\sixhrulefill}}%
     \fi
     \par
     \vskip -6pt
     \rule{\textwidth}{0.25pt}
     \vskip 2pt
     \chaptitlesize\chapfont #1%
     \nobreak
     \par
     \vskip -5pt
     \rule{\textwidth}{0.25pt}
    \end{minipage}}
  \else
   \raisebox{0.5\baselineskip}[0pt][0pt]{\mbox{\hspace*{\SFB@indent}}%
    \begin{minipage}[t]{\SFB@headwidth}
     \centering
     {\huge\bf \mbox{}}
     \par
     \vskip 7pt
     \LARGE\rm #1
     \nobreak
     \par
    \end{minipage}}
  \fi
  \par \nobreak
  \vskip 8.5\baselineskip% 2.5 less than the first line of text
  }
}

\def\@makeschapterhead#1{{\normalsize
  \parindent 0pt
  \vspace*{-0.5\baselineskip}
  \raisebox{0.5\baselineskip}[0pt][0pt]{\mbox{\hspace*{\SFB@indent}}%
   \begin{minipage}[t]{\SFB@headwidth}
    \centering
    {\hbox to \textwidth{%
       \sixhrulefill}}
    \par
    \vskip -6pt
    \rule{\textwidth}{0.25pt}
    \vskip 2pt
    \chaptitlesize\chapfont #1
    \nobreak
    \par
    \vskip -5pt
    \rule{\textwidth}{0.25pt}
   \end{minipage}}
  \par \nobreak
  \vskip 8.5\baselineskip % 2.5 less than the first line of text
  }
}

\renewcommand{\part}{\cleardoublepage
  \thispagestyle{empty}%
  \if@twocolumn
    \onecolumn
    \@tempswatrue
  \else
    \@tempswafalse
  \fi
  \secdef\@part\@spart}

\def\@endpart{\cleardoublepage}

\def\@part[#1]#2{%
    \ifnum \c@secnumdepth >-2\relax
      \refstepcounter{part}%
      \addcontentsline{toc}{part}{\thepart\hspace{1em}#1}%
    \else
      \addcontentsline{toc}{part}{#1}%
    \fi
    \markboth{}{}
\thispagestyle{empty}
{{\normalsize
  \parindent 0pt
  \vspace*{-0.5\baselineskip}
  \ifnum \c@secnumdepth >\m@ne
   \raisebox{0.5\baselineskip}[0pt][0pt]{\mbox{\hspace*{\SFB@indent}}%
    \begin{minipage}[t]{\SFB@headwidth}
     \centering
     \ifSFB@appendix {\hbox to \textwidth{%
       \sixhrulefill\hspace{7pt}\huge\bf Appendix \thechapter
       \hspace{7pt}\sixhrulefill}}%
     \else {\hbox to \textwidth{%
       \sixhrulefill\hspace{7pt}\Large\bf{P\ls A\ls R\ls T\ns \thepart}%
       \hspace{7pt}\sixhrulefill}}%
     \fi
     \par
     \vskip -6pt
     \rule{\textwidth}{0.25pt}
     \vskip 2pt
     \chaptitlesize\chapfont #1%
     \nobreak
     \par
     \vskip -5pt
     \rule{\textwidth}{0.25pt}
    \end{minipage}}
  \else
   \raisebox{0.5\baselineskip}[0pt][0pt]{\mbox{\hspace*{\SFB@indent}}%
    \begin{minipage}[t]{\SFB@headwidth}
     \centering
     {\huge\bf \mbox{}}
     \par
     \vskip 7pt
     \LARGE\rm #1
     \nobreak
     \par
    \end{minipage}}
  \fi
  \par \nobreak
  \vskip 8.5\baselineskip% 2.5 less than the first line of text
  }
}}

%%%%%%%% Arieh - additions

%% Figure captions
\def\captionsize{\@setsize\captionsize{10}\ixpt\@ixpt}%

\newcommand{\Caption}[2]{{\leftskip 1.5pc\rightskip 1.5pc
\captionsize\noindent{\bf Figure #1}\quad #2\hfill \par
}\vspace*{8pt}
}

\newcommand{\lastline}{\vadjust{\vspace{-10pt}}\linebreak

\centering}

%% References
\newenvironment{refer}
{\small\vspace*{4pt}\begin{list}{\hspace*{-1em}}{
\setlength{\topsep}{8pt}
\setlength{\labelsep}{0pt}
\setlength{\labelwidth}{0pt}
\setlength{\itemindent}{-1em}
\setlength{\leftmargin}{1em}
\setlength{\itemsep}{3pt}
}}
{\end{list}}  

%% Exercises
\newenvironment{exer}[1]
{\begin{list}{#1}{
\setlength{\leftmargin}{3.5pc}
\setlength{\labelwidth}{28pt}
\setlength{\labelsep}{14pt}
\setlength{\itemindent}{0pt}
}}
{\end{list}
%\vspace*{8pt}
}

%% Secondary lists within exercises
\newenvironment{exerlist}
{\begin{list}{\alph{enumi}}{
    \usecounter{enumi}
    \setlength{\itemsep}{3pt}
    \setlength{\leftmargin}{0pt}
    \setlength{\labelsep}{6pt}
    \setlength{\labelwidth}{1em}
    }}
{\end{list}
}

%% Running head -- filched from acta.sty (with amendments)
\def\ps@myheadings{\let\@mkboth\@gobbletwo
 \def\@oddhead{\hfill \it \rightmark \hfill \rm \thepage}
 \def\@oddfoot{}
 \def\@evenhead{\rm \thepage \hfill \it \leftmark \hfill}
 \def\@evenfoot{}
 \def\sectionmark##1{}
 \def\subsectionmark##1{}
}

%% My feeble attempt at theorem-like environments

\newtheorem{theorem}{Theorem}
\newtheorem{proposition}[theorem]{Proposition}
\newtheorem{lemma}[theorem]{Lemma}

\newenvironment{proof}[1]{\vspace{-2pt}{\em Proof\/}\quad #1}{\QED
  \vspace{8pt}}

%% An array-like environment to display multiple-equation formulae
%% with a single equation number

\newenvironment{meqn}
{\arraycolsep=1.4pt
  \renewcommand{\arraystretch}{1.4}
  \begin{array}{rcl}}
  {\end{array}}

%% An array-like environment exactly like eqnarray, except that there
%% is no need to tweak the \arraycolsep

\newenvironment{Eqnarray}
{\arraycolsep=1.4pt
  \begin{eqnarray}}
  {\end{eqnarray}
    \hspace*{-4pt}}

%% An array-like environment exactly like eqnarray*, except that there
%% is no need to tweak the \arraycolsep

\newenvironment{Eqnarray*}
{\arraycolsep=1.4pt
  \begin{eqnarray*}}
  {\end{eqnarray*}
    \hspace*{-4pt}}

%% An array-like environment for a multiple-choice formula, e.g.
%%
%%           < 1,        n even,
%%     u_n = <
%%           < 0,        n odd.
%%
%% Each line should have exactly two fields. All punctuation marks
%% (commas, semicolons, full stops) must be added by the user.

\newenvironment{case}
{\left\{ \arraycolsep=12pt
  \hspace*{-9pt}
  \begin{array}{ll}}
  {\end{array}
    \right.
    \hspace*{-9pt}}

