%% ci.sty
%% LaTeX style file for Complexity International
%% http://www.complexity.org.au/

\setlength{\topmargin}{-20mm}
\setlength{\textheight}{260mm}
\setlength{\oddsidemargin}{0mm}
\setlength{\textwidth}{160mm}

% dependencies
\input{epsf}

\def\the@civolume{}
\def\the@cipaperid{}
\def\the@ciyear{}
\def\the@cireceived{}
\def\the@ciaccepted{}


\def\civolume#1{\def\the@civolume{#1}}
\def\cipaperid#1{\def\the@cipaperid{#1}}
\def\ciyear#1{\def\the@ciyear{#1}}
\def\cireceived#1{\def\the@cireceived{#1}}
\def\ciaccepted#1{\def\the@ciaccepted{#1}}

% draft command
\newif\ifdraft
\def\cidraft{\drafttrue}
\draftfalse

\def\the@ciurl{\underline{\tt http://www.complexity.org.au/}}
\newlength{\ci@urlwidth}
\settowidth{\ci@urlwidth}{\the@ciurl}

\def\@cilogo{\epsfxsize=220pt\epsfbox{ci-logo2.eps}\hfill\parbox[b]{\ci@urlwidth}{
  \hfill {\Large \ifdraft
    Draft Manuscript
    \else
    Volume \the@civolume
    \fi}\\[.5cm]
  \the@ciurl
}
\ifdraft
\\
 {\bf Please note that this manuscript has yet to be accepted by {\em
  Complexity International}}
\fi
}
  

% Extra commands for affiliation information
\tracingmacros=1
\def\ci@addr{}

\def\@enamedef#1{\expandafter\def\csname #1\endcsname}
%\def\array#1#2{\csname #1\romannumeral#2\endcsname}

%\def\author#1{\def\@author{#1}}


\def\@al#1{\csname @al#1\endcsname}
\def\@aldef#1{\expandafter\def\csname @al#1\endcsname}
\def\@el#1{\csname @el#1\endcsname}
\def\@eldef#1{\expandafter\def\csname @el#1\endcsname}
\def\@ul#1{\csname @ul#1\endcsname}
\def\@uldef#1{\expandafter\def\csname @ul#1\endcsname}

%\newcounter{ci@addrline}\newcounter{ci@prevaddrline}
%\setcounter{ci@addrline}1
%\def\@ali{}

\def\@addr{}

\newcount\ci@addrline  \ci@addrline=0

    
\def\addrmark#1{$^#1$}

\newtoks\ci@addrtmp
\def\ci@addrappend#1#2{
  \ci@addrtmp=\expandafter{#1\\}
  \edef#1{\the\ci@addrtmp #2}
  }

\def\ci@address{}
\def\@address[#1]#2{
  \let\\=\relax
  \ci@addrappend\ci@address{{\ifnum#1>0$^#1$\fi\noexpand\em #2}}
  }
\def\@email[#1]#2{
  \let\tl=\{ \let\tr=\}
  \def\{{\symbol{'173}} \def\}{\symbol{'175}}
  \ci@addrappend\ci@address{{\noexpand\tt Email: #2}}
  \let\{=\tl \let\}=\tr
  }
\def\@url[#1]#2{\ci@addrappend\ci@address{{\noexpand\tt #2}}}

\def\address{\@ifnextchar[\@address{\@address[0]}}
\def\email{\@ifnextchar[\@email{\@email[]}}
\def\url{\@ifnextchar[\@url{\@url[]}}

\def\maketitle{
  \begin{center}
  \@cilogo \par 
    {\Huge \@title \par}
    \vskip 1.5em%
    {%\large
      \lineskip .5em%
%      \begin{tabular}[t]{c}%
        \@author
        \ci@address
%      \end{tabular}\par
      }%
  \end{center}%
  \par
  \vskip 1.5em
  }

\def\@heading{
  \ifnum\value{page}=1
  \else
  {\bf\em Complexity International}\hfill
  {\em \ifdraft Draft Manuscript,\fi Volume \the@civolume} 
  \fi
}

\def\@footer{
  \ifnum\value{page}=1
  \parbox{\textwidth}{{\small
    {\em Received: \the@cireceived}\hfill \copyright\ Copyright \the@ciyear\\
    \makebox[0pt][l]{{\em Accepted: \the@ciaccepted}}
    \hfill -- \arabic{page} --\hfill 
    \makebox[0pt][r]{
      {http://www.complexity.org.au/ci/\ifdraft sub\else vol\fi\the@civolume/\the@cipaperid/}}
    }}
  \else
  {\small\makebox[0pt][l]{\em\the@cipaperid}\hfill-- \arabic{page} --\hfill 
    \makebox[0pt][r]{\copyright Copyright \the@ciyear}}
  \fi
}

\def\ps@ci{\let\@mkboth\@gobbletwo
     \def\@oddhead{\@heading}\def\@oddfoot{\@footer}
     \let\@evenhead\@oddhead\let\@evenfoot\@oddfoot}


\pagestyle{ci}

% Use this command to obtain citations of the form Author (year), in
% apalike style. If
% reformatting ms for use with a standard LaTeX style, define the
% following command:
%   \def\citeyear(#1)#2{\cite{#2}}

\def\citeyear(#1)#2{(#1)\nocite{#2}}


% section styles
\renewcommand \thesection {\@arabic\c@section.}
\renewcommand\thesubsection   {\thesection\@arabic\c@subsection}
\renewcommand\thesubsubsection{\thesubsection .\@arabic\c@subsubsection}
\renewcommand\section{\@startsection {section}{1}{\z@}%
                                   {-3.5ex \@plus -1ex \@minus -.2ex}%
                                   {2.3ex \@plus.2ex}%
                                   {\normalfont\Large\bfseries}}
\renewcommand\subsection{\@startsection{subsection}{2}{\z@}%
                                     {-3.25ex\@plus -1ex \@minus -.2ex}%
                                     {1.5ex \@plus .2ex}%
                                     {\normalfont\large\bfseries\itshape}}
\renewcommand\subsubsection{\@startsection{subsubsection}{3}{\z@}%
                                     {-3.25ex\@plus -1ex \@minus -.2ex}%
                                     {1.5ex \@plus .2ex}%
                                     {\normalfont\normalsize\bfseries\itshape}}

\newcommand{\regmark}{$\bigcirc\hspace{-.8em}\mbox{{\small R}}$}

\renewcommand\appendix{\par
  \setcounter{section}{0}%
  \setcounter{subsection}{0}%
  \gdef\thesection{Appendix \arabic{section}}
  }

\renewenvironment{abstract}{
\quotation
\noindent\small{\bf Abstract}\par
}{\endquotation}


% Italicise figure and table captions
\long\def\@makecaption#1#2{%
  \vskip\abovecaptionskip
  \sbox\@tempboxa{#1. {\em #2}}%
  \ifdim \wd\@tempboxa >\hsize
    #1. {\em #2}\par
  \else
    \global \@minipagefalse
    \hb@xt@\hsize{\hfil\box\@tempboxa\hfil}%
  \fi
  \vskip\belowcaptionskip}

% typeset verbatim in small
\def\verbatim@font{\normalfont\ttfamily\small}

