% article title \bgroup \vbox to 8pt{\vss}% \seventeenpoint \Raggedright \noindent \strut{#1}\par \egroup
% article author(s) \bgroup \ifnum\LastMac=\Afe \OneHalf\else \vskip 21pt\fi \fourteenpoint \Raggedright \noindent \strut #1\par \vskip 3pt% \egroup
% \bgroup \vskip 20pt% \leftskip 11pc\rightskip\z@ \noindent{\ninebf ABSTRACT}\par \tenpoint \Fullout \noindent #1\par \egroup
mn.tex
% MN.TEX (Computer Modern version)
%
% plain TeX single / double column macros for the
% Monthly Notices of Royal Astronomical Society
%
% v1.6  (mn.tex)  --- released 18th September 1995 (A. Woollatt)
% v1.5      "     --- released 25th August 1994 (M. Reed)
% v1.4      "     --- released 22nd February 1994
% v1.3  (mnd.tex) --- released 28th November 1992
% v1.26     "     --- released  1st August 1992
% v1.25     "     --- released 25th February 1992
%
% Copyright Cambridge University Press
%
% > Incorporating special symbol code from laa.sty v1.1 (25th Feb 1991)
%   used with the permission of Springer Verlag.
% > Incorporating parts of mssymb.tex (8th July 1987).
% > Incorporating NewFont.sty v ALPHA patchlevel 8 (16th August 1994).
% > Add footlines, add footnotes in double column (18th September
%   1995).

\catcode `\@=11 % @ signs are letters

\def\@version{1.6}
\def\@verdate{18th September 1995}


% Fonts: Computer Modern / Monotype Times (CUP only)
%
% Font family sizes available:
%   8pt, 9pt, 10pt, 11pt, 14pt and 17pt.
%
% Faces available:
%   \rm, math italic, symbol, \it, \bf, \sl, \tt, \sc, \sf, \cal, \em,
%   \mit and \oldstyle.

% define the typeface in use

\newif\ifprod@font

\ifx\@typeface\undefined
  \def\@typeface{Comp. Modern}\prod@fontfalse
\else
  \prod@fonttrue % We want Times
\fi

\def\newfam{\alloc@8\fam\chardef\sixt@@n} % made not outer

\ifprod@font
%
\font\fiverm=mtr10 at 5pt
\font\fivebf=mtbx10 at 5pt
\font\fiveit=mtti10 at 5pt
\font\fivesl=mtsl10 at 5pt
\font\fivett=cmtt8 at 5pt     \hyphenchar\fivett=-1
\font\fivecsc=mtcsc10 at 5pt
\font\fivesf=mtss10 at 5pt
\font\fivei=mtmi10 at 5pt      \skewchar\fivei='177
\font\fivesy=mtsy10 at 5pt     \skewchar\fivesy='60

\font\sixrm=mtr10 at 6pt
\font\sixbf=mtbx10 at 6pt
\font\sixit=mtti10 at 6pt
\font\sixsl=mtsl10 at 6pt
\font\sixtt=cmtt8 at 6pt      \hyphenchar\sixtt=-1
\font\sixcsc=mtcsc10 at 6pt
\font\sixsf=mtss10 at 6pt
\font\sixi=mtmi10 at 6pt       \skewchar\sixi='177
\font\sixsy=mtsy10 at 6pt      \skewchar\sixsy='60

\font\sevenrm=mtr10 at 7pt
\font\sevenbf=mtbx10 at 7pt
\font\sevenit=mtti10 at 7pt
\font\sevensl=mtsl10 at 7pt
\font\seventt=cmtt8 at 7pt     \hyphenchar\seventt=-1
\font\sevencsc=mtcsc10 at 7pt
\font\sevensf=mtss10 at 7pt
\font\seveni=mtmi10 at 7pt      \skewchar\seveni='177
\font\sevensy=mtsy10 at 7pt     \skewchar\sevensy='60

\font\eightrm=mtr10 at 8pt
\font\eightbf=mtbx10 at 8pt
\font\eightit=mtti10 at 8pt
\font\eighti=mtmi10 at 8pt      \skewchar\eighti='177
\font\eightsy=mtsy10 at 8pt     \skewchar\eightsy='60
\font\eightsl=mtsl10 at 8pt
\font\eighttt=cmtt8             \hyphenchar\eighttt=-1
\font\eightcsc=mtcsc10 at 8pt
\font\eightsf=mtss10 at 8pt

\font\ninerm=mtr10 at 9pt
\font\ninebf=mtbx10 at 9pt
\font\nineit=mtti10 at 9pt
\font\ninei=mtmi10 at 9pt      \skewchar\ninei='177
\font\ninesy=mtsy10 at 9pt     \skewchar\ninesy='60
\font\ninesl=mtsl10 at 9pt
\font\ninett=cmtt9             \hyphenchar\ninett=-1
\font\ninecsc=mtcsc10 at 9pt
\font\ninesf=mtss10 at 9pt

\font\tenrm=mtr10
\font\tenbf=mtbx10
\font\tenit=mtti10
\font\teni=mtmi10		\skewchar\teni='177
\font\tensy=mtsy10		\skewchar\tensy='60
\font\tenex=cmex10
\font\tensl=mtsl10
\font\tentt=cmtt10		\hyphenchar\tentt=-1
\font\tencsc=mtcsc10
\font\tensf=mtss10

\font\elevenrm=mtr10 at 11pt
\font\elevenbf=mtbx10 at 11pt
\font\elevenit=mtti10 at 11pt
\font\eleveni=mtmi10 at 11pt      \skewchar\eleveni='177
\font\elevensy=mtsy10 at 11pt     \skewchar\elevensy='60
\font\elevensl=mtsl10 at 11pt
\font\eleventt=cmtt10 at 11pt     \hyphenchar\eleventt=-1
\font\elevencsc=mtcsc10 at 11pt
\font\elevensf=mtss10 at 11pt

\font\twelverm=mtr10 at 12pt
\font\twelvebf=mtbx10 at 12pt
\font\twelveit=mtti10 at 12pt
\font\twelvesl=mtsl10 at 12pt
\font\twelvett=cmtt12             \hyphenchar\twelvett=-1
\font\twelvecsc=mtcsc10 at 12pt
\font\twelvesf=mtss10 at 12pt
\font\twelvei=mtmi10 at 12pt      \skewchar\twelvei='177
\font\twelvesy=mtsy10 at 12pt     \skewchar\twelvesy='60

\font\fourteenrm=mtr10 at 14pt
\font\fourteenbf=mtbx10 at 14pt
\font\fourteenit=mtti10 at 14pt
\font\fourteeni=mtmi10 at 14pt      \skewchar\fourteeni='177
\font\fourteensy=mtsy10 at 14pt     \skewchar\fourteensy='60
\font\fourteensl=mtsl10 at 14pt
\font\fourteentt=cmtt12 at 14pt     \hyphenchar\fourteentt=-1
\font\fourteencsc=mtcsc10 at 14pt
\font\fourteensf=mtss10 at 14pt

\font\seventeenrm=mtr10 at 17pt
\font\seventeenbf=mtbx10 at 17pt
\font\seventeenit=mtti10 at 17pt
\font\seventeeni=mtmi10 at 17pt      \skewchar\seventeeni='177
\font\seventeensy=mtsy10 at 17pt     \skewchar\seventeensy='60
\font\seventeensl=mtsl10 at 17pt
\font\seventeentt=cmtt12 at 17pt     \hyphenchar\seventeentt=-1
\font\seventeencsc=mtcsc10 at 17pt
\font\seventeensf=mtss10 at 17pt
%
\else
%
\font\fiverm=cmr5
\font\fivei=cmmi5             \skewchar\fivei='177
\font\fivesy=cmsy5            \skewchar\fivesy='60
\font\fivebf=cmbx5

\font\sixrm=cmr6
\font\sixi=cmmi6             \skewchar\sixi='177
\font\sixsy=cmsy6            \skewchar\sixsy='60
\font\sixbf=cmbx6

\font\sevenrm=cmr7
\font\sevenit=cmti7
\font\seveni=cmmi7             \skewchar\seveni='177
\font\sevensy=cmsy7            \skewchar\sevensy='60
\font\sevenbf=cmbx7

\font\eightrm=cmr8
\font\eightbf=cmbx8
\font\eightit=cmti8
\font\eighti=cmmi8			\skewchar\eighti='177
\font\eightsy=cmsy8			\skewchar\eightsy='60
\font\eightsl=cmsl8
\font\eighttt=cmtt8			\hyphenchar\eighttt=-1
\font\eightcsc=cmcsc10 at 8pt
\font\eightsf=cmss8

\font\ninerm=cmr9
\font\ninebf=cmbx9
\font\nineit=cmti9
\font\ninei=cmmi9			\skewchar\ninei='177
\font\ninesy=cmsy9			\skewchar\ninesy='60
\font\ninesl=cmsl9
\font\ninett=cmtt9			\hyphenchar\ninett=-1
\font\ninecsc=cmcsc10 at 9pt
\font\ninesf=cmss9

\font\tenrm=cmr10
\font\tenbf=cmbx10
\font\tenit=cmti10
\font\teni=cmmi10		\skewchar\teni='177
\font\tensy=cmsy10		\skewchar\tensy='60
\font\tenex=cmex10
\font\tensl=cmsl10
\font\tentt=cmtt10		\hyphenchar\tentt=-1
\font\tencsc=cmcsc10
\font\tensf=cmss10

\font\elevenrm=cmr10 scaled \magstephalf
\font\elevenbf=cmbx10 scaled \magstephalf
\font\elevenit=cmti10 scaled \magstephalf
\font\eleveni=cmmi10 scaled \magstephalf	\skewchar\eleveni='177
\font\elevensy=cmsy10 scaled \magstephalf	\skewchar\elevensy='60
\font\elevensl=cmsl10 scaled \magstephalf
\font\eleventt=cmtt10 scaled \magstephalf	\hyphenchar\eleventt=-1
\font\elevencsc=cmcsc10 scaled \magstephalf
\font\elevensf=cmss10 scaled \magstephalf

\font\twelverm=cmr10 scaled \magstep1
\font\twelvebf=cmbx10 scaled \magstep1
\font\twelvei=cmmi10 scaled \magstep1      \skewchar\twelvei='177
\font\twelvesy=cmsy10 scaled \magstep1     \skewchar\twelvesy='60

\font\fourteenrm=cmr10 scaled \magstep2
\font\fourteenbf=cmbx10 scaled \magstep2
\font\fourteenit=cmti10 scaled \magstep2
\font\fourteeni=cmmi10 scaled \magstep2		\skewchar\fourteeni='177
\font\fourteensy=cmsy10 scaled \magstep2	\skewchar\fourteensy='60
\font\fourteensl=cmsl10 scaled \magstep2
\font\fourteentt=cmtt10 scaled \magstep2	\hyphenchar\fourteentt=-1
\font\fourteencsc=cmcsc10 scaled \magstep2
\font\fourteensf=cmss10 scaled \magstep2

\font\seventeenrm=cmr10 scaled \magstep3
\font\seventeenbf=cmbx10 scaled \magstep3
\font\seventeenit=cmti10 scaled \magstep3
\font\seventeeni=cmmi10 scaled \magstep3	\skewchar\seventeeni='177
\font\seventeensy=cmsy10 scaled \magstep3	\skewchar\seventeensy='60
\font\seventeensl=cmsl10 scaled \magstep3
\font\seventeentt=cmtt10 scaled \magstep3	\hyphenchar\seventeentt=-1
\font\seventeencsc=cmcsc10 scaled \magstep3
\font\seventeensf=cmss10 scaled \magstep3
%
\fi

\def\hexnumber#1{\ifcase#1 0\or1\or2\or3\or4\or5\or6\or7\or8\or9\or
  A\or B\or C\or D\or E\or F\fi}

\def\makestrut{%
  \setbox\strutbox=\hbox{%
    \vrule height.7\baselineskip depth.3\baselineskip width \z@}%
}

\def\baselinestretch{1}
\newskip\tmp@bls

\def\b@ls#1{% set baseline using \baselinestretch as a scale factor
  \tmp@bls=#1\relax
  \baselineskip=#1\relax\makestrut
  \normalbaselineskip=\baselinestretch\tmp@bls
  \normalbaselines
}

\def\nostb@ls#1{% set baseline skip ignoring \baselinestretch
  \normalbaselineskip=#1\relax
  \normalbaselines
  \makestrut
}


% families \itfam, \slfam, \bffam, \ttfam defined in PLAIN.
%
% \itfam is \fam4
% \slfam is \fam5
% \bffam is \fam6
% \ttfam is \fam7

\newfam\scfam  % \fam8
\newfam\sffam  % \fam9

\def\mit{\fam\@ne}
\def\cal{\fam\tw@}
\def\em{\ifdim\fontdimen1\font>\z@ \rm\else\it\fi}

\textfont3=\tenex
\scriptfont3=\tenex
\scriptscriptfont3=\tenex

\setbox0=\hbox{\tenex B} \p@renwd=\wd0 % width of the big left (

\def\eightpoint{% 8^6^5 on 10pt
  \def\rm{\fam0\eightrm}%
  \textfont0=\eightrm \scriptfont0=\sixrm \scriptscriptfont0=\fiverm%
  \textfont1=\eighti  \scriptfont1=\sixi  \scriptscriptfont1=\fivei%
  \textfont2=\eightsy \scriptfont2=\sixsy \scriptscriptfont2=\fivesy%
  \textfont\itfam=\eightit\def\it{\fam\itfam\eightit}%
  \ifprod@font
    \scriptfont\itfam=\sixit
      \scriptscriptfont\itfam=\fiveit
  \else
    \scriptfont\itfam=\eightit
      \scriptscriptfont\itfam=\eightit
  \fi
  \textfont\bffam=\eightbf%
    \scriptfont\bffam=\sixbf%
      \scriptscriptfont\bffam=\fivebf%
  \def\bf{\fam\bffam\eightbf}%
  \textfont\slfam=\eightsl\def\sl{\fam\slfam\eightsl}%
  \ifprod@font
    \scriptfont\slfam=\sixsl
      \scriptscriptfont\slfam=\fivesl
  \else
    \scriptfont\slfam=\eightsl
      \scriptscriptfont\slfam=\eightsl
  \fi
  \textfont\ttfam=\eighttt\def\tt{\fam\ttfam\eighttt}%
  \ifprod@font
    \scriptfont\ttfam=\sixtt
      \scriptscriptfont\ttfam=\fivett
  \else
    \scriptfont\ttfam=\eighttt
      \scriptscriptfont\ttfam=\eighttt
  \fi
  \textfont\scfam=\eightcsc\def\sc{\fam\scfam\eightcsc}%
  \ifprod@font
    \scriptfont\scfam=\sixcsc
      \scriptscriptfont\scfam=\fivecsc
  \else
    \scriptfont\scfam=\eightcsc
      \scriptscriptfont\scfam=\eightcsc
  \fi
  \textfont\sffam=\eightsf\def\sf{\fam\sffam\eightsf}%
  \ifprod@font
    \scriptfont\sffam=\sixsf
      \scriptscriptfont\sffam=\fivesf
  \else
    \scriptfont\sffam=\eightsf
      \scriptscriptfont\sffam=\eightsf
  \fi
  \def\oldstyle{\fam\@ne\eighti}%
  \b@ls{10pt}\rm\@viiipt%
}
\def\@viiipt{}

\def\ninepoint{% 9^6^5 on 11pt (two col) / 12 (single col)
  \def\rm{\fam0\ninerm}%
  \textfont0=\ninerm \scriptfont0=\sixrm \scriptscriptfont0=\fiverm%
  \textfont1=\ninei  \scriptfont1=\sixi  \scriptscriptfont1=\fivei%
  \textfont2=\ninesy \scriptfont2=\sixsy \scriptscriptfont2=\fivesy%
  \textfont\itfam=\nineit\def\it{\fam\itfam\nineit}%
  \ifprod@font
    \scriptfont\itfam=\sixit
      \scriptscriptfont\itfam=\fiveit
  \else
    \scriptfont\itfam=\nineit
      \scriptscriptfont\itfam=\nineit
  \fi
  \textfont\bffam=\ninebf%
    \scriptfont\bffam=\sixbf%
      \scriptscriptfont\bffam=\fivebf%
  \def\bf{\fam\bffam\ninebf}%
  \textfont\slfam=\ninesl\def\sl{\fam\slfam\ninesl}%
  \ifprod@font
    \scriptfont\slfam=\sixsl
      \scriptscriptfont\slfam=\fivesl
  \else
    \scriptfont\slfam=\ninesl
      \scriptscriptfont\slfam=\ninesl
  \fi
  \textfont\ttfam=\ninett\def\tt{\fam\ttfam\ninett}%
  \ifprod@font
    \scriptfont\ttfam=\sixtt
      \scriptscriptfont\ttfam=\fivett
  \else
    \scriptfont\ttfam=\ninett
      \scriptscriptfont\ttfam=\ninett
  \fi
  \textfont\scfam=\ninecsc\def\sc{\fam\scfam\ninecsc}%
  \ifprod@font
    \scriptfont\scfam=\sixcsc
      \scriptscriptfont\scfam=\fivecsc
  \else
    \scriptfont\scfam=\ninecsc
      \scriptscriptfont\scfam=\ninecsc
  \fi
  \textfont\sffam=\ninesf\def\sf{\fam\sffam\ninesf}%
  \ifprod@font
    \scriptfont\sffam=\sixsf
      \scriptscriptfont\sffam=\fivesf
  \else
    \scriptfont\sffam=\ninesf
      \scriptscriptfont\sffam=\ninesf
  \fi
  \def\oldstyle{\fam\@ne\ninei}%
  \b@ls{\TextLeading plus \Feathering}\rm\@ixpt%
}
\def\@ixpt{}

\def\tenpoint{% 10^7^5 on 11pt
  \def\rm{\fam0\tenrm}%
  \textfont0=\tenrm \scriptfont0=\sevenrm \scriptscriptfont0=\fiverm%
  \textfont1=\teni  \scriptfont1=\seveni  \scriptscriptfont1=\fivei%
  \textfont2=\tensy \scriptfont2=\sevensy \scriptscriptfont2=\fivesy%
  \textfont\itfam=\tenit\def\it{\fam\itfam\tenit}%
  \ifprod@font
    \scriptfont\itfam=\sevenit
      \scriptscriptfont\itfam=\fiveit
  \else
    \scriptfont\itfam=\tenit
      \scriptscriptfont\itfam=\tenit
  \fi
  \textfont\bffam=\tenbf%
    \scriptfont\bffam=\sevenbf%
      \scriptscriptfont\bffam=\fivebf%
  \def\bf{\fam\bffam\tenbf}%
  \textfont\slfam=\tensl\def\sl{\fam\slfam\tensl}%
  \ifprod@font
    \scriptfont\slfam=\sevensl
      \scriptscriptfont\slfam=\fivesl
  \else
    \scriptfont\slfam=\tensl
      \scriptscriptfont\slfam=\tensl
  \fi
  \textfont\ttfam=\tentt\def\tt{\fam\ttfam\tentt}%
  \ifprod@font
    \scriptfont\ttfam=\seventt
      \scriptscriptfont\ttfam=\fivett
  \else
    \scriptfont\ttfam=\tentt
      \scriptscriptfont\ttfam=\tentt
  \fi
  \textfont\scfam=\tencsc\def\sc{\fam\scfam\tencsc}%
  \ifprod@font
    \scriptfont\scfam=\sevencsc
      \scriptscriptfont\scfam=\fivecsc
  \else
    \scriptfont\scfam=\tencsc
      \scriptscriptfont\scfam=\tencsc
  \fi
  \textfont\sffam=\tensf\def\sf{\fam\sffam\tensf}%
  \ifprod@font
    \scriptfont\sffam=\sevensf
      \scriptscriptfont\sffam=\fivesf
  \else
    \scriptfont\sffam=\tensf
      \scriptscriptfont\sffam=\tensf
  \fi
  \def\oldstyle{\fam\@ne\teni}%
  \b@ls{11pt}\rm\@xpt%
}
\def\@xpt{}

\def\elevenpoint{% 11^8^6 on 13pt
  \def\rm{\fam0\elevenrm}%
  \textfont0=\elevenrm \scriptfont0=\eightrm \scriptscriptfont0=\sixrm%
  \textfont1=\eleveni  \scriptfont1=\eighti  \scriptscriptfont1=\sixi%
  \textfont2=\elevensy \scriptfont2=\eightsy \scriptscriptfont2=\sixsy%
  \textfont\itfam=\elevenit\def\it{\fam\itfam\elevenit}%
  \ifprod@font
    \scriptfont\itfam=\eightit
      \scriptscriptfont\itfam=\sixit
  \else
    \scriptfont\itfam=\elevenit
      \scriptscriptfont\itfam=\elevenit
  \fi
  \textfont\bffam=\elevenbf%
    \scriptfont\bffam=\eightbf%
      \scriptscriptfont\bffam=\sixbf%
  \def\bf{\fam\bffam\elevenbf}%
  \textfont\slfam=\elevensl\def\sl{\fam\slfam\elevensl}%
  \ifprod@font
    \scriptfont\slfam=\eightsl
      \scriptscriptfont\slfam=\sixsl
  \else
    \scriptfont\slfam=\elevensl
      \scriptscriptfont\slfam=\elevensl
  \fi
  \textfont\ttfam=\eleventt\def\tt{\fam\ttfam\eleventt}%
  \ifprod@font
    \scriptfont\ttfam=\eighttt
      \scriptscriptfont\ttfam=\sixtt
  \else
    \scriptfont\ttfam=\eleventt
      \scriptscriptfont\ttfam=\eleventt
  \fi
  \textfont\scfam=\elevencsc\def\sc{\fam\scfam\elevencsc}%
  \ifprod@font
    \scriptfont\scfam=\eightcsc
      \scriptscriptfont\scfam=\sixcsc
  \else
    \scriptfont\scfam=\elevencsc
      \scriptscriptfont\scfam=\elevencsc
  \fi
  \textfont\sffam=\elevensf\def\sf{\fam\sffam\elevensf}%
  \ifprod@font
    \scriptfont\sffam=\eightsf
      \scriptscriptfont\sffam=\sixsf
  \else
    \scriptfont\sffam=\elevensf
      \scriptscriptfont\sffam=\elevensf
  \fi
  \def\oldstyle{\fam\@ne\eleveni}%
  \b@ls{13pt}\rm\@xipt%
}
\def\@xipt{}

\def\fourteenpoint{% 14^10^7 on 17pt
  \def\rm{\fam0\fourteenrm}%
  \textfont0\fourteenrm  \scriptfont0\tenrm  \scriptscriptfont0\sevenrm%
  \textfont1\fourteeni   \scriptfont1\teni   \scriptscriptfont1\seveni%
  \textfont2\fourteensy  \scriptfont2\tensy  \scriptscriptfont2\sevensy%
  \textfont\itfam=\fourteenit\def\it{\fam\itfam\fourteenit}%
  \ifprod@font
    \scriptfont\itfam=\tenit
      \scriptscriptfont\itfam=\sevenit
  \else
    \scriptfont\itfam=\fourteenit
      \scriptscriptfont\itfam=\fourteenit
  \fi
  \textfont\bffam=\fourteenbf%
    \scriptfont\bffam=\tenbf%
      \scriptscriptfont\bffam=\sevenbf%
  \def\bf{\fam\bffam\fourteenbf}%
  \textfont\slfam=\fourteensl\def\sl{\fam\slfam\fourteensl}%
  \ifprod@font
    \scriptfont\slfam=\tensl
      \scriptscriptfont\slfam=\sevensl
  \else
    \scriptfont\slfam=\fourteensl
      \scriptscriptfont\slfam=\fourteensl
  \fi
  \textfont\ttfam=\fourteentt\def\tt{\fam\ttfam\fourteentt}%
  \ifprod@font
    \scriptfont\ttfam=\tentt
      \scriptscriptfont\ttfam=\seventt
  \else
    \scriptfont\ttfam=\fourteentt
      \scriptscriptfont\ttfam=\fourteentt
  \fi
  \textfont\scfam=\fourteencsc\def\sc{\fam\scfam\fourteencsc}%
  \ifprod@font
    \scriptfont\scfam=\tencsc
      \scriptscriptfont\scfam=\sevencsc
  \else
    \scriptfont\scfam=\fourteencsc
      \scriptscriptfont\scfam=\fourteencsc
  \fi
  \textfont\sffam=\fourteensf\def\sf{\fam\sffam\fourteensf}%
  \ifprod@font
    \scriptfont\sffam=\tensf
      \scriptscriptfont\sffam=\sevensf
  \else
    \scriptfont\sffam=\fourteensf
      \scriptscriptfont\sffam=\fourteensf
  \fi
  \def\oldstyle{\fam\@ne\fourteeni}%
  \b@ls{17pt}\rm\@xivpt%
}
\def\@xivpt{}

\def\seventeenpoint{% 17^12^10 on 20pt
  \def\rm{\fam0\seventeenrm}%
  \textfont0\seventeenrm  \scriptfont0\twelverm  \scriptscriptfont0\tenrm%
  \textfont1\seventeeni   \scriptfont1\twelvei   \scriptscriptfont1\teni%
  \textfont2\seventeensy  \scriptfont2\twelvesy  \scriptscriptfont2\tensy%
  \textfont\itfam=\seventeenit\def\it{\fam\itfam\seventeenit}%
  \ifprod@font
    \scriptfont\itfam=\twelveit
      \scriptscriptfont\itfam=\tenit
  \else
    \scriptfont\itfam=\seventeenit
      \scriptscriptfont\itfam=\seventeenit
  \fi
  \textfont\bffam=\seventeenbf%
    \scriptfont\bffam=\twelvebf%
      \scriptscriptfont\bffam=\tenbf%
  \def\bf{\fam\bffam\seventeenbf}%
  \textfont\slfam=\seventeensl\def\sl{\fam\slfam\seventeensl}%
  \ifprod@font
    \scriptfont\slfam=\twelvesl
      \scriptscriptfont\slfam=\tensl
  \else
    \scriptfont\slfam=\seventeensl
      \scriptscriptfont\slfam=\seventeensl
  \fi
  \textfont\ttfam=\seventeentt\def\tt{\fam\ttfam\seventeentt}%
  \ifprod@font
    \scriptfont\ttfam=\twelvett
      \scriptscriptfont\ttfam=\tentt
  \else
    \scriptfont\ttfam=\seventeentt
      \scriptscriptfont\ttfam=\seventeentt
  \fi
  \textfont\scfam=\seventeencsc\def\sc{\fam\scfam\seventeencsc}%
  \ifprod@font
    \scriptfont\scfam=\twelvecsc
      \scriptscriptfont\scfam=\tencsc
  \else
    \scriptfont\scfam=\seventeencsc
      \scriptscriptfont\scfam=\seventeencsc
  \fi
  \textfont\sffam=\seventeensf\def\sf{\fam\sffam\seventeensf}%
  \ifprod@font
    \scriptfont\sffam=\twelvesf
      \scriptscriptfont\sffam=\tensf
  \else
    \scriptfont\sffam=\seventeensf
      \scriptscriptfont\sffam=\seventeensf
  \fi
  \def\oldstyle{\fam\@ne\seventeeni}%
  \b@ls{20pt}\rm\@xviipt%
}
\def\@xviipt{}

\lineskip=1pt      \normallineskip=\lineskip
\lineskiplimit=\z@ \normallineskiplimit=\lineskiplimit


% BOLD MATH SYMBOLS

\def\loadboldmathnames{%
  \def\balpha{{\bmath{\alpha}}}%
  \def\bbeta{{\bmath{\beta}}}%
  \def\bgamma{{\bmath{\gamma}}}%
  \def\bdelta{{\bmath{\delta}}}%
  \def\bepsilon{{\bmath{\epsilon}}}%
  \def\bzeta{{\bmath{\zeta}}}%
  \def\boldeta{{\bmath{\eta}}}%
  \def\btheta{{\bmath{\theta}}}%
  \def\biota{{\bmath{\iota}}}%
  \def\bkappa{{\bmath{\kappa}}}%
  \def\blambda{{\bmath{\lambda}}}%
  \def\bmu{{\bmath{\mu}}}%
  \def\bnu{{\bmath{\nu}}}%
  \def\bxi{{\bmath{\xi}}}%
  \def\bpi{{\bmath{\pi}}}%
  \def\brho{{\bmath{\rho}}}%
  \def\bsigma{{\bmath{\sigma}}}%
  \def\btau{{\bmath{\tau}}}%
  \def\bupsilon{{\bmath{\upsilon}}}%
  \def\bphi{{\bmath{\phi}}}%
  \def\bchi{{\bmath{\chi}}}%
  \def\bpsi{{\bmath{\psi}}}%
  \def\bomega{{\bmath{\omega}}}%
  \def\bvarepsilon{{\bmath{\varepsilon}}}%
  \def\bvartheta{{\bmath{\vartheta}}}%
  \def\bvarpi{{\bmath{\varpi}}}%
  \def\bvarrho{{\bmath{\varrho}}}%
  \def\bvarsigma{{\bmath{\varsigma}}}%
  \def\bvarphi{{\bmath{\varphi}}}%
  \def\baleph{{\bmath{\aleph}}}%
  \def\bimath{{\bmath{\imath}}}%
  \def\bjmath{{\bmath{\jmath}}}%
  \def\bell{{\bmath{\ell}}}%
  \def\bwp{{\bmath{\wp}}}%
  \def\bRe{{\bmath{\Re}}}%
  \def\bIm{{\bmath{\Im}}}%
  \def\bpartial{{\bmath{\partial}}}%
  \def\binfty{{\bmath{\infty}}}%
  \def\bprime{{\bmath{\prime}}}%
  \def\bemptyset{{\bmath{\emptyset}}}%
  \def\bnabla{{\bmath{\nabla}}}%
  \def\btop{{\bmath{\top}}}%
  \def\bbot{{\bmath{\bot}}}%
  \def\btriangle{{\bmath{\triangle}}}%
  \def\bforall{{\bmath{\forall}}}%
  \def\bexists{{\bmath{\exists}}}%
  \def\bneg{{\bmath{\neg}}}%
  \def\bflat{{\bmath{\flat}}}%
  \def\bnatural{{\bmath{\natural}}}%
  \def\bsharp{{\bmath{\sharp}}}%
  \def\bclubsuit{{\bmath{\clubsuit}}}%
  \def\bdiamondsuit{{\bmath{\diamondsuit}}}%
  \def\bheartsuit{{\bmath{\heartsuit}}}%
  \def\bspadesuit{{\bmath{\spadesuit}}}%
  \def\bsmallint{{\bmath{\smallint}}}%
  \def\btriangleleft{{\bmath{\triangleleft}}}%
  \def\btriangleright{{\bmath{\triangleright}}}%
  \def\bbigtriangleup{{\bmath{\bigtriangleup}}}%
  \def\bbigtriangledown{{\bmath{\bigtriangledown}}}%
  \def\bwedge{{\bmath{\wedge}}}%
  \def\bvee{{\bmath{\vee}}}%
  \def\bcap{{\bmath{\cap}}}%
  \def\bcup{{\bmath{\cup}}}%
  \def\bddagger{{\bmath{\ddagger}}}%
  \def\bdagger{{\bmath{\dagger}}}%
  \def\bsqcap{{\bmath{\sqcap}}}%
  \def\bsqcup{{\bmath{\sqcup}}}%
  \def\buplus{{\bmath{\uplus}}}%
  \def\bamalg{{\bmath{\amalg}}}%
  \def\bdiamond{{\bmath{\diamond}}}%
  \def\bbullet{{\bmath{\bullet}}}%
  \def\bwr{{\bmath{\wr}}}%
  \def\bdiv{{\bmath{\div}}}%
  \def\bodot{{\bmath{\odot}}}%
  \def\boslash{{\bmath{\oslash}}}%
  \def\botimes{{\bmath{\otimes}}}%
  \def\bominus{{\bmath{\ominus}}}%
  \def\boplus{{\bmath{\oplus}}}%
  \def\bmp{{\bmath{\mp}}}%
  \def\bpm{{\bmath{\pm}}}%
  \def\bcirc{{\bmath{\circ}}}%
  \def\bbigcirc{{\bmath{\bigcirc}}}%
  \def\bsetminus{{\bmath{\setminus}}}%
  \def\bcdot{{\bmath{\cdot}}}%
  \def\bast{{\bmath{\ast}}}%
  \def\btimes{{\bmath{\times}}}%
  \def\bstar{{\bmath{\star}}}%
  \def\bpropto{{\bmath{\propto}}}%
  \def\bsqsubseteq{{\bmath{\sqsubseteq}}}%
  \def\bsqsupseteq{{\bmath{\sqsupseteq}}}%
  \def\bparallel{{\bmath{\parallel}}}%
  \def\bmid{{\bmath{\mid}}}%
  \def\bdashv{{\bmath{\dashv}}}%
  \def\bvdash{{\bmath{\vdash}}}%
  \def\bnearrow{{\bmath{\nearrow}}}%
  \def\bsearrow{{\bmath{\searrow}}}%
  \def\bnwarrow{{\bmath{\nwarrow}}}%
  \def\bswarrow{{\bmath{\swarrow}}}%
  \def\bLeftrightarrow{{\bmath{\Leftrightarrow}}}%
  \def\bLeftarrow{{\bmath{\Leftarrow}}}%
  \def\bRightarrow{{\bmath{\Rightarrow}}}%
  \def\bleq{{\bmath{\leq}}}%
  \def\bgeq{{\bmath{\geq}}}%
  \def\bsucc{{\bmath{\succ}}}%
  \def\bprec{{\bmath{\prec}}}%
  \def\bapprox{{\bmath{\approx}}}%
  \def\bsucceq{{\bmath{\succeq}}}%
  \def\bpreceq{{\bmath{\preceq}}}%
  \def\bsupset{{\bmath{\supset}}}%
  \def\bsubset{{\bmath{\subset}}}%
  \def\bsupseteq{{\bmath{\supseteq}}}%
  \def\bsubseteq{{\bmath{\subseteq}}}%
  \def\bin{{\bmath{\in}}}%
  \def\bni{{\bmath{\ni}}}%
  \def\bgg{{\bmath{\gg}}}%
  \def\bll{{\bmath{\ll}}}%
  \def\bnot{{\bmath{\not}}}%
  \def\bleftrightarrow{{\bmath{\leftrightarrow}}}%
  \def\bleftarrow{{\bmath{\leftarrow}}}%
  \def\brightarrow{{\bmath{\rightarrow}}}%
  \def\bmapstochar{{\bmath{\mapstochar}}}%
  \def\bsim{{\bmath{\sim}}}%
  \def\bsimeq{{\bmath{\simeq}}}%
  \def\bperp{{\bmath{\perp}}}%
  \def\bequiv{{\bmath{\equiv}}}%
  \def\basymp{{\bmath{\asymp}}}%
  \def\bsmile{{\bmath{\smile}}}%
  \def\bfrown{{\bmath{\frown}}}%
  \def\bleftharpoonup{{\bmath{\leftharpoonup}}}%
  \def\bleftharpoondown{{\bmath{\leftharpoondown}}}%
  \def\brightharpoonup{{\bmath{\rightharpoonup}}}%
  \def\brightharpoondown{{\bmath{\rightharpoondown}}}%
  \def\blhook{{\bmath{\lhook}}}%
  \def\brhook{{\bmath{\rhook}}}%
  \def\bldotp{{\bmath{\ldotp}}}%
  \def\bcdotp{{\bmath{\cdotp}}}%
}

% Make \, work in non-math mode
\def\,{\relax\ifmmode \mskip\thinmuskip\else \thinspace\fi}
\let\protect=\relax

\long\def\@ifundefined#1#2#3{\expandafter\ifx\csname
  #1\endcsname\relax#2\else#3\fi}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% NewFont.sty: ALPHA VERSION patchlevel 8, 16th August 1994, M. Reed

% \addtom@thgroup{math font loading info}
% Adds to internal \math@groups definition, which is executed at the end
% of each size changing command. It is called by \NewSymbolFont.

\newtoks\math@groups \math@groups={}
\def\addtom@thgroup#1#2{#1\expandafter{\the#1#2}} %  \mac={new\the\mac}


% Make TeX change the values of \s@ze, \ss@ze, \sss@ze when \@npt is
% executed. This makes it possible for math characters to be loaded
% at the correct size automatically when the size is changed.

% \addtosizeh@ok{x}{10}{7}{5}

\def\addtosizeh@ok#1#2#3#4{%
  \expandafter\def\csname @#1pt\endcsname{%
    \def\s@ze{#2}\def\ss@ze{#3}\def\sss@ze{#4}\the\math@groups%
  }%
}


% \resetsizehook allows the size parameters to be reset after \addtosizeh@ok
% has been called (it re-defines \@npt).
% e.g JFM which requires \xpt to have 10.5pt instead of 10pt.
% Note: \resetsizehook must be used in the preamble BEFORE any
% \New... commands.

% e.g. \resetsizehook{x}{10.5}{7}{5}

\let\resetsizehook=\addtosizeh@ok


% Standard LaTeX sizes

\ifprod@font
%  \addtosizeh@ok{v}    {5} {5}  {5}
%  \addtosizeh@ok{vi}   {6} {6}  {6}
%  \addtosizeh@ok{vii}  {7} {6}  {5}
  \addtosizeh@ok{viii} {8} {6}  {5}
  \addtosizeh@ok{ix}   {9} {6}  {5}
  \addtosizeh@ok{x}    {10}{7}  {5}
  \addtosizeh@ok{xi}   {11}{8}  {6}
%  \addtosizeh@ok{xii}  {12}{8}  {6}
  \addtosizeh@ok{xiv}  {14}{10} {7}
  \addtosizeh@ok{xvii} {17}{12}{10}
%  \addtosizeh@ok{xx}   {20}{14}{12}
%  \addtosizeh@ok{xxv}  {25}{20}{17}
\else
%  \addtosizeh@ok{v}    {5}     {5}     {5}
%  \addtosizeh@ok{vi}   {6}     {6}     {6}
%  \addtosizeh@ok{vii}  {7}     {6}     {5}
  \addtosizeh@ok{viii} {8}     {6}     {5}
  \addtosizeh@ok{ix}   {9}     {6}     {5}
  \addtosizeh@ok{x}    {10}    {7}     {5}
  \addtosizeh@ok{xi}   {10.95} {8}     {6}
%  \addtosizeh@ok{xii}  {12}    {8}     {6}
  \addtosizeh@ok{xiv}  {14.4}  {10}    {7}
  \addtosizeh@ok{xvii} {17.28} {12}    {10}
%  \addtosizeh@ok{xx}   {20.74} {14.4}  {12}
%  \addtosizeh@ok{xxv}  {24.88} {20.74} {17.28}
\fi


\def\get@font#1#2#3{%
  \edef\fonts@ze{\romannumeral#3}%         10 -> x
  \edef\fontn@me{\fonts@ze#1}%             AMSa -> xAMSa
  \@ifundefined{\fontn@me}%
    {%%\typeout{defining \fontn@me}%
     \global\expandafter\font\csname \fontn@me\endcsname=#2 at #3pt}%
    {}%
}

\def\ass@tfont#1#2{%
  \xdef\fam@name{\csname #1\endcsname}%
  \xdef\font@name{\csname #2\endcsname}%
  \let\textfont@name\font@name
  \textfont\fam@name\textfont@name
}

\def\ass@sfont#1#2{%
  \xdef\fam@name{\csname #1\endcsname}%
  \xdef\font@name{\csname #2\endcsname}%
  \let\textfont@name\font@name
  \scriptfont\fam@name\textfont@name
}

\def\ass@ssfont#1#2{%
  \xdef\fam@name{\csname #1\endcsname}%
  \xdef\font@name{\csname #2\endcsname}%
  \let\textfont@name\font@name
  \scriptscriptfont\fam@name\textfont@name
}


%                fam name  base font  (allocates a \newfam)
% \NewSymbolFont {AMSa}    {mtxm10}

\def\NewSymbolFont#1#2{%
  \expandafter\ifx\csname sym#1fam\endcsname\relax % if not defined
    \expandafter\newfam\csname sym#1fam\endcsname
    \expandafter\edef\csname sym#1fam\endcsname{\the\allocationnumber}%
    \addtom@thgroup\math@groups{%
      \get@font{#1}{#2}{\s@ze}%
      \ass@tfont{sym#1fam}{\fontn@me}%
      \get@font{#1}{#2}{\ss@ze}%
      \ass@sfont{sym#1fam}{\fontn@me}%
      \get@font{#1}{#2}{\sss@ze}%
      \ass@ssfont{sym#1fam}{\fontn@me}%
    }%
  \else
    \errmessage{Family `#1' already defined}%
  \fi
}


%                symbol         type fam    pos (hex)
% \NewMathSymbol {\blacksquare} {0}  {AMSa} {04}

\def\NewMathSymbol#1#2#3#4{%
  \edef\f@mly{\expandafter\hexnumber{\csname sym#3fam\endcsname}}%
  \mathchardef#1="#2\f@mly#4\relax
}


%                  macro name  type  fam1   pos  fam2   pos
% \NewMathDelimiter{\ulcorner} {4}   {AMSa} {70} {AMSb} {70}

\newif\ifd@f

\def\NewMathDelimiter#1#2#3#4#5#6{%
  \d@ftrue
  \expandafter\ifx\csname sym#3fam\endcsname\relax
    \d@ffalse \errmessage{Family `#3' is not defined}%
  \fi
  \expandafter\ifx\csname sym#5fam\endcsname\relax
    \d@ffalse \errmessage{Family `#5' is not defined}%
  \fi
  \ifd@f
    \edef\f@mly{\expandafter\hexnumber{\csname sym#3fam\endcsname}}%
    \edef\f@mlytw@{\expandafter\hexnumber{\csname sym#5fam\endcsname}}%
    \xdef#1{\delimiter"#2\f@mly #4\f@mlytw@ #6\relax}%
  \fi
}


%                  macro name  base font  skewchar setting e.g '60 (octal)
% \NewMathAlphabet {mathbssi}  {mtmisb10} {}

\def\setboxz@h{\setbox\z@\hbox}
\def\wdz@{\wd\z@}
\def\boxz@{\box\z@}
\def\setbox@ne{\setbox\@ne}
\def\wd@ne{\wd\@ne}

\def\math@atom#1#2{%
   \binrel@{#1}\binrel@@{#2}}
\def\binrel@#1{\setboxz@h{\thinmuskip0mu
  \medmuskip\m@ne mu\thickmuskip\@ne mu$#1\m@th$}%
 \setbox@ne\hbox{\thinmuskip0mu\medmuskip\m@ne mu\thickmuskip
  \@ne mu${}#1{}\m@th$}%
 \setbox\tw@\hbox{\hskip\wd@ne\hskip-\wdz@}}
\def\binrel@@#1{\ifdim\wd2<\z@\mathbin{#1}\else\ifdim\wd\tw@>\z@
 \mathrel{#1}\else{#1}\fi\fi}

\def\m@thit{1}

\def\set@skchar#1{\global\expandafter\skewchar
  \csname\fontn@me\endcsname=#1\relax}

\def\NewMathAlphabet#1#2#3{%
  \def\tst{#3}%
  \ifx\tst\empty\else % if a \skewchar setting is present
    \expandafter\gdef\csname #1@sc\endcsname{}%  \def\cmd@sc{..}
  \fi
  %
  \expandafter\def\csname #1\endcsname{%  \def\cmd{\protect\@cmd}
    \protect\csname @#1\endcsname}%
  %
  \expandafter\def\csname @#1\endcsname##1{%  \def\@cmd{..}
    {%
    \begingroup
      \get@font{#1}{#2}{\s@ze}%
      \@ifundefined{#1@sc}{}{\set@skchar{#3}}%
      \ass@tfont{m@thit}{\fontn@me}%
      \get@font{#1}{#2}{\ss@ze}%
      \@ifundefined{#1@sc}{}{\set@skchar{#3}}%
      \ass@sfont{m@thit}{\fontn@me}%
      \get@font{#1}{#2}{\sss@ze}%
      \@ifundefined{#1@sc}{}{\set@skchar{#3}}%
      \ass@ssfont{m@thit}{\fontn@me}%
      %
      \math@atom{##1}{%
      \mathchoice%
        {\hbox{$\m@th\displaystyle##1$}}%
        {\hbox{$\m@th\textstyle##1$}}%
        {\hbox{$\m@th\scriptstyle##1$}}%
        {\hbox{$\m@th\scriptscriptstyle##1$}}}%
    \endgroup
    }%
  }%
}


%                  macro name  base font  hyphenchar setting e.g -1 (off)
% \NewTextAlphabet {textbfit}  {mtbxti10} {}

% save a family if \NewTextAlphabet is not used.
\newif\iffirstta  \firsttatrue

\def\set@hchar#1{\global\expandafter\hyphenchar
  \csname\fontn@me\endcsname=#1\relax}

\def\NewTextAlphabet#1#2#3{%
  \iffirstta
    \global\firsttafalse
    \newfam\scratchfam
    \edef\scrt@fam{\the\allocationnumber}%
  \fi
  \def\tst{#3}%
  \ifx\tst\empty\else % if a \hyphenchar setting is required
    \expandafter\gdef\csname #1@hc\endcsname{}%  \def\cmd@sc{..}
  \fi
  %
  \expandafter\def\csname #1\endcsname{%  \def\cmd{\protect\t@cmd}
    \protect\csname t@#1\endcsname}%
  %
  \long\expandafter\def\csname t@#1\endcsname##1{%  \def\t@cmd{..}
    \ifmmode
      \typeout{Warning: do not use \expandafter\string\csname #1\endcsname
        \space in math mode}\fi%
    {%
      \get@font{#1}{#2}{\s@ze}\let\t@xtfnt=\fontn@me\relax
      \@ifundefined{#1@hc}{}{\set@hchar{#3}}%
      \ass@tfont{scrt@fam}{\fontn@me}%
      \get@font{#1}{#2}{\ss@ze}%
      \@ifundefined{#1@hc}{}{\set@hchar{#3}}%
      \ass@sfont{scrt@fam}{\fontn@me}%
      \get@font{#1}{#2}{\sss@ze}%
      \@ifundefined{#1@hc}{}{\set@hchar{#3}}%
      \ass@ssfont{scrt@fam}{\fontn@me}%
      \fam\scratchfam\csname\t@xtfnt\endcsname
    ##1%
    }%
  }%
  %
  \expandafter\def\csname #1shape%  \def\cmdshape{\protect\@cmdshape}
    \endcsname{\protect\csname @#1shape\endcsname}%
  %
  \expandafter\def\csname @#1shape\endcsname{%  \def\@cmdshape
    \ifmmode
      \typeout{Warning: do not use \expandafter\string\csname
        #1shape\endcsname \space in math mode}\fi
      %
      \get@font{#1}{#2}{\s@ze}\let\t@xtfnt=\fontn@me\relax
      \@ifundefined{#1@hc}{}{\set@hchar{#3}}%
      \ass@tfont{scrt@fam}{\fontn@me}%
      \get@font{#1}{#2}{\ss@ze}%
      \@ifundefined{#1@hc}{}{\set@hchar{#3}}%
      \ass@sfont{scrt@fam}{\fontn@me}%
      \get@font{#1}{#2}{\sss@ze}%
      \@ifundefined{#1@hc}{}{\set@hchar{#3}}%
      \ass@ssfont{scrt@fam}{\fontn@me}%
      \fam\scratchfam\csname\t@xtfnt\endcsname
  }%
}


% \bmath{math text}

\ifprod@font
  \def\math@itfnt{mtmib10}
  \def\math@syfnt{mtbsy10}
\else
  \def\math@itfnt{cmmib10}
  \def\math@syfnt{cmbsy10}
\fi

\def\m@thsy{2}

\def\bmath{\protect\@bmath}
\def\@bmath#1{%
  {%
  \begingroup
    \get@font{mthit}{\math@itfnt}{\s@ze}\set@skchar{'177}%
    \ass@tfont{m@thit}{\fontn@me}%
    \get@font{mthit}{\math@itfnt}{\ss@ze}\set@skchar{'177}%
    \ass@sfont{m@thit}{\fontn@me}%
    \get@font{mthit}{\math@itfnt}{\sss@ze}\set@skchar{'177}%
    \ass@ssfont{m@thit}{\fontn@me}%
    %
    \get@font{mthsy}{\math@syfnt}{\s@ze}\set@skchar{'60}%
    \ass@tfont{m@thsy}{\fontn@me}%
    \get@font{mthsy}{\math@syfnt}{\ss@ze}\set@skchar{'60}%
    \ass@sfont{m@thsy}{\fontn@me}%
    \get@font{mthsy}{\math@syfnt}{\sss@ze}\set@skchar{'60}%
    \ass@ssfont{m@thsy}{\fontn@me}%
    %
    \math@atom{#1}{%
    \mathchoice%
      {\hbox{$\m@th\displaystyle#1$}}%
      {\hbox{$\m@th\textstyle#1$}}%
      {\hbox{$\m@th\scriptstyle#1$}}%
      {\hbox{$\m@th\scriptscriptstyle#1$}}}%
  \endgroup
  }%
}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


% Astronomy and Astrophysics symbol macros

\def\la{\mathrel{\mathchoice {\vcenter{\offinterlineskip\halign{\hfil
$\displaystyle##$\hfil\cr<\cr\sim\cr}}}
{\vcenter{\offinterlineskip\halign{\hfil$\textstyle##$\hfil\cr
<\cr\sim\cr}}}
{\vcenter{\offinterlineskip\halign{\hfil$\scriptstyle##$\hfil\cr
<\cr\sim\cr}}}
{\vcenter{\offinterlineskip\halign{\hfil$\scriptscriptstyle##$\hfil\cr
<\cr\sim\cr}}}}}

\def\ga{\mathrel{\mathchoice {\vcenter{\offinterlineskip\halign{\hfil
$\displaystyle##$\hfil\cr>\cr\sim\cr}}}
{\vcenter{\offinterlineskip\halign{\hfil$\textstyle##$\hfil\cr
>\cr\sim\cr}}}
{\vcenter{\offinterlineskip\halign{\hfil$\scriptstyle##$\hfil\cr
>\cr\sim\cr}}}
{\vcenter{\offinterlineskip\halign{\hfil$\scriptscriptstyle##$\hfil\cr
>\cr\sim\cr}}}}}

\def\getsto{\mathrel{\mathchoice {\vcenter{\offinterlineskip
\halign{\hfil
$\displaystyle##$\hfil\cr\gets\cr\to\cr}}}
{\vcenter{\offinterlineskip\halign{\hfil$\textstyle##$\hfil\cr\gets
\cr\to\cr}}}
{\vcenter{\offinterlineskip\halign{\hfil$\scriptstyle##$\hfil\cr\gets
\cr\to\cr}}}
{\vcenter{\offinterlineskip\halign{\hfil$\scriptscriptstyle##$\hfil\cr
\gets\cr\to\cr}}}}}

\def\cor{\mathrel{\mathchoice {\hbox{$\widehat=$}}{\hbox{$\widehat=$}}
{\hbox{$\scriptstyle\hat=$}}
{\hbox{$\scriptscriptstyle\hat=$}}}}

\def\lid{\mathrel{\mathchoice {\vcenter{\offinterlineskip\halign{\hfil
$\displaystyle##$\hfil\cr<\cr\noalign{\vskip1.2pt}=\cr}}}
{\vcenter{\offinterlineskip\halign{\hfil$\textstyle##$\hfil\cr<\cr
\noalign{\vskip1.2pt}=\cr}}}
{\vcenter{\offinterlineskip\halign{\hfil$\scriptstyle##$\hfil\cr<\cr
\noalign{\vskip1pt}=\cr}}}
{\vcenter{\offinterlineskip\halign{\hfil$\scriptscriptstyle##$\hfil\cr
<\cr
\noalign{\vskip0.9pt}=\cr}}}}}

\def\gid{\mathrel{\mathchoice {\vcenter{\offinterlineskip\halign{\hfil
$\displaystyle##$\hfil\cr>\cr\noalign{\vskip1.2pt}=\cr}}}
{\vcenter{\offinterlineskip\halign{\hfil$\textstyle##$\hfil\cr>\cr
\noalign{\vskip1.2pt}=\cr}}}
{\vcenter{\offinterlineskip\halign{\hfil$\scriptstyle##$\hfil\cr>\cr
\noalign{\vskip1pt}=\cr}}}
{\vcenter{\offinterlineskip\halign{\hfil$\scriptscriptstyle##$\hfil\cr
>\cr
\noalign{\vskip0.9pt}=\cr}}}}}

\def\sol{\mathrel{\mathchoice {\vcenter{\offinterlineskip\halign{\hfil
$\displaystyle##$\hfil\cr\sim\cr<\cr}}}
{\vcenter{\offinterlineskip\halign{\hfil$\textstyle##$\hfil\cr\sim\cr
<\cr}}}
{\vcenter{\offinterlineskip\halign{\hfil$\scriptstyle##$\hfil\cr\sim\cr
<\cr}}}
{\vcenter{\offinterlineskip\halign{\hfil$\scriptscriptstyle##$\hfil\cr
\sim\cr<\cr}}}}}

\def\sog{\mathrel{\mathchoice {\vcenter{\offinterlineskip\halign{\hfil
$\displaystyle##$\hfil\cr\sim\cr>\cr}}}
{\vcenter{\offinterlineskip\halign{\hfil$\textstyle##$\hfil\cr\sim\cr
>\cr}}}
{\vcenter{\offinterlineskip\halign{\hfil$\scriptstyle##$\hfil\cr
\sim\cr>\cr}}}
{\vcenter{\offinterlineskip\halign{\hfil$\scriptscriptstyle##$\hfil\cr
\sim\cr>\cr}}}}}

\def\lse{\mathrel{\mathchoice {\vcenter{\offinterlineskip\halign{\hfil
$\displaystyle##$\hfil\cr<\cr\simeq\cr}}}
{\vcenter{\offinterlineskip\halign{\hfil$\textstyle##$\hfil\cr
<\cr\simeq\cr}}}
{\vcenter{\offinterlineskip\halign{\hfil$\scriptstyle##$\hfil\cr
<\cr\simeq\cr}}}
{\vcenter{\offinterlineskip\halign{\hfil$\scriptscriptstyle##$\hfil\cr
<\cr\simeq\cr}}}}}

\def\gse{\mathrel{\mathchoice {\vcenter{\offinterlineskip\halign{\hfil
$\displaystyle##$\hfil\cr>\cr\simeq\cr}}}
{\vcenter{\offinterlineskip\halign{\hfil$\textstyle##$\hfil\cr
>\cr\simeq\cr}}}
{\vcenter{\offinterlineskip\halign{\hfil$\scriptstyle##$\hfil\cr
>\cr\simeq\cr}}}
{\vcenter{\offinterlineskip\halign{\hfil$\scriptscriptstyle##$\hfil\cr
>\cr\simeq\cr}}}}}

\def\grole{\mathrel{\mathchoice {\vcenter{\offinterlineskip\halign{\hfil
$\displaystyle##$\hfil\cr>\cr\noalign{\vskip-1.5pt}<\cr}}}
{\vcenter{\offinterlineskip\halign{\hfil$\textstyle##$\hfil\cr
>\cr\noalign{\vskip-1.5pt}<\cr}}}
{\vcenter{\offinterlineskip\halign{\hfil$\scriptstyle##$\hfil\cr
>\cr\noalign{\vskip-1pt}<\cr}}}
{\vcenter{\offinterlineskip\halign{\hfil$\scriptscriptstyle##$\hfil\cr
>\cr\noalign{\vskip-0.5pt}<\cr}}}}}

\def\leogr{\mathrel{\mathchoice {\vcenter{\offinterlineskip\halign{\hfil
$\displaystyle##$\hfil\cr<\cr\noalign{\vskip-1.5pt}>\cr}}}
{\vcenter{\offinterlineskip\halign{\hfil$\textstyle##$\hfil\cr
<\cr\noalign{\vskip-1.5pt}>\cr}}}
{\vcenter{\offinterlineskip\halign{\hfil$\scriptstyle##$\hfil\cr
<\cr\noalign{\vskip-1pt}>\cr}}}
{\vcenter{\offinterlineskip\halign{\hfil$\scriptscriptstyle##$\hfil\cr
<\cr\noalign{\vskip-0.5pt}>\cr}}}}}

\def\loa{\mathrel{\mathchoice {\vcenter{\offinterlineskip\halign{\hfil
$\displaystyle##$\hfil\cr<\cr\approx\cr}}}
{\vcenter{\offinterlineskip\halign{\hfil$\textstyle##$\hfil\cr
<\cr\approx\cr}}}
{\vcenter{\offinterlineskip\halign{\hfil$\scriptstyle##$\hfil\cr
<\cr\approx\cr}}}
{\vcenter{\offinterlineskip\halign{\hfil$\scriptscriptstyle##$\hfil\cr
<\cr\approx\cr}}}}}

\def\goa{\mathrel{\mathchoice {\vcenter{\offinterlineskip\halign{\hfil
$\displaystyle##$\hfil\cr>\cr\approx\cr}}}
{\vcenter{\offinterlineskip\halign{\hfil$\textstyle##$\hfil\cr
>\cr\approx\cr}}}
{\vcenter{\offinterlineskip\halign{\hfil$\scriptstyle##$\hfil\cr
>\cr\approx\cr}}}
{\vcenter{\offinterlineskip\halign{\hfil$\scriptscriptstyle##$\hfil\cr
>\cr\approx\cr}}}}}

\def\sun{\hbox{$\odot$}}
\def\degr{\hbox{$^\circ$}}
\def\diameter{{\ifmmode\mathchoice
{\ooalign{\hfil\hbox{$\displaystyle/$}\hfil\crcr
{\hbox{$\displaystyle\mathchar"20D$}}}}
{\ooalign{\hfil\hbox{$\textstyle/$}\hfil\crcr
{\hbox{$\textstyle\mathchar"20D$}}}}
{\ooalign{\hfil\hbox{$\scriptstyle/$}\hfil\crcr
{\hbox{$\scriptstyle\mathchar"20D$}}}}
{\ooalign{\hfil\hbox{$\scriptscriptstyle/$}\hfil\crcr
{\hbox{$\scriptscriptstyle\mathchar"20D$}}}}
\else{\ooalign{\hfil/\hfil\crcr\mathhexbox20D}}%
\fi}}

\def\sq{\ifmmode\squareforqed\else{\unskip\nobreak\hfil
\penalty50\hskip1em\null\nobreak\hfil\squareforqed
\parfillskip=0pt\finalhyphendemerits=0\endgraf}\fi}
\def\squareforqed{\hbox{\rlap{$\sqcap$}$\sqcup$}}

\def\fd{\hbox{$.\!\!^{\rm d}$}}
\def\fh{\hbox{$.\!\!^{\rm h}$}}
\def\fm{\hbox{$.\!\!^{\rm m}$}}
\def\fs{\hbox{$.\!\!^{\rm s}$}}
\def\fdg{\hbox{$.\!\!^\circ$}}
\def\farcm{\hbox{$.\mkern-4mu^\prime$}}
\def\farcs{\hbox{$.\!\!^{\prime\prime}$}}
\def\fp{\hbox{$.\!\!^{\scriptscriptstyle\rm p}$}}
\def\arcmin{\hbox{$^\prime$}}
\def\arcsec{\hbox{$^{\prime\prime}$}}

% Simulated Blackboard Bold symbols

\def\bbbr{{\rm I\!R}}
\def\bbbm{{\rm I\!M}}
\def\bbbn{{\rm I\!N}}
\def\bbbf{{\rm I\!F}}
\def\bbbh{{\rm I\!H}}
\def\bbbk{{\rm I\!K}}
\def\bbbp{{\rm I\!P}}
\def\bbbone{{\mathchoice {\rm 1\mskip-4mu l} {\rm 1\mskip-4mu l}
{\rm 1\mskip-4.5mu l} {\rm 1\mskip-5mu l}}}
\def\bbbc{{\mathchoice {\setbox0=\hbox{$\displaystyle\rm C$}\hbox{\hbox
to0pt{\kern0.4\wd0\vrule height0.9\ht0\hss}\box0}}
{\setbox0=\hbox{$\textstyle\rm C$}\hbox{\hbox
to0pt{\kern0.4\wd0\vrule height0.9\ht0\hss}\box0}}
{\setbox0=\hbox{$\scriptstyle\rm C$}\hbox{\hbox
to0pt{\kern0.4\wd0\vrule height0.9\ht0\hss}\box0}}
{\setbox0=\hbox{$\scriptscriptstyle\rm C$}\hbox{\hbox
to0pt{\kern0.4\wd0\vrule height0.9\ht0\hss}\box0}}}}
\def\bbbq{{\mathchoice {\setbox0=\hbox{$\displaystyle\rm
Q$}\hbox{\raise
0.15\ht0\hbox to0pt{\kern0.4\wd0\vrule height0.8\ht0\hss}\box0}}
{\setbox0=\hbox{$\textstyle\rm Q$}\hbox{\raise
0.15\ht0\hbox to0pt{\kern0.4\wd0\vrule height0.8\ht0\hss}\box0}}
{\setbox0=\hbox{$\scriptstyle\rm Q$}\hbox{\raise
0.15\ht0\hbox to0pt{\kern0.4\wd0\vrule height0.7\ht0\hss}\box0}}
{\setbox0=\hbox{$\scriptscriptstyle\rm Q$}\hbox{\raise
0.15\ht0\hbox to0pt{\kern0.4\wd0\vrule height0.7\ht0\hss}\box0}}}}
\def\bbbt{{\mathchoice {\setbox0=\hbox{$\displaystyle\rm
T$}\hbox{\hbox to0pt{\kern0.3\wd0\vrule height0.9\ht0\hss}\box0}}
{\setbox0=\hbox{$\textstyle\rm T$}\hbox{\hbox
to0pt{\kern0.3\wd0\vrule height0.9\ht0\hss}\box0}}
{\setbox0=\hbox{$\scriptstyle\rm T$}\hbox{\hbox
to0pt{\kern0.3\wd0\vrule height0.9\ht0\hss}\box0}}
{\setbox0=\hbox{$\scriptscriptstyle\rm T$}\hbox{\hbox
to0pt{\kern0.3\wd0\vrule height0.9\ht0\hss}\box0}}}}
\def\bbbs{{\mathchoice
{\setbox0=\hbox{$\displaystyle     \rm S$}\hbox{\raise0.5\ht0\hbox
to0pt{\kern0.35\wd0\vrule height0.45\ht0\hss}\hbox
to0pt{\kern0.55\wd0\vrule height0.5\ht0\hss}\box0}}
{\setbox0=\hbox{$\textstyle        \rm S$}\hbox{\raise0.5\ht0\hbox
to0pt{\kern0.35\wd0\vrule height0.45\ht0\hss}\hbox
to0pt{\kern0.55\wd0\vrule height0.5\ht0\hss}\box0}}
{\setbox0=\hbox{$\scriptstyle      \rm S$}\hbox{\raise0.5\ht0\hbox
to0pt{\kern0.35\wd0\vrule height0.45\ht0\hss}\raise0.05\ht0\hbox
to0pt{\kern0.5\wd0\vrule height0.45\ht0\hss}\box0}}
{\setbox0=\hbox{$\scriptscriptstyle\rm S$}\hbox{\raise0.5\ht0\hbox
to0pt{\kern0.4\wd0\vrule height0.45\ht0\hss}\raise0.05\ht0\hbox
to0pt{\kern0.55\wd0\vrule height0.45\ht0\hss}\box0}}}}
\def\bbbz{{\mathchoice {\hbox{$\sf\textstyle Z\kern-0.4em Z$}}
{\hbox{$\sf\textstyle Z\kern-0.4em Z$}}
{\hbox{$\sf\scriptstyle Z\kern-0.3em Z$}}
{\hbox{$\sf\scriptscriptstyle Z\kern-0.2em Z$}}}}


% NUMBER THE DESIGN ELEMENTS

\def\Nulle{0} % null element
\def\Afe{1}   % author affiliation
\def\Hae{2}   % heading A
\def\Hbe{3}   % heading B
\def\Hce{4}   % heading C
\def\Hde{5}   % heading D


% TEMPORARY REGISTERS

\newcount\LastMac       \LastMac=\Nulle

\newskip\half      \half=5.5pt plus 1.5pt minus 2.25pt
\newskip\one       \one=11pt plus 3pt minus 5.5pt
\newskip\onehalf   \onehalf=16.5pt plus 5.5pt minus 8.25pt
\newskip\two       \two=22pt plus 5.5pt minus 11pt

\def\Half{\addvspace{\half}}
\def\One{\addvspace{\one}}
\def\OneHalf{\addvspace{\onehalf}}
\def\Two{\addvspace{\two}}

\def\Referee{% produce version for refereeing
  \def\baselinestretch{2}%
  \ninepoint
}

\def\Raggedright{% set lines unjustified
  \rightskip=\z@ plus \hsize\relax
}

\def\Fullout{% set lines justified
  \rightskip=\z@\relax
}

\def\Hang#1#2{% set hanging indentation
  \hangindent=#1%
  \hangafter=#2\relax
}

\def\makeatletter{\catcode `\@=11\relax}
\def\makeatother{\catcode `\@=12\relax}


% Pagestyles

\newif\ifsp@page
\def\pagestyle#1{\csname ps@#1\endcsname}
\def\thispagestyle#1{\global\sp@pagetrue\gdef\sp@type{#1}}

\def\ps@titlepage{%
  \def\@oddhead{\eightpoint\noindent \the\CatchLine
    \ifprod@font\else\qquad Printed\ \today\qquad
      (MN plain \TeX\ macros\ v\@version)\fi \hfil}%
  \let\@evenhead=\@oddhead
  \def\@oddfoot{\eightpoint\copyright\ \@pubyear\ RAS\hfil}%
  \def\@evenfoot{\hfil\eightpoint\noindent\copyright\ \@pubyear\ RAS}%
}

\def\ps@headings{%
  \def\@oddhead{\elevenpoint\it\noindent
    \hfill\the\RightHeader\hskip1.5em\rm\folio}%
  \def\@evenhead{\elevenpoint\noindent
    \folio\hskip1.5em\it\the\LeftHeader\hfill}%
  \def\@oddfoot{\eightpoint\noindent\copyright\ \@pubyear\ RAS,
    MNRAS {\bf \@volume}, \@pagerange\hfil}%
  \def\@evenfoot{\hfil\eightpoint\copyright\ \@pubyear\ RAS,
    MNRAS {\bf \@volume}, \@pagerange}%
}

\def\ps@plate{%
  \def\@oddhead{\eightpoint\noindent\plt@cap\hfil}%
  \def\@evenhead{\eightpoint\noindent\plt@cap\hfil}%
  \def\@oddfoot{\eightpoint\noindent\copyright\ \@pubyear\ RAS,
    MNRAS {\bf \@volume}, \@pagerange\hfil}%
  \def\@evenfoot{\hfil\eightpoint\copyright\ \@pubyear\ RAS,
    MNRAS {\bf \@volume}, \@pagerange}%
}


% DESIGN ELEMENT DEFINITIONS

% Article opening

\def\title#1{% article title
  \bgroup
    \vbox to 8pt{\vss}%
    \seventeenpoint
    \Raggedright
    \noindent \strut{\bf #1}\par
  \egroup
}

\def\author#1{% article author(s)
  \bgroup
    \ifnum\LastMac=\Afe \OneHalf\else \vskip 21pt\fi
    \fourteenpoint
    \Raggedright
    \noindent \strut #1\par
    \vskip 3pt%
  \egroup
}

\def\affiliation#1{% author(s) affiliation
  \bgroup
    \vskip -4pt%
    \eightpoint
    \Raggedright
    \noindent \strut {\it #1}\par
  \egroup
  \LastMac=\Afe\relax
}

\def\acceptedline#1{% acceptance date
  \bgroup
    \Two
    \eightpoint
    \Raggedright
    \noindent \strut #1\par
  \egroup
}

\long\def\abstract#1{%
  \bgroup
    \vskip 20pt%
    \leftskip 11pc\rightskip\z@
    \noindent{\ninebf ABSTRACT}\par
    \tenpoint
    \Fullout
    \noindent #1\par
  \egroup
}

\long\def\keywords#1{% keywords
  \bgroup
    \Half
    \leftskip 11pc\rightskip\z@
    \tenpoint
    \Fullout
    \noindent\hbox{\bf Key words:}\ #1\par
  \egroup
}


% The \maketitle macro ensures that the two spanning material appears
% at the top of the first page, and that it has two lines of space
% underneath it. If you forget this in you input, no output will be produced.
% The \BeginOpening (alias \begintopmatter) macro should be called at the
% very start of the input file, so that it is in force when the document
% starts. This ensures that when \maketitle is called that the group is
% closed, and the material gets printed.

\def\maketitle{%
  \EndOpening
  \ifsinglecol \else \MakePage\fi
}


% Page offset

\def\pageoffset#1#2{\hoffset=#1\relax\voffset=#2\relax}


% Counter setup

\def\@nameuse#1{\csname #1\endcsname}
\def\arabic#1{\@arabic{\@nameuse{#1}}}
\def\alph#1{\@alph{\@nameuse{#1}}}
\def\Alph#1{\@Alph{\@nameuse{#1}}}
\def\@arabic#1{\number #1}
\def\@Alph#1{\ifcase#1\or A\or B\or C\or D\else\@Ialph{#1}\fi}
\def\@Ialph#1{\ifcase#1\or \or \or \or \or E\or F\or G\or H\or I\or J\or
   K\or L\or M\or N\or O\or P\or Q\or R\or S\or T\or U\or V\or W\or X\or
   Y\or Z\else\errmessage{Counter out of range}\fi}
\def\@alph#1{\ifcase#1\or a\or b\or c\or d\else\@ialph{#1}\fi}
\def\@ialph#1{\ifcase#1\or \or \or \or \or e\or f\or g\or h\or i\or j\or
   k\or l\or m\or n\or o\or p\or q\or r\or s\or t\or u\or v\or w\or x\or y\or
   z\else\errmessage{Counter out of range}\fi}


% Equation auto-numbering

\newcount\Eqnno
\newcount\SubEqnno

\def\theeq{\arabic{Eqnno}}
\def\thesubeq{\alph{SubEqnno}}

\def\stepeq{\relax
  \global\SubEqnno \z@
  \global\advance\Eqnno \@ne\relax
  {\rm (\theeq)}%
}

\def\startsubeq{\relax
  \global\SubEqnno \z@
  \global\advance\Eqnno \@ne\relax
  \stepsubeq
}

\def\stepsubeq{\relax
  \global\advance\SubEqnno \@ne\relax
  {\rm (\theeq\thesubeq)}%
}


% Headings

\newcount\Sec        %  heading auto number counters
\newcount\SecSec
\newcount\SecSecSec

\def\thesection{\arabic{Sec}}
\def\thesubsection{\thesection.\arabic{SecSec}}
\def\thesubsubsection{\thesubsection.\arabic{SecSecSec}}


\Sec=\z@

\def\:{\let\@sptoken= } \:  % this makes \@sptoken a space token 
\def\:{\@xifnch} \expandafter\def\: {\futurelet\@tempc\@ifnch}

\def\@ifnextchar#1#2#3{%
  \let\@tempMACe #1%
  \def\@tempMACa{#2}%
  \def\@tempMACb{#3}%
  \futurelet \@tempMACc\@ifnch%
}

\def\@ifnch{%
\ifx \@tempMACc \@sptoken%
  \let\@tempMACd\@xifnch%
\else%
  \ifx \@tempMACc \@tempMACe%
    \let\@tempMACd\@tempMACa%
  \else%
    \let\@tempMACd\@tempMACb%
  \fi%
\fi%
\@tempMACd%
}

\def\@ifstar#1#2{\@ifnextchar *{\def\@tempMACa*{#1}\@tempMACa}{#2}}

\newskip\@tempskipb

\def\addvspace#1{%
  \ifvmode\else \endgraf\fi%
  \ifdim\lastskip=\z@%
    \vskip #1\relax%
  \else%
    \@tempskipb#1\relax\@xaddvskip%
  \fi%
}

\def\@xaddvskip{%
  \ifdim\lastskip<\@tempskipb%
    \vskip-\lastskip%
    \vskip\@tempskipb\relax%
  \else%
    \ifdim\@tempskipb<\z@%
      \ifdim\lastskip<\z@ \else%
        \advance\@tempskipb\lastskip%
        \vskip-\lastskip\vskip\@tempskipb%
      \fi%
    \fi%
  \fi%
}

\newskip\@tmpSKIP

\def\addpen#1{%
  \ifvmode
    \if@nobreak
    \else
      \ifdim\lastskip=\z@
        \penalty#1\relax
      \else
        \@tmpSKIP=\lastskip
        \vskip -\lastskip
        \penalty#1\vskip\@tmpSKIP
      \fi
    \fi
  \fi
}

\newcount\@clubpen   \@clubpen=\clubpenalty
\newif\if@nobreak    \@nobreakfalse

\def\@noafterindent{%
  \global\@nobreaktrue
  \everypar{\if@nobreak
              \global\@nobreakfalse
              \clubpenalty \@M
              {\setbox\z@\lastbox}%
              \LastMac=\Nulle\relax%
            \else
              \clubpenalty \@clubpen
              \everypar{}%
            \fi}%
}

\newcount\gds@cbrk   \gds@cbrk=-300

\def\@nohdbrk{\interlinepenalty \@M\relax}

\let\@par=\par
\def\@restorepar{\def\par{\@par}}

\newif\if@endpe   \@endpefalse
 
\def\@doendpe{\@endpetrue \@nobreakfalse \LastMac=\Nulle\relax%
     \def\par{\@restorepar\everypar{}\par\@endpefalse}%
              \everypar{\setbox\z@\lastbox\everypar{}\@endpefalse}%
}

\def\section{\@ifstar{\@ssection}{\@section}}

\def\@section#1{% heading A (\section{....})
  \if@nobreak
    \everypar{}%
    \ifnum\LastMac=\Hae \addvspace{\half}\fi
  \else
    \addpen{\gds@cbrk}%
    \addvspace{\two}%
  \fi
  \bgroup
    \ninepoint\bf
    \Raggedright
    \global\advance\Sec \@ne
    \ifappendix
      \global\Eqnno=\z@ \global\SubEqnno=\z@\relax
      \def\ch@ck{#1}%
      \ifx\ch@ck\empty \def\c@lon{}\else\def\c@lon{:}\fi
      \noindent\@nohdbrk APPENDIX\ \thesection\c@lon\hskip 0.5em%
        \uppercase{#1}\par
    \else
      \noindent\@nohdbrk\thesection\hskip 1pc \uppercase{#1}\par
    \fi
    \global\SecSec=\z@
  \egroup
  \nobreak
  \vskip\half
  \nobreak
  \@noafterindent
  \LastMac=\Hae\relax
}

\def\@ssection#1{%  main section heading (\section*{....})
  \if@nobreak
    \everypar{}%
    \ifnum\LastMac=\Hae \addvspace{\half}\fi
  \else
    \addpen{\gds@cbrk}%
    \addvspace{\two}%
  \fi
  \bgroup
    \ninepoint\bf
    \Raggedright
%    \ifappendix
%      \global\Eqnno=\z@ \global\SubEqnno=\z@\relax % mh in apps dont reset
%      \noindent\@nohdbrk APPENDIX:\hskip 0.5em%
%        \uppercase{#1}\par
%    \else
    \noindent\@nohdbrk\uppercase{#1}\par
%    \fi
  \egroup
  \nobreak
  \vskip\half
  \nobreak
  \@noafterindent
  \LastMac=\Hae\relax
}

\def\subsection{\@ifstar{\@ssubsection}{\@subsection}}

\def\@subsection#1{% heading B
  \if@nobreak
    \everypar{}%
    \ifnum\LastMac=\Hae \addvspace{1pt plus 1pt minus .5pt}\fi
  \else
    \addpen{\gds@cbrk}%
    \addvspace{\onehalf}%
  \fi
  \bgroup
    \ninepoint\bf
    \Raggedright
    \global\advance\SecSec \@ne
    \noindent\@nohdbrk\thesubsection \hskip 1pc\relax #1\par
    \global\SecSecSec=\z@
  \egroup
  \nobreak
  \vskip\half
  \nobreak
  \@noafterindent
  \LastMac=\Hbe\relax
}

\def\@ssubsection#1{% heading B*
  \if@nobreak
    \everypar{}%
    \ifnum\LastMac=\Hae \addvspace{1pt plus 1pt minus .5pt}\fi
  \else
    \addpen{\gds@cbrk}%
    \addvspace{\onehalf}%
  \fi
  \bgroup
    \ninepoint\bf
    \Raggedright
    \noindent\@nohdbrk #1\par
  \egroup
  \nobreak
  \vskip\half
  \nobreak
  \@noafterindent
  \LastMac=\Hbe\relax
}

\def\subsubsection{\@ifstar{\@ssubsubsection}{\@subsubsection}}

\def\@subsubsection#1{% heading C
  \if@nobreak
    \everypar{}%
    \ifnum\LastMac=\Hbe \addvspace{1pt plus 1pt minus .5pt}\fi
  \else
    \addpen{\gds@cbrk}%
    \addvspace{\onehalf}%
  \fi
  \bgroup
    \ninepoint\it
    \Raggedright
    \global\advance\SecSecSec \@ne
    \noindent\@nohdbrk\thesubsubsection \hskip 1pc\relax #1\par
  \egroup
  \nobreak
  \vskip\half
  \nobreak
  \@noafterindent
  \LastMac=\Hce\relax
}

\def\@ssubsubsection#1{% heading C*
  \if@nobreak
    \everypar{}%
    \ifnum\LastMac=\Hbe \addvspace{1pt plus 1pt minus .5pt}\fi
  \else
    \addpen{\gds@cbrk}%
    \addvspace{\onehalf}%
  \fi
  \bgroup
    \ninepoint\it
    \Raggedright
    \noindent\@nohdbrk #1\par
  \egroup
  \nobreak
  \vskip\half
  \nobreak
  \@noafterindent
  \LastMac=\Hce\relax
}

\def\paragraph#1{% heading D
  \if@nobreak
    \everypar{}%
  \else
    \addpen{\gds@cbrk}%
    \addvspace{\one}%
  \fi%
  \bgroup%
    \ninepoint\it
    \noindent #1\ \nobreak%
  \egroup
  \LastMac=\Hde\relax
  \ignorespaces
}


% Appendix

\newif\ifappendix

\def\appendix{%
  \global\appendixtrue
  \def\thesection{\Alph{Sec}}%
  \def\thesubsection{\thesection\arabic{SecSec}}%
  \def\theeq{\thesection\arabic{Eqnno}}%
  \Sec=\z@ \SecSec=\z@ \SecSecSec=\z@ \Eqnno=\z@ \SubEqnno=\z@\relax
}


% Text

\let\tx=\relax % provided for backward compatibility


% Lists

\def\beginlist{%
  \par\if@nobreak \else\addvspace{\half}\fi%
  \bgroup%
    \ninepoint
    \let\item=\list@item%
}

\def\list@item{%
  \par\noindent\hskip 1em\relax%
  \ignorespaces%
}

\def\endlist{\par\egroup\addvspace{\half}\@doendpe}


% References

\def\beginrefs{%
  \par
  \bgroup
    \eightpoint
    \Fullout
    \let\bibitem=\bib@item
}

\def\bib@item{%
  \par\parindent=1.5em\Hang{1.5em}{1}%
  \everypar={\Hang{1.5em}{1}\ignorespaces}%
  \noindent\ignorespaces
}

\def\endrefs{\par\egroup\@doendpe}


% Page heads

\newtoks\CatchLine

\def\@journal{Mon.\ Not.\ R.\ Astron.\ Soc.\ }  % The journal title string
\def\@pubyear{1994}        % Assign a default publication year
\def\@pagerange{000--000}  % Assign a default page-range
\def\@volume{000}          % Assign a default volume number
\def\@microfiche{}         %

\def\pubyear#1{\gdef\@pubyear{#1}\@makecatchline}
\def\pagerange#1{\gdef\@pagerange{#1}\@makecatchline}
\def\volume#1{\gdef\@volume{#1}\@makecatchline}
\def\microfiche#1{\gdef\@microfiche{and Microfiche\ #1}\@makecatchline}

\def\@makecatchline{%
  \global\CatchLine{%
    {\rm \@journal {\bf \@volume},\ \@pagerange\ (\@pubyear)\ \@microfiche}}%
}

\@makecatchline % Assign a catchline, using the above defaults

\newtoks\LeftHeader
\def\shortauthor#1{% left page head
  \global\LeftHeader{#1}%
}

\newtoks\RightHeader
\def\shorttitle#1{% right page head
  \global\RightHeader{#1}%
}

\def\PageHead{% recto/verso running heads
  \begingroup
    \ifsp@page
      \csname ps@\sp@type\endcsname
    \fi
    \ifodd\pageno
      \let\the@head=\@oddhead
    \else
      \let\the@head=\@evenhead
    \fi
    \vbox to \z@{\vskip-22.5\p@%
      \hbox to \PageWidth{\vbox to8.5\p@{}%
        \the@head
      }%
    \vss}%
  \endgroup
  \nointerlineskip
}

\gdef\PageFoot{%
  \nointerlineskip%
  \begingroup
  \ifsp@page
    \csname ps@\sp@type\endcsname
    \global\sp@pagefalse
  \fi
  \vbox to 22pt{\vfil%
    \hbox to \PageWidth{%
      \eightpoint\strut\noindent
      \ifodd\pageno
        \@oddfoot
      \else
        \@evenfoot
      \fi
    }%
  }%
  \endgroup
}

\def\today{%
  \number\day\space
  \ifcase\month\or January\or February\or March\or April\or May\or June\or
    July\or August\or September\or October\or November\or December\fi
  \space\number\year%
}


\def\authorcomment#1{%
  \gdef\PageFoot{%
    \nointerlineskip%
    \vbox to 20pt{\vfil%
      \hbox to \PageWidth{\elevenpoint\noindent \hfil #1 \hfil}}%
  }%
}


% Plate pages

\newif\ifplate@page
\newbox\plt@box

\def\beginplatepage{%
  \let\plate=\plate@head
  \let\caption=\fig@caption
  \global\setbox\plt@box=\vbox\bgroup
  \TEMPDIMEN=\PageWidth % For \fig@caption test
  \hsize=\PageWidth\relax
}

\def\endplatepage{\par\egroup\global\plate@pagetrue}
\def\plate@head#1{\gdef\plt@cap{#1}}

% Letters option

\def\letters{%
  \gdef\folio{\ifnum\pageno<\z@ L\romannumeral-\pageno
    \else L\number\pageno \fi}%
}


% Math setup

% The standard math indentation
\newdimen\mathindent

\global\mathindent=\z@
\global\everydisplay{\global\@dspwd=\displaywidth\displaysetup}

% New versions of \displaylines, \eqalign, \eqalignno for
% when non-centered math is in use.

\def\@displaylines#1{% (for non-centered math)
  {}$\displ@y\hbox{\vbox{\halign{$\@lign\hfil\displaystyle##\hfil$\crcr
  #1\crcr}}}${}%
}

\def\@eqalign#1{\null\vcenter{\openup\jot\m@th% (for non-centered math)
  \ialign{\strut\hfil$\displaystyle{##}$&$\displaystyle{{}##}$\hfil
      \crcr#1\crcr}}%
}

\def\@eqalignno#1{% (for non-centered math)
  \global\advance\@dspwd by -\mathindent%
  {}$\displ@y\hbox{\vbox{\halign to\@dspwd%
  {\hfil$\@lign\displaystyle{##}$\tabskip\z@skip
  &$\@lign\displaystyle{{}##}$\hfil\tabskip\centering
  &\llap{$\@lign##$}\tabskip\z@skip\crcr
  #1\crcr}}}${}%
}

% When equations are flushleft ensure, that \displaylines,
% \eqalign, \eqalignno and \leqalignno point to the new versions of
% the macros. Also make \leqalignno act like \eqalignno, otherwise the
% equation text would `crash' into the equation number.

\global\let\displaylines=\@displaylines
\global\let\eqalign=\@eqalign
\global\let\eqalignno=\@eqalignno
\global\let\leqalignno=\@eqalignno

\newdimen\@dspwd   \@dspwd=\z@
\newif\if@eqno
\newif\if@leqno
\newtoks\@eqn
\newtoks\@eq

\def\displaysetup#1$${\displaytest#1\eqno\eqno\displaytest}

\def\displaytest#1\eqno#2\eqno#3\displaytest{%
 \if!#3!\ldisplaytest#1\leqno\leqno\ldisplaytest
 \else\@eqnotrue\@leqnofalse\@eqn={#2}\@eq={#1}\fi
 \generaldisplay$$}

\def\ldisplaytest#1\leqno#2\leqno#3\ldisplaytest{%
\@eq={#1}%
 \if!#3!\@eqnofalse\else\@eqnotrue\@leqnotrue
  \@eqn={#2}\fi}

\def\generaldisplay{%
  \if@eqno
    \if@leqno
      \hbox to \displaywidth{\noindent
        \rlap{$\displaystyle\the\@eqn$}%
        \hskip\mathindent$\displaystyle\the\@eq$\hfil}%
    \else
      \hbox to \displaywidth{\noindent
        \hskip\mathindent
        $\displaystyle\the\@eq$\hfil$\displaystyle\the\@eqn$}%
    \fi
  \else
    \hbox to \displaywidth{\noindent
      \hskip\mathindent$\displaystyle\the\@eq$\hfil}%
  \fi
}


% Finishing notice

\def\@notice{%
  \par\Two%
  \noindent{\b@ls{11pt}\ninerm This paper has been produced using the
    Royal Astronomical Society/Blackwell Science \TeX\ macros.\par}%
}

% redefine \bye to output our identification notice :
\outer\def\bye{\@notice\par\vfill\supereject\end}


% define a sign on :

\def\start@mess{%
  Monthly notices of the RAS journal style (\@typeface)\space
    v\@version,\space \@verdate.%
}

\everyjob{\Warn{\start@mess}}


% Two-column macros

%--------------------------------------------------------%
%                     INITIALISATION                     %
%--------------------------------------------------------%

\newif\if@debug \@debugfalse  %  when false, only warnings displayed

\def\Print#1{\if@debug\immediate\write16{#1}\else \fi}
\def\Warn#1{\immediate\write16{#1}}
\def\wlog#1{}

\newcount\Iteration % temporary loop counter

\def\Single{0} \def\Double{1}                 % ItemSPAN's
\def\Figure{0} \def\Table{1}                  % ItemTYPE's

\def\InStack{0}  % ItemSTATUS
\def\InZoneA{1}
\def\InZoneB{2}
\def\InZoneC{3}

\newcount\TEMPCOUNT % temporary count register
\newdimen\TEMPDIMEN % temporary dimen register
\newbox\TEMPBOX     % temporary box register
\newbox\VOIDBOX     % a box which is permenately void

\newcount\LengthOfStack % number of items currently in stack
\newcount\MaxItems      % maximum number of items allowed in stack
\newcount\StackPointer
\newcount\Point         % used in calculation for generating the
                        % physical address of an item in the stack.
\newcount\NextFigure    % number of next figure to be output
\newcount\NextTable     % number of next table to be output
\newcount\NextItem      % Next item to consider by order in stack

\newcount\StatusStack   % set to point to top of STATUS stack
\newcount\NumStack      % set to point to top of NUMBER stack
\newcount\TypeStack     % set to point to top of TYPE stack
\newcount\SpanStack     % set to point to top of SPAN stack
\newcount\BoxStack      % set to point to top of BOX stack

\newcount\ItemSTATUS    % status of present item
\newcount\ItemNUMBER    % number of present item
\newcount\ItemTYPE      % type of present item
\newcount\ItemSPAN      % span of present item
\newbox\ItemBOX         % box of present item
\newdimen\ItemSIZE      % size of present item
                        % (calculated by GetItemBOX)

\newdimen\PageHeight    % vertical measure of full page
\newdimen\TextLeading   % distance between baselines of body text
\newdimen\Feathering    % amount of interline stretch
\newcount\LinesPerPage  % height of page in text lines
\newdimen\ColumnWidth   % width of 1 column of text
\newdimen\ColumnGap     % size of gap between columns
\newdimen\PageWidth     % = \ColumnWidth * 2 + \ColumnGap
\newdimen\BodgeHeight   % Bodge to align figures and tables with text
\newcount\Leading       % Set to same as \TextLeading above

\newdimen\ZoneBSize  % size of items in ZoneB
\newdimen\TextSize   % size of text in ZoneB
\newbox\ZoneABOX     % contains Zone A material
\newbox\ZoneBBOX     % contains Zone B material
\newbox\ZoneCBOX     % contains Zone C material

\newif\ifFirstSingleItem
\newif\ifFirstZoneA
\newif\ifMakePageInComplete
\newif\ifMoreFigures \MoreFiguresfalse % set true in join stack
\newif\ifMoreTables  \MoreTablesfalse  % set true in join stack

\newif\ifFigInZoneB % used to determine in which zone an item
\newif\ifFigInZoneC % will be placed based on what is in other
\newif\ifTabInZoneB % zones already for a given page.
\newif\ifTabInZoneC

\newif\ifZoneAFullPage

\newbox\MidBOX    % = LeftBOX+gap+RightBOX
\newbox\LeftBOX
\newbox\RightBOX
\newbox\PageBOX   % complete made-up page

\newif\ifLeftCOL  % flags first pass through output routine
\LeftCOLtrue

\newdimen\ZoneBAdjust

\newcount\ItemFits
\def\Yes{1}
\def\No{2}

\def\LineAdjust#1{\global\ZoneBAdjust=#1\TextLeading\relax}


% Setup file.

\MaxItems=15
\NextFigure=\z@        % used for article opening
\NextTable=\@ne

\BodgeHeight=6pt
\TextLeading=11pt    % baselineskip of body text
\Leading=11
\Feathering=\z@      % amount of interline stretch
\LinesPerPage=61     % number of text lines per full page -1
\topskip=\TextLeading
\ColumnWidth=20pc    % width of text columns
\ColumnGap=2pc       % gap between columns

\newskip\ItemSepamount  % space between floats
\ItemSepamount=\TextLeading plus \TextLeading minus 4pt

\parskip=\z@ plus .1pt
\parindent=18pt
\widowpenalty=\z@
\clubpenalty=10000
\tolerance=1500
\hbadness=1500
\abovedisplayskip=6pt plus 2pt minus 1pt
\belowdisplayskip=6pt plus 2pt minus 1pt
\abovedisplayshortskip=6pt plus 2pt minus 1pt
\belowdisplayshortskip=6pt plus 2pt minus 1pt

\frenchspacing

\ninepoint % start main text size

\PageHeight=682pt
\PageWidth=2\ColumnWidth
\advance\PageWidth by \ColumnGap

\pagestyle{headings}


%--------------------------------------------------------%
%                         STACKS                         %
%--------------------------------------------------------%

% THE ITEM STACK
% The item stack contains contains figures and tables
% in the order in which they appear in the article source
% code.

% allocate stack space

\newcount\DUMMY \StatusStack=\allocationnumber
\newcount\DUMMY \newcount\DUMMY \newcount\DUMMY 
\newcount\DUMMY \newcount\DUMMY \newcount\DUMMY 
\newcount\DUMMY \newcount\DUMMY \newcount\DUMMY
\newcount\DUMMY \newcount\DUMMY \newcount\DUMMY 
\newcount\DUMMY \newcount\DUMMY \newcount\DUMMY

\newcount\DUMMY \NumStack=\allocationnumber
\newcount\DUMMY \newcount\DUMMY \newcount\DUMMY 
\newcount\DUMMY \newcount\DUMMY \newcount\DUMMY 
\newcount\DUMMY \newcount\DUMMY \newcount\DUMMY 
\newcount\DUMMY \newcount\DUMMY \newcount\DUMMY 
\newcount\DUMMY \newcount\DUMMY \newcount\DUMMY

\newcount\DUMMY \TypeStack=\allocationnumber
\newcount\DUMMY \newcount\DUMMY \newcount\DUMMY 
\newcount\DUMMY \newcount\DUMMY \newcount\DUMMY 
\newcount\DUMMY \newcount\DUMMY \newcount\DUMMY 
\newcount\DUMMY \newcount\DUMMY \newcount\DUMMY 
\newcount\DUMMY \newcount\DUMMY \newcount\DUMMY

\newcount\DUMMY \SpanStack=\allocationnumber
\newcount\DUMMY \newcount\DUMMY \newcount\DUMMY 
\newcount\DUMMY \newcount\DUMMY \newcount\DUMMY 
\newcount\DUMMY \newcount\DUMMY \newcount\DUMMY 
\newcount\DUMMY \newcount\DUMMY \newcount\DUMMY 
\newcount\DUMMY \newcount\DUMMY \newcount\DUMMY

\newbox\DUMMY   \BoxStack=\allocationnumber
\newbox\DUMMY   \newbox\DUMMY \newbox\DUMMY 
\newbox\DUMMY   \newbox\DUMMY \newbox\DUMMY 
\newbox\DUMMY   \newbox\DUMMY \newbox\DUMMY 
\newbox\DUMMY   \newbox\DUMMY \newbox\DUMMY 
\newbox\DUMMY   \newbox\DUMMY \newbox\DUMMY

\def\wlog{\immediate\write\m@ne}

% \GetItemSTATUS, \GetItemNUMBER, \GetItemTYPE, \GetItemSPAN,
% \GetItemBox 
% are used to get details of a particular item from the item
% stack. The argument to each of these is the items position
% in the stack (usually \StackPointer)...not the items number.

\def\GetItemAll#1{%
 \GetItemSTATUS{#1}
 \GetItemNUMBER{#1}
 \GetItemTYPE{#1}
 \GetItemSPAN{#1}
 \GetItemBOX{#1}
}

% Note: \LeaveStack uses this routine. Do not destroy \Point
\def\GetItemSTATUS#1{%
 \Point=\StatusStack
 \advance\Point by #1
 \global\ItemSTATUS=\count\Point
}

% Note: \LeaveStack uses this routine. Do not destroy \Point
\def\GetItemNUMBER#1{%
 \Point=\NumStack
 \advance\Point by #1
 \global\ItemNUMBER=\count\Point
}

% Note: \LeaveStack uses this routine. Do not destroy \Point
\def\GetItemTYPE#1{%
 \Point=\TypeStack
 \advance\Point by #1
 \global\ItemTYPE=\count\Point
}

% Note: \LeaveStack uses this routine. Do not destroy \Point
\def\GetItemSPAN#1{%
 \Point\SpanStack
 \advance\Point by #1
 \global\ItemSPAN=\count\Point
}

% Note: \LeaveStack uses this routine. Do not destroy \Point
\def\GetItemBOX#1{%
 \Point=\BoxStack
 \advance\Point by #1
 \global\setbox\ItemBOX=\vbox{\copy\Point}
 \global\ItemSIZE=\ht\ItemBOX
 \global\advance\ItemSIZE by \dp\ItemBOX
 \TEMPCOUNT=\ItemSIZE
 \divide\TEMPCOUNT by \Leading
 \divide\TEMPCOUNT by 65536
 \advance\TEMPCOUNT \@ne
 \ItemSIZE=\TEMPCOUNT pt
 \global\multiply\ItemSIZE by \Leading
}

% item joins stack

\def\JoinStack{%
 \ifnum\LengthOfStack=\MaxItems % stack is full of items
  \Warn{WARNING: Stack is full...some items will be lost!}
 \else
  \Point=\StatusStack
  \advance\Point by \LengthOfStack
  \global\count\Point=\ItemSTATUS
  \Point=\NumStack
  \advance\Point by \LengthOfStack
  \global\count\Point=\ItemNUMBER
  \Point=\TypeStack
  \advance\Point by \LengthOfStack
  \global\count\Point=\ItemTYPE
  \Point\SpanStack
  \advance\Point by \LengthOfStack
  \global\count\Point=\ItemSPAN
  \Point=\BoxStack
  \advance\Point by \LengthOfStack
  \global\setbox\Point=\vbox{\copy\ItemBOX}
  \global\advance\LengthOfStack \@ne
  \ifnum\ItemTYPE=\Figure % used in \MakePage
   \global\MoreFigurestrue
  \else
   \global\MoreTablestrue
  \fi
 \fi
}

% item leaves stack
% #1=physical position of the item to be removed

\def\LeaveStack#1{%
 {\Iteration=#1
 \loop
 \ifnum\Iteration<\LengthOfStack
  \advance\Iteration \@ne
  \GetItemSTATUS{\Iteration}
   \advance\Point by \m@ne
   \global\count\Point=\ItemSTATUS
  \GetItemNUMBER{\Iteration}
   \advance\Point by \m@ne
   \global\count\Point=\ItemNUMBER
  \GetItemTYPE{\Iteration}
   \advance\Point by \m@ne
   \global\count\Point=\ItemTYPE
  \GetItemSPAN{\Iteration}
   \advance\Point by \m@ne
   \global\count\Point=\ItemSPAN
  \GetItemBOX{\Iteration}
   \advance\Point by \m@ne
   \global\setbox\Point=\vbox{\copy\ItemBOX}
 \repeat}
 \global\advance\LengthOfStack by \m@ne
}

% clean stack
% This routine scans through the stack and removes anything
% that does not have STATUS=\InStack.

\newif\ifStackNotClean

\def\CleanStack{%
 \StackNotCleantrue
 {\Iteration=\z@
  \loop
   \ifStackNotClean
    \GetItemSTATUS{\Iteration}
    \ifnum\ItemSTATUS=\InStack
     \advance\Iteration \@ne
     \else
      \LeaveStack{\Iteration}
    \fi
   \ifnum\LengthOfStack<\Iteration
    \StackNotCleanfalse
   \fi
 \repeat}
}

% Find item.
% This macro searches from the top to the bottom of the
% stack for an item of a specified type and number.
% #1=type, #2=number
% If the specified item is found, then \StackPointer is set
% to point to it, else \StackPointer=-1.
% This routine is used to find the next figure or table
% by number.

\def\FindItem#1#2{%
 \global\StackPointer=\m@ne % assume item isn't in stack for now
 {\Iteration=\z@
  \loop
  \ifnum\Iteration<\LengthOfStack
   \GetItemSTATUS{\Iteration}
   \ifnum\ItemSTATUS=\InStack
    \GetItemTYPE{\Iteration}
    \ifnum\ItemTYPE=#1
     \GetItemNUMBER{\Iteration}
     \ifnum\ItemNUMBER=#2
      \global\StackPointer=\Iteration
      \Iteration=\LengthOfStack % terminate loop
     \fi
    \fi
   \fi
  \advance\Iteration \@ne
 \repeat}
}

% Find next type
% This macro searches from the top to the bottom of the stack
% looking for the first item which has STATUS=\InStack.
% If it is a figure then a figure is what will be considered
% next by \MakePage else table.

\def\FindNext{%
 \global\StackPointer=\m@ne % assume stack is empty for now
 {\Iteration=\z@
  \loop
  \ifnum\Iteration<\LengthOfStack
   \GetItemSTATUS{\Iteration}
   \ifnum\ItemSTATUS=\InStack
    \GetItemTYPE{\Iteration}
   \ifnum\ItemTYPE=\Figure
    \ifMoreFigures
      \global\NextItem=\Figure
      \global\StackPointer=\Iteration
      \Iteration=\LengthOfStack % terminate loop
    \fi
   \fi
   \ifnum\ItemTYPE=\Table
    \ifMoreTables
      \global\NextItem=\Table
      \global\StackPointer=\Iteration
      \Iteration=\LengthOfStack % terminate loop
    \fi
   \fi
  \fi
  \advance\Iteration \@ne
 \repeat}
}

% Change status
% Macro to change the status of a specified item in stack.
% #1=item, #2=new status

\def\ChangeStatus#1#2{%
 \Point=\StatusStack
 \advance\Point by #1
 \global\count\Point=#2
}


%--------------------------------------------------------%
%                       MAKEPAGE                         %
%--------------------------------------------------------%

% This macro is called at the start of every new page
% including the first. It scans through the stack picking
% out items which should be placed on this page. It then
% leaves space for the items to be placed later. The routine
% terminates when either there is no room on the page to
% fit the next figure or table, or there are no more items
% in the stack.

\def\Zone{\InZoneA}

\ZoneBAdjust=\z@

\def\MakePage{% allocate space on this page for stack items
 \global\ZoneBSize=\PageHeight
 \global\TextSize=\ZoneBSize
 \global\ZoneAFullPagefalse
 \global\topskip=\TextLeading
 \MakePageInCompletetrue
 \MoreFigurestrue
 \MoreTablestrue
 \FigInZoneBfalse
 \FigInZoneCfalse
 \TabInZoneBfalse
 \TabInZoneCfalse
 \global\FirstSingleItemtrue
 \global\FirstZoneAtrue
 \global\setbox\ZoneABOX=\box\VOIDBOX
 \global\setbox\ZoneBBOX=\box\VOIDBOX
 \global\setbox\ZoneCBOX=\box\VOIDBOX
 \loop
  \ifMakePageInComplete
 \FindNext
 \ifnum\StackPointer=\m@ne
  \NextItem=\m@ne
  \MoreFiguresfalse
  \MoreTablesfalse
 \fi
 \ifnum\NextItem=\Figure
   \FindItem{\Figure}{\NextFigure}
   \ifnum\StackPointer=\m@ne \global\MoreFiguresfalse
   \else
    \GetItemSPAN{\StackPointer}
    \ifnum\ItemSPAN=\Single \def\Zone{\InZoneB}\relax
     \ifFigInZoneC \global\MoreFiguresfalse\fi
    \else
     \def\Zone{\InZoneA}
     \ifFigInZoneB \def\Zone{\InZoneC}\fi
    \fi
   \fi
   \ifMoreFigures\Print{}\FigureItems\fi
 \fi
\ifnum\NextItem=\Table
   \FindItem{\Table}{\NextTable}
   \ifnum\StackPointer=\m@ne \global\MoreTablesfalse
   \else
    \GetItemSPAN{\StackPointer}
    \ifnum\ItemSPAN=\Single\relax
     \ifTabInZoneC \global\MoreTablesfalse\fi
    \else
     \def\Zone{\InZoneA}
     \ifTabInZoneB \def\Zone{\InZoneC}\fi
    \fi
   \fi
   \ifMoreTables\Print{}\TableItems\fi
 \fi
   \MakePageInCompletefalse % assume page is complete
   \ifMoreFigures\MakePageInCompletetrue\fi
   \ifMoreTables\MakePageInCompletetrue\fi
 \repeat
%\Print{TextSize=\the\TextSize}
%\Print{ZoneBSize=\the\ZoneBSize}
 \ifZoneAFullPage
  \global\TextSize=\z@
  \global\ZoneBSize=\z@
  \global\vsize=\z@\relax
  \global\topskip=\z@\relax
  \vbox to \z@{\vss}
  \eject
 \else
 \global\advance\ZoneBSize by -\ZoneBAdjust
 \global\vsize=\ZoneBSize
 \global\hsize=\ColumnWidth
 \global\ZoneBAdjust=\z@
 \ifdim\TextSize<23pt
 \Warn{}
 \Warn{* Making column fall short: TextSize=\the\TextSize *}
 \vskip-\lastskip\eject\fi
 \fi
}

\def\MakeRightCol{% allocate space for the right column of text
 \global\TextSize=\ZoneBSize
 \MakePageInCompletetrue
 \MoreFigurestrue
 \MoreTablestrue
 \global\FirstSingleItemtrue
 \global\setbox\ZoneBBOX=\box\VOIDBOX
 \def\Zone{\InZoneB}
 \loop
  \ifMakePageInComplete
 \FindNext
 \ifnum\StackPointer=\m@ne
  \NextItem=\m@ne
  \MoreFiguresfalse
  \MoreTablesfalse
 \fi
 \ifnum\NextItem=\Figure
   \FindItem{\Figure}{\NextFigure}
   \ifnum\StackPointer=\m@ne \MoreFiguresfalse
   \else
    \GetItemSPAN{\StackPointer}
    \ifnum\ItemSPAN=\Double\relax
     \MoreFiguresfalse\fi
   \fi
   \ifMoreFigures\Print{}\FigureItems\fi
 \fi
 \ifnum\NextItem=\Table
   \FindItem{\Table}{\NextTable}
   \ifnum\StackPointer=\m@ne \MoreTablesfalse
   \else
    \GetItemSPAN{\StackPointer}
    \ifnum\ItemSPAN=\Double\relax
     \MoreTablesfalse\fi
   \fi
   \ifMoreTables\Print{}\TableItems\fi
 \fi
   \MakePageInCompletefalse % assume page is complete
   \ifMoreFigures\MakePageInCompletetrue\fi
   \ifMoreTables\MakePageInCompletetrue\fi
 \repeat
 \ifZoneAFullPage
  \global\TextSize=\z@
  \global\ZoneBSize=\z@
  \global\vsize=\z@\relax
  \global\topskip=\z@\relax
  \vbox to \z@{\vss}
  \eject
 \else
 \global\vsize=\ZoneBSize
 \global\hsize=\ColumnWidth
 \ifdim\TextSize<23pt
 \Warn{}
 \Warn{* Making column fall short: TextSize=\the\TextSize *}
 \vskip-\lastskip\eject\fi
\fi
}

\def\FigureItems{% Stack pointer points to next figure
 \Print{Considering...}
 \ShowItem{\StackPointer}
 \GetItemBOX{\StackPointer} % auto calculates ItemSIZE
 \GetItemSPAN{\StackPointer}
  \CheckFitInZone % check to see if item fits
  \ifnum\ItemFits=\Yes
   \ifnum\ItemSPAN=\Single
     \ChangeStatus{\StackPointer}{\InZoneB} % flag to be output
     \global\FigInZoneBtrue
     \ifFirstSingleItem
      \hbox{}\vskip-\BodgeHeight
     \global\advance\ItemSIZE by \TextLeading
     \fi
     \unvbox\ItemBOX\ItemSep
     \global\FirstSingleItemfalse
     \global\advance\TextSize by -\ItemSIZE% allocate space
     \global\advance\TextSize by -\TextLeading
   \else
    \ifFirstZoneA
     \global\advance\ItemSIZE by \TextLeading
     \global\FirstZoneAfalse\fi
    \global\advance\TextSize by -\ItemSIZE
    \global\advance\TextSize by -\TextLeading
    \global\advance\ZoneBSize by -\ItemSIZE
    \global\advance\ZoneBSize by -\TextLeading
    \ifFigInZoneB\relax
     \else
     \ifdim\TextSize<3\TextLeading
     \global\ZoneAFullPagetrue
     \fi
    \fi
    \ChangeStatus{\StackPointer}{\Zone}
    \ifnum\Zone=\InZoneC \global\FigInZoneCtrue\fi
  \fi
   \Print{TextSize=\the\TextSize}
   \Print{ZoneBSize=\the\ZoneBSize}
  \global\advance\NextFigure \@ne
   \Print{This figure has been placed.}
  \else
   \Print{No space available for this figure...holding over.}
   \Print{}
   \global\MoreFiguresfalse
  \fi
}

\def\TableItems{% Stack pointer points to next table
 \Print{Considering...}
 \ShowItem{\StackPointer}
 \GetItemBOX{\StackPointer} % auto calculates ItemSIZE
 \GetItemSPAN{\StackPointer}
  \CheckFitInZone % check to see of item fits in Zone
  \ifnum\ItemFits=\Yes
   \ifnum\ItemSPAN=\Single
    \ChangeStatus{\StackPointer}{\InZoneB}
     \global\TabInZoneBtrue
     \ifFirstSingleItem
      \hbox{}\vskip-\BodgeHeight
     \global\advance\ItemSIZE by \TextLeading
     \fi
     \unvbox\ItemBOX\ItemSep
     \global\FirstSingleItemfalse
     \global\advance\TextSize by -\ItemSIZE
     \global\advance\TextSize by -\TextLeading
   \else
    \ifFirstZoneA
    \global\advance\ItemSIZE by \TextLeading
    \global\FirstZoneAfalse\fi
    \global\advance\TextSize by -\ItemSIZE
    \global\advance\TextSize by -\TextLeading
    \global\advance\ZoneBSize by -\ItemSIZE
    \global\advance\ZoneBSize by -\TextLeading
    \ifFigInZoneB\relax
     \else
     \ifdim\TextSize<3\TextLeading
     \global\ZoneAFullPagetrue
     \fi
    \fi
    \ChangeStatus{\StackPointer}{\Zone}
    \ifnum\Zone=\InZoneC \global\TabInZoneCtrue\fi
   \fi
%   \Print{TextSize=\the\TextSize}
%   \Print{ZoneBSize=\the\ZoneBSize}
  \global\advance\NextTable \@ne
   \Print{This table has been placed.}
  \else
  \Print{No space available for this table...holding over.}
   \Print{}
   \global\MoreTablesfalse
  \fi
}

% These macros check to see if an item of ItemSIZE will
% fit in a particular zone. If it will, then ItemFits
% will be set true else false.

\def\CheckFitInZone{%
{\advance\TextSize by -\ItemSIZE
 \advance\TextSize by -\TextLeading
 \ifFirstSingleItem
  \advance\TextSize by \TextLeading
 \fi
 \ifnum\Zone=\InZoneA\relax
  \else \advance\TextSize by -\ZoneBAdjust
 \fi
 \ifdim\TextSize<3\TextLeading \global\ItemFits=\No
 \else \global\ItemFits=\Yes\fi}
}

\def\BeginOpening{%
  % start 9pt a.s.a.p. so that \New.. commands get a chance to init.
  \ninepoint
  \thispagestyle{titlepage}%
  \global\setbox\ItemBOX=\vbox\bgroup%
    \hsize=\PageWidth%
    \hrule height \z@
    \ifsinglecol\vskip 6pt\fi % Bodge, to get same pos. as two-column!
}

\let\begintopmatter=\BeginOpening  %  alias for \BeginOpening

\def\EndOpening{%
  \One%  1 line fixed space below opening
  \egroup
  \ifsinglecol
    \box\ItemBOX%
    \vskip\TextLeading plus 2\TextLeading% var. space: min 1, max 3 lines
    \@noafterindent
  \else
    \ItemNUMBER=\z@%
    \ItemTYPE=\Figure
    \ItemSPAN=\Double
    \ItemSTATUS=\InStack
    \JoinStack
  \fi
}


% Figures

\newif\if@here  \@herefalse

\def\no@float{\global\@heretrue}
\let\nofloat=\relax % only enabled for one column

\def\beginfigure{%
  \@ifstar{\global\@dfloattrue \@bfigure}{\global\@dfloatfalse \@bfigure}%
}

\def\@bfigure#1{%
  \par
  \if@dfloat
    \ItemSPAN=\Double
    \TEMPDIMEN=\PageWidth
  \else
    \ItemSPAN=\Single
    \TEMPDIMEN=\ColumnWidth
  \fi
  \ifsinglecol
    \TEMPDIMEN=\PageWidth
  \else
    \ItemSTATUS=\InStack
    \ItemNUMBER=#1%
    \ItemTYPE=\Figure
  \fi
  \bgroup
    \hsize=\TEMPDIMEN
    \global\setbox\ItemBOX=\vbox\bgroup
      \eightpoint\nostb@ls{10pt}%
      \let\caption=\fig@caption
      \ifsinglecol \let\nofloat=\no@float\fi
}

\def\fig@caption#1{%
  \vskip 5.5pt plus 6pt%
  \bgroup % grouping and size change needed for plate pages
    \eightpoint\nostb@ls{10pt}%
    \setbox\TEMPBOX=\hbox{#1}%
    \ifdim\wd\TEMPBOX>\TEMPDIMEN
      \noindent \unhbox\TEMPBOX\par
    \else
      \hbox to \hsize{\hfil\unhbox\TEMPBOX\hfil}%
    \fi
  \egroup
}

\def\endfigure{%
  \par\egroup % end \vbox
  \egroup
  \ifsinglecol
    \if@here \midinsert\global\@herefalse\else \topinsert\fi
      \unvbox\ItemBOX
    \endinsert
  \else
    \JoinStack
    \Print{Processing source for figure \the\ItemNUMBER}%
  \fi
}


% Tables

\newbox\tab@cap@box
\def\tab@caption#1{\global\setbox\tab@cap@box=\hbox{#1\par}}

\newtoks\tab@txt@toks
\long\def\tab@txt#1{\global\tab@txt@toks={#1}\global\table@txttrue}

\newif\iftable@txt  \table@txtfalse
\newif\if@dfloat    \@dfloatfalse

\def\begintable{%
  \@ifstar{\global\@dfloattrue \@btable}{\global\@dfloatfalse \@btable}%
}

\def\@btable#1{%
  \par
  \if@dfloat
    \ItemSPAN=\Double
    \TEMPDIMEN=\PageWidth
  \else
    \ItemSPAN=\Single
    \TEMPDIMEN=\ColumnWidth
  \fi
  \ifsinglecol
    \TEMPDIMEN=\PageWidth
  \else
    \ItemSTATUS=\InStack
    \ItemNUMBER=#1%
    \ItemTYPE=\Table
  \fi
  \bgroup
    \eightpoint\nostb@ls{10pt}%
    \global\setbox\ItemBOX=\vbox\bgroup
      \let\caption=\tab@caption
      \let\tabletext=\tab@txt
      \ifsinglecol \let\nofloat=\no@float\fi
}

\def\endtable{%
  \par\egroup % end \vbox
  \egroup
  \setbox\TEMPBOX=\hbox to \TEMPDIMEN{%
    \eightpoint\nostb@ls{10pt}%
    \hss
    \vbox{%
      \hsize=\wd\ItemBOX
      \ifvoid\tab@cap@box
      \else
        \noindent\unhbox\tab@cap@box
        \vskip 5.5pt plus 6pt%
      \fi
      \box\ItemBOX
      \iftable@txt
        \vskip 10pt%
        \noindent\the\tab@txt@toks
        \global\table@txtfalse
      \fi
    }%
    \hss
  }%
  \ifsinglecol
    \if@here \midinsert\global\@herefalse\else \topinsert\fi
      \box\TEMPBOX
    \endinsert
  \else
    \global\setbox\ItemBOX=\box\TEMPBOX
    \JoinStack
    \Print{Processing source for table \the\ItemNUMBER}%
  \fi
}


\def\UnloadZoneA{%
\FirstZoneAtrue
 \Iteration=\z@
  \loop
   \ifnum\Iteration<\LengthOfStack
    \GetItemSTATUS{\Iteration}
    \ifnum\ItemSTATUS=\InZoneA
     \GetItemBOX{\Iteration}
     \ifFirstZoneA \vbox to \BodgeHeight{\vfil}%
     \FirstZoneAfalse\fi
     \unvbox\ItemBOX\ItemSep
     \LeaveStack{\Iteration}
     \else
     \advance\Iteration \@ne
   \fi
 \repeat
}

\def\UnloadZoneC{%
\Iteration=\z@
  \loop
   \ifnum\Iteration<\LengthOfStack
    \GetItemSTATUS{\Iteration}
    \ifnum\ItemSTATUS=\InZoneC
     \GetItemBOX{\Iteration}
     \ItemSep\unvbox\ItemBOX
     \LeaveStack{\Iteration}
     \else
     \advance\Iteration \@ne
   \fi
 \repeat
}


%--------------------------------------------------------%
%                         DIAGNOSTICS                    %
%--------------------------------------------------------%

\def\ShowItem#1{% Show details of on item entry in stack
  {\GetItemAll{#1}
  \Print{\the#1:
  {TYPE=\ifnum\ItemTYPE=\Figure Figure\else Table\fi}
  {NUMBER=\the\ItemNUMBER}
  {SPAN=\ifnum\ItemSPAN=\Single Single\else Double\fi}
  {SIZE=\the\ItemSIZE}}}
}

\def\ShowStack{% 
 \Print{}
 \Print{LengthOfStack = \the\LengthOfStack}
 \ifnum\LengthOfStack=\z@ \Print{Stack is empty}\fi
 \Iteration=\z@
 \loop
 \ifnum\Iteration<\LengthOfStack
  \ShowItem{\Iteration}
  \advance\Iteration \@ne
 \repeat
}

\def\B#1#2{%
\hbox{\vrule\kern-0.4pt\vbox to #2{%
\hrule width #1\vfill\hrule}\kern-0.4pt\vrule}
}


%-------------------------------------------------------%
%             SINGLE COLUMN OUTPUT ROUTINE              %
%-------------------------------------------------------%

\newif\ifsinglecol   \singlecolfalse

\def\onecolumn{%
  \global\output={\singlecoloutput}%
  \global\hsize=\PageWidth
  \global\vsize=\PageHeight
  \global\ColumnWidth=\hsize
  \global\TextLeading=12pt
  \global\Leading=12
  \global\singlecoltrue
  \global\let\onecolumn=\relax%         stop them using \onecolumn again
  \global\let\footnote=\sing@footnote%  enable footnotes
  \global\let\vfootnote=\sing@vfootnote
  \ninepoint % reset \baselineskip after leading change
  \message{(Single column)}%
}

\def\singlecoloutput{%
  \shipout\vbox{\PageHead\vbox to \PageHeight{\pagebody\vss}\PageFoot}%
  \advancepageno
%
  \ifplate@page
    \shipout\vbox{%
      \sp@pagetrue
      \def\sp@type{plate}%
      \global\plate@pagefalse
      \PageHead\vbox to \PageHeight{\unvbox\plt@box\vfil}\PageFoot%
    }%
    \message{[plate]}%
    \advancepageno
  \fi
%
  \ifnum\outputpenalty>-\@MM \else\dosupereject\fi%
}

\def\ItemSep{\vskip\ItemSepamount\relax}

\def\ItemSepbreak{\par\ifdim\lastskip<\ItemSepamount
  \removelastskip\penalty-200\ItemSep\fi%
}

% Modify plain's \endinsert so that the mn's spacing is used

\let\@@endinsert=\endinsert % save plain's original \endinsert

\def\endinsert{\egroup % finish the \vbox
  \if@mid \dimen@\ht\z@ \advance\dimen@\dp\z@ \advance\dimen@12\p@
    \advance\dimen@\pagetotal \advance\dimen@-\pageshrink
    \ifdim\dimen@>\pagegoal\@midfalse\p@gefalse\fi\fi
  \if@mid \ItemSep\box\z@\ItemSepbreak
  \else\insert\topins{\penalty100 % floating insertion
    \splittopskip\z@skip
    \splitmaxdepth\maxdimen \floatingpenalty\z@
    \ifp@ge \dimen@\dp\z@
    \vbox to\vsize{\unvbox\z@\kern-\dimen@}% depth is zero
    \else \box\z@\nobreak\ItemSep\fi}\fi\endgroup%
}


% Footnotes (only enabled in single column)

\def\gobbleone#1{}
\def\gobbletwo#1#2{}
\let\footnote=\gobbletwo % Gobble footnote's unless enabled by \onecolumn
\let\vfootnote=\gobbleone

\def\sing@footnote#1{\let\@sf\empty % parameter #2 (the text) is read later
  \ifhmode\edef\@sf{\spacefactor\the\spacefactor}\/\fi
  \hbox{$^{\hbox{\eightpoint #1}}$}\@sf\sing@vfootnote{#1}%
}

\def\sing@vfootnote#1{\insert\footins\bgroup\eightpoint\b@ls{9pt}%
  \interlinepenalty\interfootnotelinepenalty
  \splittopskip\ht\strutbox % top baseline for broken footnotes
  \splitmaxdepth\dp\strutbox \floatingpenalty\@MM
  \leftskip\z@skip \rightskip\z@skip \spaceskip\z@skip \xspaceskip\z@skip
  \noindent $^{\scriptstyle\hbox{#1}}$\hskip 4pt%
    \footstrut\futurelet\next\fo@t%
}

% Kill footnote rule
\def\footnoterule{\kern-3\p@ \hrule height \z@ \kern 3\p@}

\skip\footins=19.5pt plus 12pt minus 1pt
\count\footins=1000
\dimen\footins=\maxdimen

% for footnotes in double column: use \note{$\star$}{footnote}
\def\note#1#2{%
  \let\@sf=\empty \ifhmode\edef\@sf{\spacefactor\the\spacefactor}\/\fi
  #1\insert\footins\bgroup
    \eightpoint\b@ls{10pt}\rm
    \interlinepenalty\interfootnotelinepenalty
%    \splittopskip\ht\strutbox % top baseline for broken footnotes
    \splitmaxdepth\dp\strutbox \floatingpenalty\@MM
    \leftskip\z@skip \rightskip\z@skip \spaceskip\z@skip \xspaceskip\z@skip
    \noindent\footstrut #1$\,$#2\strut\par
  \egroup
  \@sf\relax}

% Landscape

\def\landscape{%
  \global\TEMPDIMEN=\PageWidth
  \global\PageWidth=\PageHeight
  \global\PageHeight=\TEMPDIMEN
  \global\let\landscape=\relax%         stop them using \landscape again.
  \onecolumn
  \message{(landscape)}%
  \raggedbottom
}


%-------------------------------------------------------%
%               TWO COLUMN OUTPUT ROUTINE               %
%-------------------------------------------------------%

% Very slight redefinition of the \output routine of mn.tex, to allow footnotes.
\output{%
  \ifLeftCOL
    \global\setbox\LeftBOX=\vbox to \ZoneBSize{\box255\unvbox\ZoneBBOX
      \ifvoid\footins\else
        \vskip\skip\footins\unvbox\footins\fi
    }%
    \global\LeftCOLfalse
    \MakeRightCol
  \else
    \setbox\RightBOX=\vbox to \ZoneBSize{\box255\unvbox\ZoneBBOX
      \ifvoid\footins\else
        \vskip\skip\footins\unvbox\footins\fi
    }%
    \setbox\MidBOX=\hbox{\box\LeftBOX\hskip\ColumnGap\box\RightBOX}%
    \setbox\PageBOX=\vbox to \PageHeight{%
      \UnloadZoneA\box\MidBOX\UnloadZoneC}%
    \shipout\vbox{\PageHead\vbox to \PageHeight{\box\PageBOX\vss}\PageFoot}%
    \advancepageno
%
    \ifplate@page
      \shipout\vbox{%
        \sp@pagetrue
        \def\sp@type{plate}%
        \global\plate@pagefalse
        \PageHead\vbox to \PageHeight{\unvbox\plt@box\vfil}\PageFoot%
      }%
      \message{[plate]}%
      \advancepageno
    \fi
%
    \global\LeftCOLtrue
    \CleanStack
    \MakePage
  \fi
}



% Startup message

\Warn{\start@mess}

\newif\ifCUPmtplainloaded % for use in documents
\ifprod@font
  \global\CUPmtplainloadedtrue
\fi

\def\mnmacrosloaded{} % so articles can see if a format file has been used.

\catcode `\@=12 % @ signs are non-letters

% \dump

% end of mn.tex


over.tex
%
% overmerging paper
%
% Eelco van Kampen
%
% Institute for Astronomy, Edinburgh, 1998-1999
%

\ifx\mnmacrosloaded\undefined \input mn\fi

% author's definitions

\input psfig
\def\halve{{\scriptstyle 1 \over 2}}
\def\Mpc{$h_0^{-1}$Mpc}

\newif\ifAMStwofonts
%\AMStwofontstrue

\ifCUPmtplainloaded \else
  \NewTextAlphabet{textbfit} {cmbxti10} {}
  \NewTextAlphabet{textbfss} {cmssbx10} {}
  \NewMathAlphabet{mathbfit} {cmbxti10} {} % for math mode
  \NewMathAlphabet{mathbfss} {cmssbx10} {} %  "   "    "
  %
  \ifAMStwofonts
    %
    \NewSymbolFont{upmath} {eurm10}
    \NewSymbolFont{AMSa} {msam10}
    \NewMathSymbol{\upi}     {0}{upmath}{19}
    \NewMathSymbol{\umu}     {0}{upmath}{16}
    \NewMathSymbol{\upartial}{0}{upmath}{40}
    \NewMathSymbol{\leqslant}{3}{AMSa}{36}
    \NewMathSymbol{\geqslant}{3}{AMSa}{3E}
    \let\oldle=\le     \let\oldleq=\leq
    \let\oldge=\ge     \let\oldgeq=\geq
    \let\leq=\leqslant \let\le=\leqslant
    \let\geq=\geqslant \let\ge=\geqslant
  \else
    \def\umu{\mu}
    \def\upi{\pi}
    \def\upartial{\partial}
  \fi
\fi

% Marginal adjustments using \pageoffset maybe required when printing
% proofs on a Laserprinter (this is usually not needed).
% Syntax: \pageoffset{ +/- hor. offset}{ +/- vert. offset}
% e.g.    \pageoffset{-3pc}{-4pc}
\pageoffset{-2.5pc}{0pc}

\loadboldmathnames

% \Referee   %  uncomment this for referee mode (double spaced)

% \onecolumn        % enable one column mode
% \letters          % for `letters' articles
\pagerange{0--0}    % `letters' articles should use \pagerange{Ln--Ln}
\pubyear{2000}
\volume{000}
% \microfiche{}     % for articles with microfiche
% \authorcomment{}  % author comment for footline

\begintopmatter  %  start the two spanning material

\title{Overmerging in N-body simulations}
\author{Eelco van Kampen}
\affiliation{Institute for Astronomy, University of Edinburgh, Royal
Observatory, Blackford Hill, Edinburgh EH9 3HJ,\ {\tt evk@roe.ac.uk}}
\shortauthor{E.\ van Kampen}
\shorttitle{Overmerging}
\acceptedline{Accepted ... Received ...; in original form ...}

\abstract {The aim of this paper is to clarify the notion and cause of
overmerging in N-body simulations, and to present analytical estimates
for its timescale. Overmerging is the disruption of subhaloes
within embedding haloes due to {\it numerical}\ problems connected with
the discreteness of N-body dynamics. It is shown that the process responsible
for overmerging is particle-subhalo two-body heating.
%Excessive softening worsens the problem.
Various solutions to the overmerging problem are discussed.}

\keywords {galaxies: evolution - dark matter - large-scale structure of Universe}
\maketitle   %  finish the two spanning material
% \Referee     %  uncomment this for referee mode

\section{Introduction}

In the study of the formation and evolution of large-scale structure in the
universe, clusters of galaxies, galaxies, and many other gravitational systems,
haloes play an important r\^ole.
A {\it halo}\ is defined as a collapsed and virialized density maximum.
A halo can contain several smaller haloes, denoted as {\it subhaloes}.
We denote a halo that contains subhaloes as an {\it embedding halo}.
The existence of subhaloes is an important issue in cosmology, especially for
galaxies, and groups and clusters of galaxies. For example,
hierarchical structure formation scenarios for CDM-like spectra predict
many more dwarf galaxies (or satellites) than observed (Klypin et al.\ 1999b,
Moore et al.\ 1999).
Also, a spiral galaxy cannot retain its disk if there is an high abundance
of subhaloes within its halo (Moore et al.\ 1999). Thus, the question
is whether the initial density fluctuation spetrum is such that not many
dwarf galaxies form in the first place, or that they are easily destroyed
within our Galaxy, and hard to find outside it. On larger scale, clusters
of galaxies do contain an abundance of subhaloes, i.e.\ its member galaxies,
which are often distorted and stripped, but probably not destroyed.

N-body simulations are routinely used to model the formation, evolution,
and clustering of galaxy and galaxy cluster haloes.
However, the N-body simulation method does have its limitiations, and care
should be taken with the interpretation of the simulation results.
One such limitation arises from the use of particles to represent
the mass distribution whose evolution one tries to simulate.
If the physical mass distribution is effectively collisionless,
as is often the case, the use of particles gives rise to artificial
collisional effects within the numerical mass distribution, especially
though two-body interaction. Two-body encounters between simulation
particles, either close or distant, deflect their orbits significantly,
while they should behave like test particles, and respond only to the
mean potential. This is especially a problem for subhaloes, which are
easily destroyed in an N-body simulation with insufficient resolution
(White et al.\ 1987; Carlberg 1994; van Kampen 1995).
We use the term {\it overmerging}\ for the numerical processes that
artificially merge haloes and subhaloes in an N-body model, usually by
disrupting the subhalo. Thus, the term {\it merging}\ only denotes
merging due to physical processes.

\beginfigure{1}
{\psfig{file=over.eps,width=8.5cm,silent=1}}
\caption{{\bf Figure 1.} Graphical illustration of the main
numerical disruption processes that cause overmerging.
Open circles represent the 'cold' particles of an isolated
halo or a subhalo within an embedded halo, whose 'hot'
particles are indicated by filled circles.}
\endfigure

However, there seems to be some confusion in the literature over the
nature, cause, and importance of the overmerging problem.
This paper attempts to clarify the difference between the three most
important two-body processes operating on subhaloes, and provide
estimates for their associated timescales.
The first process is {\it two-body evaporation}, which is an
{\it internal}\ process operation within any halo or subhalo.
It is due to two-body interactions between the particles within the halo
or subhalo. The second process is {\it particle-subhalo two-body heating},
which is the heating of `cold' subhaloes by particles from the `hot'
embedding halo through two-body interactions.
The third process is {\it particle-subhalo tidal heating}, where the subhalo
is considered collisionless, and increases its kinetic energy through
tidal interactions with particles from the embedding halo. All three
process are illustrated in Fig.\ 1.

Besides the two-body processes, the use of {\it softened}\ particles, in order
to minimize two-body effects, can cause overmerging as well by artificially
enhancing physical processes like merging and disruption by tidal forces
(van Kampen 1995; Moore et al.\ 1996). Groups of softened particles are not
as compact as real haloes, and their artificially larger sizes make N-body
groups more prone to tidal disruption.

Carlberg (1994) proposed particle-subhalo two-body heating as the main
cause for overmerging. He gave a timescale for this process, but no
derivation. This was provided by van Kampen (1995).
It has been shown before (Carlberg 1994; van Kampen 1995) that the
two-body heating time-scale for small subhaloes orbiting an embedding
halo is short enough to result in their complete destruction and dispersion.
Subsequent authors, including Moore et al.\ (1996) and Klypin et al.\ (1999a),
referenced Carlberg (1994) as saying that `particle-halo heating'
is at the root of the problem. Moore et al.\ (1996) then claim that the
process is not important for the resolution of the simulation performed by
Carlberg (1994) because the timescale is too long.
However, the process Moore et al.\ (1996) actually describes and derives a
timescale for is a different one,
driven by tidal encounters between simulation particles and perfectly
collisionless subhaloes, while Carlberg (1994) and van Kampen (1995)
clearly had a collisonal process in mind, driven by two-body encounters
between individual subhalo particles and particles from the embedding halo.
This paper shows that the latter process has a much shorter timescale, and
therefore, along with excessive softening, is the main cause for overmerging.

\section{Two-body effects in N-body simulations}

Two-body effects become dominant for systems modelled by small numbers of
particles. This is usually quantified by the two-body relaxation timescale,
which is defined as the time it takes, on average, for a particle to
change its velocity by of order itself. After this time a system is
denoted as {\it relaxed}. The relaxation timescale is defined
in terms of the {\it half-mass radius}\ $r$, the {\it typical velocity}\
$v$ (usually taken to be equal to the velocity dispersion), and the
average change $\Delta v$ per {\it crossing time}\ $r/v$:
$$t_{\rm relax}\equiv {v^2 \over (\Delta v)^2} {r \over v}\ . \eqno\stepeq$$
\newcount\timescaledefinition
\timescaledefinition=\Eqnno
For an {\it isolated}\ virialized system of $N$ point particles, it is easy
to show that this is of order $0.1 N/\ln N$ crossing times (eg.\ Binney \& 
Tremaine 1987). If the time interval one tries to cover for a particular
problem is larger than the two-body relaxtion timescale, the problem becomes
artificially collisional.

Although many systems are likely to endure physical mechanisms like violent
relaxation and phase mixing during some stage of their evolution, an obvious
worry is that such physical mechanisms might not actually be important
in a given situation, so that two-body interactions are very much unwanted
as they might mimic the effects of physical mechanisms.
A different problem is that a system might completely evaporate through
two-body interactions.

The problem can be alleviated somewhat by softening
the particles, which reduces the two-body relaxation timescale to
$0.1 N/\ln \Lambda$ crossing times (see van Kampen (1995) and references
theirein), where $\Lambda={\rm Min}(R/4\epsilon, N)$, with $R$ the effective
size of the system, which we take to be twice the half-mass radius $r$,
and $\epsilon$ the softening length of the N-body particles.
However, $\epsilon$ is necessarily a function of both $N$ and $r$, as softened
particles should not overlap too much. Too large a choice for $\epsilon$ will
prevent particles from clustering properly and produce haloes which are too
extended and too cold (that is, the velocity dispersion is too small).
Given that $N/2$ particles reside within $r$ by definition, the mean particle
number density within $r$ is $3N/(8\pi r^3)$. The maximum mean particle density
desirable is set by the minimum mean nearest neighbour distance for the
particles: $n_{\rm max}=3/(4\pi r^3_{\rm nn})$. Most often used is Plummer
softening, which just means that particles have a Plummer density
profile, $\rho(r)\sim(r^2+\epsilon^2)^{5/2}$. The effective force
resolution, defined as the separation between two particles for which
the radial component of the softened force between them is half its
Newtonian value, is $\approx 2.6\epsilon$ for Plummer softening
(Gelb \& Bertschinger 1994), so we want $r_{\rm nn}\ga 2.6\epsilon$,
which gives $n_{\rm max}\approx 0.014/\epsilon^3$.
Thus, we find a maximum realistic softening length
$$\epsilon \approx {r\over 2 N^{1\over 3}}\ . \eqno\stepeq$$
\newcount\softeningnumber
\softeningnumber=\Eqnno
For this $\epsilon$ the relaxation time becomes $0.3 N/\ln N$
crossing times, i.e.\ three times larger than for the point particles case.

Even though softening alleviates the problem of two-body effects somewhat,
softened particle groups are more extended and less strongly bound (van Kampen 1995).
This makes them more vulnerable to two-body disruption processes, which are more
efficient for larger subhaloes, as shown below.
Furthermore, the timescales for {\it physical}\ disruption processes are effected.
Subhalo-subhalo tidal heating has a timescale inversely proportional to the
subhalo size (van Kampen 2000), and is therefore slower, although the lower
binding energy might compensate for this.
%Dynamical friction does not or weakly depend on subhalo size. 
Tidal stripping and disruption will be artificially enhanced, however, because
of the larger subhalo size and the weaker binding of the particles inside the
group (van Kampen 1995).
Because the enhanced tidal disruption due to softening has the same net
effect as two-body disruption, which is also enhanced due to the larger
subhalo size, the two disruption processes accelerate each other.
%In order to examine which process is the most important, one can look at
%simulations of the same matter distribution at different resolutions.
%If disruption occurs at the same timescale for two different resolutions,
%it is likely to be tidal, whereas if it is only seen to operate for the
%lower resolution simulation, it must be two-body disruption.
%Of the two, two-body disruption seems the dominant process (van Kampen 1995).
In the next section we derive two-body disruption timescales without taking
into account tidal disruption, and then treat these timescales as upper limits.

\section{Disruption timescales}

\subsection{Two-body evaporation}

This process is internal to haloes and subhaloes
in other words, it is a self-disruption process. Two-body interactions
between particles within the same (sub)halo change their orbits and
velocities, thus every once in a while the velocity will be larger 
than the escape velocity, and a particle will `leak' out of the (sub)halo.
The timescale for this process is about a hundred times the relaxation
timescale (e.g.\ Binney \& Tremaine 1987),
$$t_{\rm dis}\equiv 30 {N\over\ln N} {r \over v}
  \ , \eqno\stepeq$$
so for small $N$ this becomes important.
As an example, for galaxy haloes, evaporation becomes an issue for $N<10$,
as the crossing time for most galaxy haloes is larger than 0.2 Gyr,
independent of their mass.

Moore et al. (1996) tested whether this process gets enhanced for
subhaloes within embedding haloes due to the influence of the mean
tidal field of the embedding halo. They simulated a
collisional group of particles within a {\it smooth}, and therefore
collisionless, isothermal system. They found that the evaporation
rate was similar to that for an isolated group, and concluded
that {\it "relaxation effects are not important at driving mass loss
from haloes within current simulations"}.
Their conclusion is incorrect, however, as they did not consider
the particle-subhalo two-body heating process, which we discuss next.
%Their numerical tests should have included a particle distribution
%for the over-dense region as well, which would have heated the small
%group into dissolution.

\subsection{Particle-subhalo two-body heating}

Particles within a subhalo do not just interact amongst themselves
(driving the evaporation process describe above), but also with
the particles of the embedding halo.
As the latter are usually hotter than those of the
subhalo, velocity changes to the subhalo particles will always
be positive. The process very much resembles the kinetic heating
of a cold system that is introduced into a hot bath:
an embedding halo `boils' the subhalo into dissolution.
A derivation for the disruption timescale of this process is
given by van Kampen (1995, his eq.\ 15, which is erroneous by 
a factor of two):
$$t_{\rm dis} \approx {v_{\rm s}^2 \over v_{\rm h}^2}
  {N_{\rm h} \over 12\ln (r_{\rm h}/2\epsilon)} 
  {r_{\rm h} \over v_{\rm h}} \ .  \eqno\stepeq$$
\newcount\disruptiontimescale
\disruptiontimescale=\Eqnno
Here $N$ denotes the number of particles,
and the subscripts {\rm h} and {\rm s} denote embedding halo and subhalo
respectively. A similar expression was given earlier by
Carlberg (1994, his eq.\ 13 with his indices c and g swapped,
no derivation given):
$$t_{\rm dis} \approx {v_{\rm s}^2 \over v_{\rm h}^2}
  {N_{\rm h} \over 8\ln (r_{\rm h}/\epsilon)}
  {r_{\rm h} \over v_{\rm h}}\ . \eqno\stepeq$$
We can rewrite eq.\ $(\the\disruptiontimescale)$, using eq.\
(\the\softeningnumber) and the virial theorem for both halo and
subhalo, as
$$t_{\rm dis} \approx {N_{\rm s} \over 4 \ln N_{\rm h}}
  {r_{\rm h} \over r_{\rm s}} {r_{\rm h} \over v_{\rm h}} 
  \approx {N^{2\over 3}_{\rm s} \over 8 \ln N_{\rm h}}
  {r^2_{\rm h} \over v_{\rm h}} \epsilon^{-1}
  \ . \eqno\stepeq$$
\newcount\distimescale
\distimescale=\Eqnno
This timescale is shorter than that for two-body evaporation,
by a factor of (van Kampen 1995)
$$ 100 {v_{\rm h}\over v_{\rm s}} {r_{\rm s}^2 \over r_{\rm h}^2}
   {\ln N_{\rm h}\over \ln N_{\rm s}}\ , \eqno\stepeq$$
where the virial theorem, $v^2\sim N/r$, is used for both systems.

Because $r_{\rm h}$ is at least several times $r_{\rm s}$,
the disruption time (\the\distimescale) is at least
$\approx N_{\rm s}/\ln (N_{\rm h})$ embedding halo crossing
times, which covers the range $0.05-0.15 N_{\rm s}$ crossing
times for $N_{\rm h}\approx 10^3-10^9$. Thus, it is a much faster
process than two-body evaporation.

\subsection{Particle-subhalo tidal heating}

A different cause for overmerging was proposed by Moore et al.\
(1996): the tidal heating of subhaloes by particles of their embedding
haloes. Subhaloes are taken to be {\it collisionless}, and get
disrupted through an increase of their internal kinetic energy
by tidal distortion from passing N-body particles, which are artificially
large as compared to the true dark matter halo particles.

The time-scale for this process as given by Moore et al.\ (1996;
their eq.\ (3), which is eq.\ (7-67) of Binney \& Tremaine 1987 with
the assumption that the {\it r.m.s.}\ radius is equal to the half-mass
radius) reads
$$t_{\rm dis} \approx 0.03
  {v_{\rm h} \over G n_{\rm p}}
  {m_{\rm s}\over m^2_{\rm p}}
  {r^2_{\rm p}\over r^3_{\rm s}}\ , \eqno\stepeq$$
\newcount\tdismoore
\tdismoore=\Eqnno
where the subscript p stands for {\it perturber}. The perturber is an
N-body particle of the embedding halo with mass $m_{\rm p}$ and size
$r_{\rm p}$, at a distance $q$ from the centre of the embedding halo.
Note that the impulse approximation implies
${v^2 / \Delta v^2} = {E / \Delta E}$.
Moore et al.\ (1996) then assume the embedding halo to be isothermal,
so that $n_{\rm p} \approx v^2_{\rm h}/2 \pi G m_{\rm p} q^2$,
set the half-mass radius of the subhalo equal to the tidal radius,
$q v_{\rm s}/ (3 v_{\rm h})$, and assume the subhalo to be virialized.
This gives
$$t_{\rm dis} \approx 94 \Bigl({v_{\rm h}\over 1000\ {\rm km\ s}^{-1}}\Bigr)
  \Bigl({r_{\rm p}\over 10\ {\rm kpc}} \Bigr)^2
  \Bigl({10^9 {\rm M}_{\sun} \over m_{\rm p}}\Bigr) {\rm Gyr}\ . \eqno\stepeq$$
\newcount\mooretime
\mooretime=\Eqnno

Relation (\the\tdismoore) was originally derived by Spitzer (1958) for
the disruption by giant molecular clouds of open star clusters.
An important assumption in its derivation is the tidal approximation,
which is only valid for impact parameters $b>b_{\rm min}$.
Aguilar \& White (1985) found that $b_{\rm min}$ should be at least
five times the size of {\it both} the perturber and the perturbed system.
Binney \& Tremaine (1987) use the tidal approximation down to
$b_{\rm min}=r_{\rm cluster}<r_{\rm cloud}$, and introduce a correction
factor $g=3$ to take into account the encounters for which the tidal
approximation fails.

Moore et al.\ (1996) take this result and apply it to tidal interactions
between the N-body particles of an embedding halo and its subhaloes theirin.
Thus, they set $r_{\rm p}$ to the gravitational softening length $\epsilon$.
However, as the size of the perturbers is now {\it smaller} than the size
of the perturbed subhaloes, the tidal approximation, even with the correction
factor $g$ included, is only valid for $b>r_{\rm s}$. Therefore, setting
$r_{\rm p}=\epsilon$ in eq.\ (\the\mooretime) is incorrect; instead, one
should set $r_{\rm p}=r_{\rm s}$.
This means that the timescale becomes $(r_{\rm s}/\epsilon)^2$ times longer.
Using eq.\ (\the\softeningnumber), the time-scale becomes $4 N^{2/3}_{\rm s}$
times larger than proposed by Moore et al.\ (1996).

But there is another change to be made, as it is in fact the close
encounters of halo particles that do the most damage to the subhaloes.
According to Binney \& Tremaine (1987), a good estimate for
the disruption timescale can be had from an interpolation between the
approximations for tidal encounters and for penetrating ($b=0$) encounters. 
For each tidal encounter (Binney \& Tremaine 1987, their eq.\ 7-55),
$$(\Delta E)_{\rm tid} = 
  {4 G^2 m^2_{\rm p} m_{\rm s} r^2_{\rm s}\over 3 v^2_{\rm h}}
  {1\over b^4} \ , \eqno\stepeq$$
while for each penetrating encounter (Binney \& Tremaine 1987, their
eq.\ 7-57)
$$(\Delta E)_{\rm pen} = {4 \pi G^2 m^2_{\rm p}\over v^2_{\rm h}}
  \int_0^{\infty} {R^3\over (R^2+\epsilon^2)^2} \Sigma_{\rm s}(R) dR
  \ . \eqno\stepeq$$
If the perturbed subhalo is an isothermal sphere, i.e.\ 
$\Sigma_{\rm s}(R)=v^2_{\rm s}/(6GR)\approx 0.2m_{\rm h}/(r_{\rm h} R)$, we find
$$(\Delta E)_{\rm pen} \approx
  {2 G^2 m^2_{\rm p} m_{\rm s} r^2_{\rm s}\over v^2_{\rm h}}
  {1 \over \epsilon r^3_{\rm s}} . \eqno\stepeq$$
Interpolating contributions from the tidal and penetrating encounters, i.e.\
$$\Delta E = {4 G^2 m^2_{\rm p} m_{\rm s} r^2_{\rm s}\over 3 v^2_{\rm h}}
  {1 \over b^4+{2\over 3}\epsilon r^3_{\rm s}}\ , \eqno\stepeq$$
finally allows us to integrate over {\it all}\ encounters.
Following the procedure of Binney \& Tremaine (1987), we simply find
eq.\ (\the\tdismoore) with $r_{\rm p}$ ($=\epsilon$) replaced by
$0.52(\epsilon r^3_{\rm s})^{1/2}$. Following Moore et al.\ (1996) again
we get the same functional form as eq.\ (\the\mooretime), but the timescale
is approximately $2(r_{\rm s}/\epsilon)^{3/2}\approx 5 N^{1/2}_{\rm s}$
times {\it longer}\ than estimated by Moore et al.\ (1996).

By definition, $m_{\rm s}/m_{\rm p}=N_{\rm s}$, and we use
eq.\ (\the\softeningnumber) to get
$$t_{\rm dis} \approx 4.5 N^{5\over 6}_{\rm s}
  {r_{\rm h} \over r_{\rm s}}
  {r_{\rm h} \over v_{\rm h}}
  \approx 2.2 N^{1\over 2}_{\rm s}
  {r^2_{\rm h} \over v_{\rm h}} \epsilon^{-1}
  \ . \eqno\stepeq$$
\newcount\tdisNs
\tdisNs=\Eqnno
As $r_{\rm h}$ is at least a few times $r_{\rm s}$, the disruption
time is at least $20 N^{5/6}_{\rm s}$ embedding halo crossing times.
It is also a factor of $18 N^{-1/6}_{\rm s} \ln N_{\rm h}\approx 100$ times
longer than the particle-subhalo two-body disruption timescale.

\section{Conclusions and discussion}

Overmerging is the numerical disruption of subhaloes within embedding
haloes. Of the three main two-body disruption processes, particle-subhalo
two-body heating is clearly identified as the cause for overmerging.
Its timescale is shown to be much shorter than that for the two other
processes, two-body evaporation and particle-subhalo tidal heating.
Note that softened particles form into more extended subhaloes than is
realistic, so they are more vulnerable to these disruption processes
(van Kampen 1995), and to possible physical disruption processes as well.

Recently several research groups used simulations with a very high resolution
in order to resolve the overmerging problem (Klypin et al.\ 1999a;
Ghinga et al.\ 1998, 1999; Moore et al.\ 1999).
Unfortunately, different group finders and different definitions for disruption
times were used, so a direct comparison of the results is not straightforward.
Still, the consensus is that increasing the number of particles overcomes,
at least partially, the overmerging problem. However, the resolution needs to be
rather high:
%Klypin et al.\ (1999a) find that the larger subhaloes survive for resolutions
%of a few kpc and 10$^8$-10$^9$ $M_\odot$ respectively.
for N-body simulations on a cosmological scale, this requires the use of at
least $10^9$ particles, which is not very practical.
Furthermore, for the smallest groups the overmerging problem simply remains.

Another option is to include a baryonic component. With the addition
of dissipative particles, haloes should be more compact and have a higher
central density for the same numbre of particles.
However, as Klypin et al.\ (1999a) remark, there is a limit to this as some
fraction of the baryons tend to end up in rotationally supported disks.
A more practical problem with dissipative particles is the actual simulation
techniques needed, which usually is some form of smoothed particle
hydrodynamics (SPH). The resolution of SPH codes is typically not as high as that
of N-body codes, so for the purpose of resolving the overmerging problem
it is not a useful alternative at present.

A third option is to use halo particles, which prevents overmerging by
construction (van Kampen 1995). The idea is that a group of particles that
has collapsed into a virialised system is replaced by a single halo particle.
Local density percolation, also called adaptive friends-of-friends,
is adopted for finding the groups.
This is designed to identify the embedded haloes that the 
traditional percolation group finder links up with their parent halo.
By applying the algorithm several times during the evolution,
merging of already-formed galaxy haloes is taken into account as well.
Once a halo particle is formed, more N-body particles will group around
it at later times. If such a group can virialize, it is replaced by a
more massive halo particle. This will usually happen in the field.
However, for halo particles that end up in overdense regions, the
particles that swarm around a halo particles will be stripped quite
rapidly.

Once the overmerging problem is resolved down to the subhalo mass-scale
one is interested in, the physical processes can be studied. 
This is becoming feasible for current simulations.
However, whether the physical processes themselves are properly modelled
using N-body simulations has yet to be proven. The problem of artificially
large subhaloes due to softening needs to be solved, for example. Another
problem might be the modelling of dynamical friction, which requires a very
smooth distribution of particles in the embedding halo in order to produce
the wake that generates the drag force.

\section*{ACKNOWLEDGEMENTS}

I am grateful to John Peacock and Ben Moore for useful discussion,
suggestions and comments.

\section*{REFERENCES}

\beginrefs
\bibitem Aquilar L.A., White S.D.M., 1985, ApJ, 295, 374
%\bibitem Allan A.J., Richstone D.O., 1988, ApJ, 325, 583
\bibitem Binney J., Tremaine S., 1987, Galactic Dynamics, Princeton
\bibitem Carlberg R.G., 1994, ApJ, 433, 468
\bibitem Gelb J., Bertschinger E., 1994, ApJ, 436, 467
\bibitem Ghigna S., Moore B., Governato F., Lake G., Quinn T., Stadel J.,
	1998, MNRAS, 300, 146
\bibitem Ghigna S., Moore B., Governato F., Lake G., Quinn T., Stadel J.,
	1999, astro-ph/9910166
%\bibitem Heisler J., White S.D.M., 1990, MNRAS, 243, 199
\bibitem Klypin A.A., Gottl\"ober S., Kravtsov A.V., Khokhlov A.M., 1999a,
	ApJ, 516, 530
\bibitem Klypin A.A., Kravtsov A.V., Valenzuela O., Prada F., 1999b,
	astro-ph/9901240
%\bibitem Lin D.N.C., Tremaine S., 1983, ApJ, 264, 364
%\bibitem Mateo M., 1998, ARA\&A, 36, 435
\bibitem Moore B., Katz N., Lake G., 1996, ApJ, 457, 455
\bibitem Moore B., Governato F., Quinn T., Stadel J., Lake G., 1998,
	ApJ, 499, L5
%\bibitem Moore B., Lake G., Quinn T., Stadel J., 1999, MNRAS, 304, 465
\bibitem Moore B., Ghigna S., Governato F., Lake G., Quinn T., Stadel J.,
	Tozzi P., 1999,	ApJ, 524, L19
%\bibitem Saslaw W.C., 1985, Gravitational physics of stellar and galactic
%	systems, Cambridge
\bibitem Spitzer L., 1958, ApJ, 127, 17
%\bibitem Tormen G., Diaferio A., Syer D., 1998, 299, 728
%\bibitem Tremaine S., 1976, ApJ, 203, 72
\bibitem van Kampen E., 1995, MNRAS, 273, 295
%\bibitem van Kampen E., Katgert P., 1997, MNRAS, 289, 327
%\bibitem van Kampen E., Jimenez R., Peacock J.A., 1999, MNRAS, 310, 43
\bibitem White S.D.M., Davis M., Efstathiou G., Frenk C.S., 1987,
	Nat, 330, 451
\endrefs


%
% The End
%

\end

%A galaxy cluster halo typically has $r_{\rm c}=1-2\ {\rm Mpc}$ and
%$v_{\rm c}\approx 1000-2000$ km s$^{-1}$.
%With $\ln \Lambda=\ln 4r_{\rm h}/\epsilon$ for large $N$ (Farouki and
%Salpeter 1982) and $\epsilon=N^{-1/3}r_{\rm h}/2$ (see Appendix A) we find
%$$t_{\rm dis} \approx 1-3 \times 10^{-3}
%  \Bigl( {v_{\rm s}\over 100\ {\rm km\ s}^{-1}}\Bigr)^2 
%  {N_{\rm h}\over \ln 8 N_{\rm h}} {\rm Gyr} \ . \eqno\stepeq$$
%Thus, for a galaxy halo with $v_{\rm s}=100$ km s$^{-1}$ orbiting within a
%cluster, the disruption time-scale is only larger than a Hubble time for
%$N_{\rm h} > 10^6$.


%$$t_{\rm dis} \approx 26 \Bigl({ v_{\rm h}\over 1000\ {\rm km\ s}^{-1}}\Bigr)
%  \Bigl({\epsilon^{1\over 4} r^{3\over 4}_{\rm s}\over 10\ {\rm kpc}} \Bigr)^2
%  \Bigl({10^9 {\rm M}_{\sun} \over m_{\rm p}}\Bigr) {\rm Gyr}\ , \eqno\stepeq$$
%\newcount\particlehaloheating
%\particlehaloheating=\Eqnno
%Using eq.\ (\the\softeningnumber), the timescale is
%$$t_{\rm dis} \approx 141 N^{1\over 2}_{\rm s}
%  \Bigl({ v_{\rm h}\over 10^3\ {\rm km\ s}^{-1}}\Bigr)
%  \Bigl({\epsilon \over 10\ {\rm kpc}} \Bigr)^2
%  \Bigl({10^9 {\rm M}_{\sun} \over m_{\rm p}}\Bigr) {\rm Gyr}\ , \eqno\stepeq$$
%\newcount\particlehalotimescale
%\particlehalotimescale=\Eqnno
%which is (still) much larger than that given by Moore et al.\ (1996),
%i.e.\ eq.\ (\the\mooretime) with $r_{\rm p}=\epsilon$, especially
%for larger $N_{\rm s}$.
%This is still true for larger choices for the softening parameter,
%for example $\epsilon=r_{\rm s}/N^{1/3}_{\rm s}$.
%Eq.\ (\the\particlehalotimescale) depends on the {\it numerical}\ quantities
%$\epsilon$ and $m_{\rm p}$, which in turn depend on $N_{\rm s}$. We make this
%dependence clear by using eq.\ (\the\softeningnumber) again, and applying
%the virial theorem for the subhalo:
%$$t_{\rm dis} \approx 21 N^{5\over 6}_{\rm s}
%  \Bigl({r^2_{\rm h} \over v_{\rm h}}\Bigr)
%  \Bigl({10\ {\rm kpc} \over r_{\rm s}} \Bigr)\ {\rm Gyr} 
%  \ . \eqno\stepeq$$
%\newcount\particlehalotimescaletwo
%\particlehalotimescaletwo=\Eqnno

%This is realistic in a phenomenological sense, but clearly
%not quantitatively.
%The technique produces galaxy haloes at the right time and the right
%place, with a spectrum of masses that compares well to the Press-Schechter
%formalism at early times, but starts to deviate at later times.
%This is actually a good result, as it solves some problems for
%phenomenological galaxy formation models (van Kampen, Jimenez \& Peacock
%1999).
%
%In concluding, each of these solutions, or a combination of them, will
%suit a specific situation or system. However, it is clear that overmerging
%is a real problem and has either to be tackled, or to be taken into account
%when drawing conclusions from an N-body experiment. 


%The two-body heating timescale scales as
%$N_{\rm s}/r_{\rm s}$, while the two-body evaporation time-scale scale as
%$N_{\rm s} r_{\rm s}/v_{\rm s}$ (disregarding logarithmic terms for both).
%The particle-halo tidal heating processes scales as $N^{5/6}_{\rm s}/r_{\rm s}$,
%so almost the same as the two-body heating process, but with a much larger overall
%value. It is harder to explicitly derive a timescale for halo-halo tidal
%heating, as the haloes have a wide range in masses, but its timescale
%is likely to fall somewhere between those of the particle-halo and two-body
%processes, with the latter still the shortest (???) .

psfig.tex
% Psfig/TeX 
\def\PsfigVersion{1.9}
% dvips version
%
% All psfig/tex software, documentation, and related files
% in this distribution of psfig/tex are 
% Copyright 1987, 1988, 1991 Trevor J. Darrell
%
% Permission is granted for use and non-profit distribution of psfig/tex 
% providing that this notice is clearly maintained. The right to
% distribute any portion of psfig/tex for profit or as part of any commercial
% product is specifically reserved for the author(s) of that portion.
%
% *** Feel free to make local modifications of psfig as you wish,
% *** but DO NOT post any changed or modified versions of ``psfig''
% *** directly to the net. Send them to me and I'll try to incorporate
% *** them into future versions. If you want to take the psfig code 
% *** and make a new program (subject to the copyright above), distribute it, 
% *** (and maintain it) that's fine, just don't call it psfig.
%
% Bugs and improvements to trevor@media.mit.edu.
%
% Thanks to Greg Hager (GDH) and Ned Batchelder for their contributions
% to the original version of this project.
%
% Modified by J. Daniel Smith on 9 October 1990 to accept the
% %%BoundingBox: comment with or without a space after the colon.  Stole
% file reading code from Tom Rokicki's EPSF.TEX file (see below).
%
% More modifications by J. Daniel Smith on 29 March 1991 to allow the
% the included PostScript figure to be rotated.  The amount of
% rotation is specified by the "angle=" parameter of the \psfig command.
%
% Modified by Robert Russell on June 25, 1991 to allow users to specify
% .ps filenames which don't yet exist, provided they explicitly provide
% boundingbox information via the \psfig command. Note: This will only work
% if the "file=" parameter follows all four "bb???=" parameters in the
% command. This is due to the order in which psfig interprets these params.
%
%  3 Jul 1991	JDS	check if file already read in once
%  4 Sep 1991	JDS	fixed incorrect computation of rotated
%			bounding box
% 25 Sep 1991	GVR	expanded synopsis of \psfig
% 14 Oct 1991	JDS	\fbox code from LaTeX so \psdraft works with TeX
%			changed \typeout to \ps@typeout
% 17 Oct 1991	JDS	added \psscalefirst and \psrotatefirst
%

% From: gvr@cs.brown.edu (George V. Reilly)
%
% \psdraft	draws an outline box, but doesn't include the figure
%		in the DVI file.  Useful for previewing.
%
% \psfull	includes the figure in the DVI file (default).
%
% \psscalefirst width= or height= specifies the size of the figure
% 		before rotation.
% \psrotatefirst (default) width= or height= specifies the size of the
% 		 figure after rotation.  Asymetric figures will
% 		 appear to shrink.
%
% \psfigurepath#1	sets the path to search for the figure
%
% \psfig
% usage: \psfig{file=, figure=, height=, width=,
%			bbllx=, bblly=, bburx=, bbury=,
%			rheight=, rwidth=, clip=, angle=, silent=}
%
%	"file" is the filename.  If no path name is specified and the
%		file is not found in the current directory,
%		it will be looked for in directory \psfigurepath.
%	"figure" is a synonym for "file".
%	By default, the width and height of the figure are taken from
%		the BoundingBox of the figure.
%	If "width" is specified, the figure is scaled so that it has
%		the specified width.  Its height changes proportionately.
%	If "height" is specified, the figure is scaled so that it has
%		the specified height.  Its width changes proportionately.
%	If both "width" and "height" are specified, the figure is scaled
%		anamorphically.
%	"bbllx", "bblly", "bburx", and "bbury" control the PostScript
%		BoundingBox.  If these four values are specified
%               *before* the "file" option, the PSFIG will not try to
%               open the PostScript file.
%	"rheight" and "rwidth" are the reserved height and width
%		of the figure, i.e., how big TeX actually thinks
%		the figure is.  They default to "width" and "height".
%	The "clip" option ensures that no portion of the figure will
%		appear outside its BoundingBox.  "clip=" is a switch and
%		takes no value, but the `=' must be present.
%	The "angle" option specifies the angle of rotation (degrees, ccw).
%	The "silent" option makes \psfig work silently.
%

% check to see if macros already loaded in (maybe some other file says
% "\input psfig") ...
\ifx\undefined\psfig\else\endinput\fi

%
% from a suggestion by eijkhout@csrd.uiuc.edu to allow
% loading as a style file. Changed to avoid problems
% with amstex per suggestion by jbence@math.ucla.edu

\let\LaTeXAtSign=\@
\let\@=\relax
\edef\psfigRestoreAt{\catcode`\@=\number\catcode`@\relax}
%\edef\psfigRestoreAt{\catcode`@=\number\catcode`@\relax}
\catcode`\@=11\relax
\newwrite\@unused
\def\ps@typeout#1{{\let\protect\string\immediate\write\@unused{#1}}}
\ps@typeout{psfig/tex \PsfigVersion}

%% Here's how you define your figure path.  Should be set up with null
%% default and a user useable definition.

\def\figurepath{./}
\def\psfigurepath#1{\edef\figurepath{#1}}

%
% @psdo control structure -- similar to Latex @for.
% I redefined these with different names so that psfig can
% be used with TeX as well as LaTeX, and so that it will not 
% be vunerable to future changes in LaTeX's internal
% control structure,
%
\def\@nnil{\@nil}
\def\@empty{}
\def\@psdonoop#1\@@#2#3{}
\def\@psdo#1:=#2\do#3{\edef\@psdotmp{#2}\ifx\@psdotmp\@empty \else
    \expandafter\@psdoloop#2,\@nil,\@nil\@@#1{#3}\fi}
\def\@psdoloop#1,#2,#3\@@#4#5{\def#4{#1}\ifx #4\@nnil \else
       #5\def#4{#2}\ifx #4\@nnil \else#5\@ipsdoloop #3\@@#4{#5}\fi\fi}
\def\@ipsdoloop#1,#2\@@#3#4{\def#3{#1}\ifx #3\@nnil 
       \let\@nextwhile=\@psdonoop \else
      #4\relax\let\@nextwhile=\@ipsdoloop\fi\@nextwhile#2\@@#3{#4}}
\def\@tpsdo#1:=#2\do#3{\xdef\@psdotmp{#2}\ifx\@psdotmp\@empty \else
    \@tpsdoloop#2\@nil\@nil\@@#1{#3}\fi}
\def\@tpsdoloop#1#2\@@#3#4{\def#3{#1}\ifx #3\@nnil 
       \let\@nextwhile=\@psdonoop \else
      #4\relax\let\@nextwhile=\@tpsdoloop\fi\@nextwhile#2\@@#3{#4}}
% 
% \fbox is defined in latex.tex; so if \fbox is undefined, assume that
% we are not in LaTeX.
% Perhaps this could be done better???
\ifx\undefined\fbox
% \fbox code from modified slightly from LaTeX
\newdimen\fboxrule
\newdimen\fboxsep
\newdimen\ps@tempdima
\newbox\ps@tempboxa
\fboxsep = 3pt
\fboxrule = .4pt
\long\def\fbox#1{\leavevmode\setbox\ps@tempboxa\hbox{#1}\ps@tempdima\fboxrule
    \advance\ps@tempdima \fboxsep \advance\ps@tempdima \dp\ps@tempboxa
   \hbox{\lower \ps@tempdima\hbox
  {\vbox{\hrule height \fboxrule
          \hbox{\vrule width \fboxrule \hskip\fboxsep
          \vbox{\vskip\fboxsep \box\ps@tempboxa\vskip\fboxsep}\hskip 
                 \fboxsep\vrule width \fboxrule}
                 \hrule height \fboxrule}}}}
\fi
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% file reading stuff from epsf.tex
%   EPSF.TEX macro file:
%   Written by Tomas Rokicki of Radical Eye Software, 29 Mar 1989.
%   Revised by Don Knuth, 3 Jan 1990.
%   Revised by Tomas Rokicki to accept bounding boxes with no
%      space after the colon, 18 Jul 1990.
%   Portions modified/removed for use in PSFIG package by
%      J. Daniel Smith, 9 October 1990.
%
\newread\ps@stream
\newif\ifnot@eof       % continue looking for the bounding box?
\newif\if@noisy        % report what you're making?
\newif\if@atend        % %%BoundingBox: has (at end) specification
\newif\if@psfile       % does this look like a PostScript file?
%
% PostScript files should start with `%!'
%
{\catcode`\%=12\global\gdef\epsf@start{%!}}
\def\epsf@PS{PS}
%
\def\epsf@getbb#1{%
%
%   The first thing we need to do is to open the
%   PostScript file, if possible.
%
\openin\ps@stream=#1
\ifeof\ps@stream\ps@typeout{Error, File #1 not found}\else
%
%   Okay, we got it. Now we'll scan lines until we find one that doesn't
%   start with %. We're looking for the bounding box comment.
%
   {\not@eoftrue \chardef\other=12
    \def\do##1{\catcode`##1=\other}\dospecials \catcode`\ =10
    \loop
       \if@psfile
	  \read\ps@stream to \epsf@fileline
       \else{
	  \obeyspaces
          \read\ps@stream to \epsf@tmp\global\let\epsf@fileline\epsf@tmp}
       \fi
       \ifeof\ps@stream\not@eoffalse\else
%
%   Check the first line for `%!'.  Issue a warning message if its not
%   there, since the file might not be a PostScript file.
%
       \if@psfile\else
       \expandafter\epsf@test\epsf@fileline:. \\%
       \fi
%
%   We check to see if the first character is a % sign;
%   if so, we look further and stop only if the line begins with
%   `%%BoundingBox:' and the `(atend)' specification was not found.
%   That is, the only way to stop is when the end of file is reached,
%   or a `%%BoundingBox: llx lly urx ury' line is found.
%
          \expandafter\epsf@aux\epsf@fileline:. \\%
       \fi
   \ifnot@eof\repeat
   }\closein\ps@stream\fi}%
%
% This tests if the file we are reading looks like a PostScript file.
%
\long\def\epsf@test#1#2#3:#4\\{\def\epsf@testit{#1#2}
			\ifx\epsf@testit\epsf@start\else
\ps@typeout{Warning! File does not start with `\epsf@start'.  It may not be a PostScript file.}
			\fi
			\@psfiletrue} % don't test after 1st line
%
%   We still need to define the tricky \epsf@aux macro. This requires
%   a couple of magic constants for comparison purposes.
%
{\catcode`\%=12\global\let\epsf@percent=%\global\def\epsf@bblit{%BoundingBox}}
%
%
%   So we're ready to check for `%BoundingBox:' and to grab the
%   values if they are found.  We continue searching if `(at end)'
%   was found after the `%BoundingBox:'.
%
\long\def\epsf@aux#1#2:#3\\{\ifx#1\epsf@percent
   \def\epsf@testit{#2}\ifx\epsf@testit\epsf@bblit
	\@atendfalse
        \epsf@atend #3 . \\%
	\if@atend	
	   \if@verbose{
		\ps@typeout{psfig: found `(atend)'; continuing search}
	   }\fi
        \else
        \epsf@grab #3 . . . \\%
        \not@eoffalse
        \global\no@bbfalse
        \fi
   \fi\fi}%
%
%   Here we grab the values and stuff them in the appropriate definitions.
%
\def\epsf@grab #1 #2 #3 #4 #5\\{%
   \global\def\epsf@llx{#1}\ifx\epsf@llx\empty
      \epsf@grab #2 #3 #4 #5 .\\\else
   \global\def\epsf@lly{#2}%
   \global\def\epsf@urx{#3}\global\def\epsf@ury{#4}\fi}%
%
% Determine if the stuff following the %%BoundingBox is `(atend)'
% J. Daniel Smith.  Copied from \epsf@grab above.
%
\def\epsf@atendlit{(atend)} 
\def\epsf@atend #1 #2 #3\\{%
   \def\epsf@tmp{#1}\ifx\epsf@tmp\empty
      \epsf@atend #2 #3 .\\\else
   \ifx\epsf@tmp\epsf@atendlit\@atendtrue\fi\fi}


% End of file reading stuff from epsf.tex
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% trigonometry stuff from "trig.tex"
\chardef\psletter = 11 % won't conflict with \begin{letter} now...
\chardef\other = 12

\newif \ifdebug %%% turn me on to see TeX hard at work ...
\newif\ifc@mpute %%% don't need to compute some values
\c@mputetrue % but assume that we do

\let\then = \relax
\def\r@dian{pt }
\let\r@dians = \r@dian
\let\dimensionless@nit = \r@dian
\let\dimensionless@nits = \dimensionless@nit
\def\internal@nit{sp }
\let\internal@nits = \internal@nit
\newif\ifstillc@nverging
\def \Mess@ge #1{\ifdebug \then \message {#1} \fi}

{ %%% Things that need abnormal catcodes %%%
	\catcode `\@ = \psletter
	\gdef \nodimen {\expandafter \n@dimen \the \dimen}
	\gdef \term #1 #2 #3%
	       {\edef \t@ {\the #1}%%% freeze parameter 1 (count, by value)
		\edef \t@@ {\expandafter \n@dimen \the #2\r@dian}%
				   %%% freeze parameter 2 (dimen, by value)
		\t@rm {\t@} {\t@@} {#3}%
	       }
	\gdef \t@rm #1 #2 #3%
	       {{%
		\count 0 = 0
		\dimen 0 = 1 \dimensionless@nit
		\dimen 2 = #2\relax
		\Mess@ge {Calculating term #1 of \nodimen 2}%
		\loop
		\ifnum	\count 0 < #1
		\then	\advance \count 0 by 1
			\Mess@ge {Iteration \the \count 0 \space}%
			\Multiply \dimen 0 by {\dimen 2}%
			\Mess@ge {After multiplication, term = \nodimen 0}%
			\Divide \dimen 0 by {\count 0}%
			\Mess@ge {After division, term = \nodimen 0}%
		\repeat
		\Mess@ge {Final value for term #1 of 
				\nodimen 2 \space is \nodimen 0}%
		\xdef \Term {#3 = \nodimen 0 \r@dians}%
		\aftergroup \Term
	       }}
	\catcode `\p = \other
	\catcode `\t = \other
	\gdef \n@dimen #1pt{#1} %%% throw away the ``pt''
}

\def \Divide #1by #2{\divide #1 by #2} %%% just a synonym

\def \Multiply #1by #2%%% allows division of a dimen by a dimen
       {{%%% should really freeze parameter 2 (dimen, passed by value)
	\count 0 = #1\relax
	\count 2 = #2\relax
	\count 4 = 65536
	\Mess@ge {Before scaling, count 0 = \the \count 0 \space and
			count 2 = \the \count 2}%
	\ifnum	\count 0 > 32767 %%% do our best to avoid overflow
	\then	\divide \count 0 by 4
		\divide \count 4 by 4
	\else	\ifnum	\count 0 < -32767
		\then	\divide \count 0 by 4
			\divide \count 4 by 4
		\else
		\fi
	\fi
	\ifnum	\count 2 > 32767 %%% while retaining reasonable accuracy
	\then	\divide \count 2 by 4
		\divide \count 4 by 4
	\else	\ifnum	\count 2 < -32767
		\then	\divide \count 2 by 4
			\divide \count 4 by 4
		\else
		\fi
	\fi
	\multiply \count 0 by \count 2
	\divide \count 0 by \count 4
	\xdef \product {#1 = \the \count 0 \internal@nits}%
	\aftergroup \product
       }}

\def\r@duce{\ifdim\dimen0 > 90\r@dian \then   % sin(x+90) = sin(180-x)
		\multiply\dimen0 by -1
		\advance\dimen0 by 180\r@dian
		\r@duce
	    \else \ifdim\dimen0 < -90\r@dian \then  % sin(-x) = sin(360+x)
		\advance\dimen0 by 360\r@dian
		\r@duce
		\fi
	    \fi}

\def\Sine#1%
       {{%
	\dimen 0 = #1 \r@dian
	\r@duce
	\ifdim\dimen0 = -90\r@dian \then
	   \dimen4 = -1\r@dian
	   \c@mputefalse
	\fi
	\ifdim\dimen0 = 90\r@dian \then
	   \dimen4 = 1\r@dian
	   \c@mputefalse
	\fi
	\ifdim\dimen0 = 0\r@dian \then
	   \dimen4 = 0\r@dian
	   \c@mputefalse
	\fi
%
	\ifc@mpute \then
        	% convert degrees to radians
		\divide\dimen0 by 180
		\dimen0=3.141592654\dimen0
%
		\dimen 2 = 3.1415926535897963\r@dian %%% a well-known constant
		\divide\dimen 2 by 2 %%% we only deal with -pi/2 : pi/2
		\Mess@ge {Sin: calculating Sin of \nodimen 0}%
		\count 0 = 1 %%% see power-series expansion for sine
		\dimen 2 = 1 \r@dian %%% ditto
		\dimen 4 = 0 \r@dian %%% ditto
		\loop
			\ifnum	\dimen 2 = 0 %%% then we've done
			\then	\stillc@nvergingfalse 
			\else	\stillc@nvergingtrue
			\fi
			\ifstillc@nverging %%% then calculate next term
			\then	\term {\count 0} {\dimen 0} {\dimen 2}%
				\advance \count 0 by 2
				\count 2 = \count 0
				\divide \count 2 by 2
				\ifodd	\count 2 %%% signs alternate
				\then	\advance \dimen 4 by \dimen 2
				\else	\advance \dimen 4 by -\dimen 2
				\fi
		\repeat
	\fi		
			\xdef \sine {\nodimen 4}%
       }}

% Now the Cosine can be calculated easily by calling \Sine
\def\Cosine#1{\ifx\sine\UnDefined\edef\Savesine{\relax}\else
		             \edef\Savesine{\sine}\fi
	{\dimen0=#1\r@dian\advance\dimen0 by 90\r@dian
	 \Sine{\nodimen 0}
	 \xdef\cosine{\sine}
	 \xdef\sine{\Savesine}}}	      
% end of trig stuff
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\def\psdraft{
	\def\@psdraft{0}
	%\ps@typeout{draft level now is \@psdraft \space . }
}
\def\psfull{
	\def\@psdraft{100}
	%\ps@typeout{draft level now is \@psdraft \space . }
}

\psfull

\newif\if@scalefirst
\def\psscalefirst{\@scalefirsttrue}
\def\psrotatefirst{\@scalefirstfalse}
\psrotatefirst

\newif\if@draftbox
\def\psnodraftbox{
	\@draftboxfalse
}
\def\psdraftbox{
	\@draftboxtrue
}
\@draftboxtrue

\newif\if@prologfile
\newif\if@postlogfile
\def\pssilent{
	\@noisyfalse
}
\def\psnoisy{
	\@noisytrue
}
\psnoisy
%%% These are for the option list.
%%% A specification of the form a = b maps to calling \@p@@sa{b}
\newif\if@bbllx
\newif\if@bblly
\newif\if@bburx
\newif\if@bbury
\newif\if@height
\newif\if@width
\newif\if@rheight
\newif\if@rwidth
\newif\if@angle
\newif\if@clip
\newif\if@verbose
\def\@p@@sclip#1{\@cliptrue}


\newif\if@decmpr

%%% GDH 7/26/87 -- changed so that it first looks in the local directory,
%%% then in a specified global directory for the ps file.
%%% RPR 6/25/91 -- changed so that it defaults to user-supplied name if
%%% boundingbox info is specified, assuming graphic will be created by
%%% print time.
%%% TJD 10/19/91 -- added bbfile vs. file distinction, and @decmpr flag

\def\@p@@sfigure#1{\def\@p@sfile{null}\def\@p@sbbfile{null}
	        \openin1=#1.bb
		\ifeof1\closein1
	        	\openin1=\figurepath#1.bb
			\ifeof1\closein1
			        \openin1=#1
				\ifeof1\closein1%
				       \openin1=\figurepath#1
					\ifeof1
					   \ps@typeout{Error, File #1 not found}
						\if@bbllx\if@bblly
				   		\if@bburx\if@bbury
			      				\def\@p@sfile{#1}%
			      				\def\@p@sbbfile{#1}%
							\@decmprfalse
				  	   	\fi\fi\fi\fi
					\else\closein1
				    		\def\@p@sfile{\figurepath#1}%
				    		\def\@p@sbbfile{\figurepath#1}%
						\@decmprfalse
	                       		\fi%
			 	\else\closein1%
					\def\@p@sfile{#1}
					\def\@p@sbbfile{#1}
					\@decmprfalse
			 	\fi
			\else
				\def\@p@sfile{\figurepath#1}
				\def\@p@sbbfile{\figurepath#1.bb}
				\@decmprtrue
			\fi
		\else
			\def\@p@sfile{#1}
			\def\@p@sbbfile{#1.bb}
			\@decmprtrue
		\fi}

\def\@p@@sfile#1{\@p@@sfigure{#1}}

\def\@p@@sbbllx#1{
		%\ps@typeout{bbllx is #1}
		\@bbllxtrue
		\dimen100=#1
		\edef\@p@sbbllx{\number\dimen100}
}
\def\@p@@sbblly#1{
		%\ps@typeout{bblly is #1}
		\@bbllytrue
		\dimen100=#1
		\edef\@p@sbblly{\number\dimen100}
}
\def\@p@@sbburx#1{
		%\ps@typeout{bburx is #1}
		\@bburxtrue
		\dimen100=#1
		\edef\@p@sbburx{\number\dimen100}
}
\def\@p@@sbbury#1{
		%\ps@typeout{bbury is #1}
		\@bburytrue
		\dimen100=#1
		\edef\@p@sbbury{\number\dimen100}
}
\def\@p@@sheight#1{
		\@heighttrue
		\dimen100=#1
   		\edef\@p@sheight{\number\dimen100}
		%\ps@typeout{Height is \@p@sheight}
}
\def\@p@@swidth#1{
		%\ps@typeout{Width is #1}
		\@widthtrue
		\dimen100=#1
		\edef\@p@swidth{\number\dimen100}
}
\def\@p@@srheight#1{
		%\ps@typeout{Reserved height is #1}
		\@rheighttrue
		\dimen100=#1
		\edef\@p@srheight{\number\dimen100}
}
\def\@p@@srwidth#1{
		%\ps@typeout{Reserved width is #1}
		\@rwidthtrue
		\dimen100=#1
		\edef\@p@srwidth{\number\dimen100}
}
\def\@p@@sangle#1{
		%\ps@typeout{Rotation is #1}
		\@angletrue
%		\dimen100=#1
		\edef\@p@sangle{#1} %\number\dimen100}
}
\def\@p@@ssilent#1{ 
		\@verbosefalse
}
\def\@p@@sprolog#1{\@prologfiletrue\def\@prologfileval{#1}}
\def\@p@@spostlog#1{\@postlogfiletrue\def\@postlogfileval{#1}}
\def\@cs@name#1{\csname #1\endcsname}
\def\@setparms#1=#2,{\@cs@name{@p@@s#1}{#2}}
%
% initialize the defaults (size the size of the figure)
%
\def\ps@init@parms{
		\@bbllxfalse \@bbllyfalse
		\@bburxfalse \@bburyfalse
		\@heightfalse \@widthfalse
		\@rheightfalse \@rwidthfalse
		\def\@p@sbbllx{}\def\@p@sbblly{}
		\def\@p@sbburx{}\def\@p@sbbury{}
		\def\@p@sheight{}\def\@p@swidth{}
		\def\@p@srheight{}\def\@p@srwidth{}
		\def\@p@sangle{0}
		\def\@p@sfile{} \def\@p@sbbfile{}
		\def\@p@scost{10}
		\def\@sc{}
		\@prologfilefalse
		\@postlogfilefalse
		\@clipfalse
		\if@noisy
			\@verbosetrue
		\else
			\@verbosefalse
		\fi
}
%
% Go through the options setting things up.
%
\def\parse@ps@parms#1{
	 	\@psdo\@psfiga:=#1\do
		   {\expandafter\@setparms\@psfiga,}}
%
% Compute bb height and width
%
\newif\ifno@bb
\def\bb@missing{
	\if@verbose{
		\ps@typeout{psfig: searching \@p@sbbfile \space  for bounding box}
	}\fi
	\no@bbtrue
	\epsf@getbb{\@p@sbbfile}
        \ifno@bb \else \bb@cull\epsf@llx\epsf@lly\epsf@urx\epsf@ury\fi
}	
\def\bb@cull#1#2#3#4{
	\dimen100=#1 bp\edef\@p@sbbllx{\number\dimen100}
	\dimen100=#2 bp\edef\@p@sbblly{\number\dimen100}
	\dimen100=#3 bp\edef\@p@sbburx{\number\dimen100}
	\dimen100=#4 bp\edef\@p@sbbury{\number\dimen100}
	\no@bbfalse
}
% rotate point (#1,#2) about (0,0).
% The sine and cosine of the angle are already stored in \sine and
% \cosine.  The result is placed in (\p@intvaluex, \p@intvaluey).
\newdimen\p@intvaluex
\newdimen\p@intvaluey
\def\rotate@#1#2{{\dimen0=#1 sp\dimen1=#2 sp
%            	calculate x' = x \cos\theta - y \sin\theta
		  \global\p@intvaluex=\cosine\dimen0
		  \dimen3=\sine\dimen1
		  \global\advance\p@intvaluex by -\dimen3
% 		calculate y' = x \sin\theta + y \cos\theta
		  \global\p@intvaluey=\sine\dimen0
		  \dimen3=\cosine\dimen1
		  \global\advance\p@intvaluey by \dimen3
		  }}
\def\compute@bb{
		\no@bbfalse
		\if@bbllx \else \no@bbtrue \fi
		\if@bblly \else \no@bbtrue \fi
		\if@bburx \else \no@bbtrue \fi
		\if@bbury \else \no@bbtrue \fi
		\ifno@bb \bb@missing \fi
		\ifno@bb \ps@typeout{FATAL ERROR: no bb supplied or found}
			\no-bb-error
		\fi
		%
%\ps@typeout{BB: \@p@sbbllx, \@p@sbblly, \@p@sbburx, \@p@sbbury} 
%
% store height/width of original (unrotated) bounding box
		\count203=\@p@sbburx
		\count204=\@p@sbbury
		\advance\count203 by -\@p@sbbllx
		\advance\count204 by -\@p@sbblly
		\edef\ps@bbw{\number\count203}
		\edef\ps@bbh{\number\count204}
		%\ps@typeout{ psbbh = \ps@bbh, psbbw = \ps@bbw }
		\if@angle 
			\Sine{\@p@sangle}\Cosine{\@p@sangle}
	        	{\dimen100=\maxdimen\xdef\r@p@sbbllx{\number\dimen100}
					    \xdef\r@p@sbblly{\number\dimen100}
			                    \xdef\r@p@sbburx{-\number\dimen100}
					    \xdef\r@p@sbbury{-\number\dimen100}}
%
% Need to rotate all four points and take the X-Y extremes of the new
% points as the new bounding box.
                        \def\minmaxtest{
			   \ifnum\number\p@intvaluex<\r@p@sbbllx
			      \xdef\r@p@sbbllx{\number\p@intvaluex}\fi
			   \ifnum\number\p@intvaluex>\r@p@sbburx
			      \xdef\r@p@sbburx{\number\p@intvaluex}\fi
			   \ifnum\number\p@intvaluey<\r@p@sbblly
			      \xdef\r@p@sbblly{\number\p@intvaluey}\fi
			   \ifnum\number\p@intvaluey>\r@p@sbbury
			      \xdef\r@p@sbbury{\number\p@intvaluey}\fi
			   }
%			lower left
			\rotate@{\@p@sbbllx}{\@p@sbblly}
			\minmaxtest
%			upper left
			\rotate@{\@p@sbbllx}{\@p@sbbury}
			\minmaxtest
%			lower right
			\rotate@{\@p@sbburx}{\@p@sbblly}
			\minmaxtest
%			upper right
			\rotate@{\@p@sbburx}{\@p@sbbury}
			\minmaxtest
			\edef\@p@sbbllx{\r@p@sbbllx}\edef\@p@sbblly{\r@p@sbblly}
			\edef\@p@sbburx{\r@p@sbburx}\edef\@p@sbbury{\r@p@sbbury}
%\ps@typeout{rotated BB: \r@p@sbbllx, \r@p@sbblly, \r@p@sbburx, \r@p@sbbury}
		\fi
		\count203=\@p@sbburx
		\count204=\@p@sbbury
		\advance\count203 by -\@p@sbbllx
		\advance\count204 by -\@p@sbblly
		\edef\@bbw{\number\count203}
		\edef\@bbh{\number\count204}
		%\ps@typeout{ bbh = \@bbh, bbw = \@bbw }
}
%
% \in@hundreds performs #1 * (#2 / #3) correct to the hundreds,
%	then leaves the result in @result
%
\def\in@hundreds#1#2#3{\count240=#2 \count241=#3
		     \count100=\count240	% 100 is first digit #2/#3
		     \divide\count100 by \count241
		     \count101=\count100
		     \multiply\count101 by \count241
		     \advance\count240 by -\count101
		     \multiply\count240 by 10
		     \count101=\count240	%101 is second digit of #2/#3
		     \divide\count101 by \count241
		     \count102=\count101
		     \multiply\count102 by \count241
		     \advance\count240 by -\count102
		     \multiply\count240 by 10
		     \count102=\count240	% 102 is the third digit
		     \divide\count102 by \count241
		     \count200=#1\count205=0
		     \count201=\count200
			\multiply\count201 by \count100
		 	\advance\count205 by \count201
		     \count201=\count200
			\divide\count201 by 10
			\multiply\count201 by \count101
			\advance\count205 by \count201
			%
		     \count201=\count200
			\divide\count201 by 100
			\multiply\count201 by \count102
			\advance\count205 by \count201
			%
		     \edef\@result{\number\count205}
}
\def\compute@wfromh{
		% computing : width = height * (bbw / bbh)
		\in@hundreds{\@p@sheight}{\@bbw}{\@bbh}
		%\ps@typeout{ \@p@sheight * \@bbw / \@bbh, = \@result }
		\edef\@p@swidth{\@result}
		%\ps@typeout{w from h: width is \@p@swidth}
}
\def\compute@hfromw{
		% computing : height = width * (bbh / bbw)
	        \in@hundreds{\@p@swidth}{\@bbh}{\@bbw}
		%\ps@typeout{ \@p@swidth * \@bbh / \@bbw = \@result }
		\edef\@p@sheight{\@result}
		%\ps@typeout{h from w : height is \@p@sheight}
}
\def\compute@handw{
		\if@height 
			\if@width
			\else
				\compute@wfromh
			\fi
		\else 
			\if@width
				\compute@hfromw
			\else
				\edef\@p@sheight{\@bbh}
				\edef\@p@swidth{\@bbw}
			\fi
		\fi
}
\def\compute@resv{
		\if@rheight \else \edef\@p@srheight{\@p@sheight} \fi
		\if@rwidth \else \edef\@p@srwidth{\@p@swidth} \fi
		%\ps@typeout{rheight = \@p@srheight, rwidth = \@p@srwidth}
}
%		
% Compute any missing values
\def\compute@sizes{
	\compute@bb
	\if@scalefirst\if@angle
% at this point the bounding box has been adjsuted correctly for
% rotation.  PSFIG does all of its scaling using \@bbh and \@bbw.  If
% a width= or height= was specified along with \psscalefirst, then the
% width=/height= value needs to be adjusted to match the new (rotated)
% bounding box size (specifed in \@bbw and \@bbh).
%    \ps@bbw       width=
%    -------  =  ---------- 
%    \@bbw       new width=
% so `new width=' = (width= * \@bbw) / \ps@bbw; where \ps@bbw is the
% width of the original (unrotated) bounding box.
	\if@width
	   \in@hundreds{\@p@swidth}{\@bbw}{\ps@bbw}
	   \edef\@p@swidth{\@result}
	\fi
	\if@height
	   \in@hundreds{\@p@sheight}{\@bbh}{\ps@bbh}
	   \edef\@p@sheight{\@result}
	\fi
	\fi\fi
	\compute@handw
	\compute@resv}

%
% \psfig
% usage : \psfig{file=, height=, width=, bbllx=, bblly=, bburx=, bbury=,
%			rheight=, rwidth=, clip=}
%
% "clip=" is a switch and takes no value, but the `=' must be present.
\def\psfig#1{\vbox {
	% do a zero width hard space so that a single
	% \psfig in a centering enviornment will behave nicely
	%{\setbox0=\hbox{\ }\ \hskip-\wd0}
	%
	\ps@init@parms
	\parse@ps@parms{#1}
	\compute@sizes
	%
	\ifnum\@p@scost<\@psdraft{
		%
		\special{ps::[begin] 	\@p@swidth \space \@p@sheight \space
				\@p@sbbllx \space \@p@sbblly \space
				\@p@sbburx \space \@p@sbbury \space
				startTexFig \space }
		\if@angle
			\special {ps:: \@p@sangle \space rotate \space} 
		\fi
		\if@clip{
			\if@verbose{
				\ps@typeout{(clip)}
			}\fi
			\special{ps:: doclip \space }
		}\fi
		\if@prologfile
		    \special{ps: plotfile \@prologfileval \space } \fi
		\if@decmpr{
			\if@verbose{
				\ps@typeout{psfig: including \@p@sfile.Z \space }
			}\fi
			\special{ps: plotfile "`zcat \@p@sfile.Z" \space }
		}\else{
			\if@verbose{
				\ps@typeout{psfig: including \@p@sfile \space }
			}\fi
			\special{ps: plotfile \@p@sfile \space }
		}\fi
		\if@postlogfile
		    \special{ps: plotfile \@postlogfileval \space } \fi
		\special{ps::[end] endTexFig \space }
		% Create the vbox to reserve the space for the figure.
		\vbox to \@p@srheight sp{
		% 1/92 TJD Changed from "true sp" to "sp" for magnification.
			\hbox to \@p@srwidth sp{
				\hss
			}
		\vss
		}
	}\else{
		% draft figure, just reserve the space and print the
		% path name.
		\if@draftbox{		
			% Verbose draft: print file name in box
			\hbox{\frame{\vbox to \@p@srheight sp{
			\vss
			\hbox to \@p@srwidth sp{ \hss \@p@sfile \hss }
			\vss
			}}}
		}\else{
			% Non-verbose draft
			\vbox to \@p@srheight sp{
			\vss
			\hbox to \@p@srwidth sp{\hss}
			\vss
			}
		}\fi	



	}\fi
}}
\psfigRestoreAt
\let\@=\LaTeXAtSign




astro-ph0002027.extracted_bib
\bibitem=\bib@item
}

\def\bib@item{%
  \par\parindent=1.5em\Hang{1.5em}{1}%
  \everypar={\Hang{1.5em}{1}\ignorespaces}%
  \noindent\ignorespaces
}

\def\endrefs{\par\egroup\@doendpe}


% Page heads

\newtoks\CatchLine

\def\@journal{Mon.\ Not.\ R.\ Astron.\ Soc.\ }  % The journal title string
\def\@pubyear{1994}        % Assign a default publication year
\def\@pagerange{000--000}  % Assign a default page-range
\def\@volume{000}          % Assign a default volume number
\def\@microfiche{}         %

\def\pubyear#1{\gdef\@pubyear{#1}\@makecatchline}
\def\pagerange#1{\gdef\@pagerange{#1}\@makecatchline}
\def\volume#1{\gdef\@volume{#1}\@makecatchline}
\def\microfiche#1{\gdef\@microfiche{and Microfiche\ #1}\@makecatchline}

\def\@makecatchline{%
  \global\CatchLine{%
    {\rm \@journal {\bf \@volume},\ \@pagerange\ (\@pubyear)\ \@microfiche}}%
}

\@makecatchline % Assign a catchline, using the above defaults

\newtoks\LeftHeader
\def\shortauthor#1{% left page head
  \global\LeftHeader{#1}%
}

\newtoks\RightHeader
\def\shorttitle#1{% right page head
  \global\RightHeader{#1}%
}

\def\PageHead{% recto/verso running heads
  \begingroup
    \ifsp@page
      \csname ps@\sp@type\endcsname
    \fi
    \ifodd\pageno
      \let\the@head=\@oddhead
    \else
      \let\the@head=\@evenhead
    \fi
    \vbox to \z@{\vskip-22.5\p@%
      \hbox to \PageWidth{\vbox to8.5\p@{}%
        \the@head
      }%
    \vss}%
  \endgroup
  \nointerlineskip
}

\gdef\PageFoot{%
  \nointerlineskip%
  \begingroup
  \ifsp@page
    \csname ps@\sp@type\endcsname
    \global\sp@pagefalse
  \fi
  \vbox to 22pt{\vfil%
    \hbox to \PageWidth{%
      \eightpoint\strut\noindent
      \ifodd\pageno
        \@oddfoot
      \else
        \@evenfoot
      \fi
    }%
  }%
  \endgroup
}

\def\today{%
  \number\day\space
  \ifcase\month\or January\or February\or March\or April\or May\or June\or
    July\or August\or September\or October\or November\or December\fi
  \space\number\year%
}


\def\authorcomment#1{%
  \gdef\PageFoot{%
    \nointerlineskip%
    \vbox to 20pt{\vfil%
      \hbox to \PageWidth{\elevenpoint\noindent \hfil #1 \hfil}}%
  }%
}


% Plate pages

\newif\ifplate@page
\newbox\plt@box

\def\beginplatepage{%
  \let\plate=\plate@head
  \let\caption=\fig@caption
  \global\setbox\plt@box=\vbox\bgroup
  \TEMPDIMEN=\PageWidth % For \fig@caption test
  \hsize=\PageWidth\relax
}

\def\endplatepage{\par\egroup\global\plate@pagetrue}
\def\plate@head#1{\gdef\plt@cap{#1}}

% Letters option

\def\letters{%
  \gdef\folio{\ifnum\pageno<\z@ L\romannumeral-\pageno
    \else L\number\pageno \fi}%
}


% Math setup

% The standard math indentation
\newdimen\mathindent

\global\mathindent=\z@
\global\everydisplay{\global\@dspwd=\displaywidth\displaysetup}

% New versions of \displaylines, \eqalign, \eqalignno for
% when non-centered math is in use.

\def\@displaylines#1{% (for non-centered math)
  {}$\displ@y\hbox{\vbox{\halign{$\@lign\hfil\displaystyle##\hfil$\crcr
  #1\crcr}}}${}%
}

\def\@eqalign#1{\null\vcenter{\openup\jot\m@th% (for non-centered math)
  \ialign{\strut\hfil$\displaystyle{##}$&$\displaystyle{{}##}$\hfil
      \crcr#1\crcr}}%
}

\def\@eqalignno#1{% (for non-centered math)
  \global\advance\@dspwd by -\mathindent%
  {}$\displ@y\hbox{\vbox{\halign to\@dspwd%
  {\hfil$\@lign\displaystyle{##}$\tabskip\z@skip
  &$\@lign\displaystyle{{}##}$\hfil\tabskip\centering
  &\llap{$\@lign##$}\tabskip\z@skip\crcr
  #1\crcr}}}${}%
}

% When equations are flushleft ensure, that \displaylines,
% \eqalign, \eqalignno and \leqalignno point to the new versions of
% the macros. Also make \leqalignno act like \eqalignno, otherwise the
% equation text would `crash' into the equation number.

\global\let\displaylines=\@displaylines
\global\let\eqalign=\@eqalign
\global\let\eqalignno=\@eqalignno
\global\let\leqalignno=\@eqalignno

\newdimen\@dspwd   \@dspwd=\z@
\newif\if@eqno
\newif\if@leqno
\newtoks\@eqn
\newtoks\@eq

\def\displaysetup#1$${\displaytest#1\eqno\eqno\displaytest}

\def\displaytest#1\eqno#2\eqno#3\displaytest{%
 \if!#3!\ldisplaytest#1\leqno\leqno\ldisplaytest
 \else\@eqnotrue\@leqnofalse\@eqn={#2}\@eq={#1}\fi
 \generaldisplay$$}

\def\ldisplaytest#1\leqno#2\leqno#3\ldisplaytest{%
\@eq={#1}%
 \if!#3!\@eqnofalse\else\@eqnotrue\@leqnotrue
  \@eqn={#2}\fi}

\def\generaldisplay{%
  \if@eqno
    \if@leqno
      \hbox to \displaywidth{\noindent
        \rlap{$\displaystyle\the\@eqn$}%
        \hskip\mathindent$\displaystyle\the\@eq$\hfil}%
    \else
      \hbox to \displaywidth{\noindent
        \hskip\mathindent
        $\displaystyle\the\@eq$\hfil$\displaystyle\the\@eqn$}%
    \fi
  \else
    \hbox to \displaywidth{\noindent
      \hskip\mathindent$\displaystyle\the\@eq$\hfil}%
  \fi
}


% Finishing notice

\def\@notice{%
  \par\Two%
  \noindent{\b@ls{11pt}\ninerm This paper has been produced using the
    Royal Astronomical Society/Blackwell Science \TeX\ macros.\par}%
}

% redefine \bye to output our identification notice :
\outer\def\bye{\@notice\par\vfill\supereject\end}


% define a sign on :

\def\start@mess{%
  Monthly notices of the RAS journal style (\@typeface)\space
    v\@version,\space \@verdate.%
}

\everyjob{\Warn{\start@mess}}


% Two-column macros

%--------------------------------------------------------%
%                     INITIALISATION                     %
%--------------------------------------------------------%

\newif\if@debug \@debugfalse  %  when false, only warnings displayed

\def\Print#1{\if@debug\immediate\write16{#1}\else \fi}
\def\Warn#1{\immediate\write16{#1}}
\def\wlog#1{}

\newcount\Iteration % temporary loop counter

\def\Single{0} \def\Double{1}                 % ItemSPAN's
\def\Figure{0} \def\Table{1}                  % ItemTYPE's

\def\InStack{0}  % ItemSTATUS
\def\InZoneA{1}
\def\InZoneB{2}
\def\InZoneC{3}

\newcount\TEMPCOUNT % temporary count register
\newdimen\TEMPDIMEN % temporary dimen register
\newbox\TEMPBOX     % temporary box register
\newbox\VOIDBOX     % a box which is permenately void

\newcount\LengthOfStack % number of items currently in stack
\newcount\MaxItems      % maximum number of items allowed in stack
\newcount\StackPointer
\newcount\Point         % used in calculation for generating the
                        % physical address of an item in the stack.
\newcount\NextFigure    % number of next figure to be output
\newcount\NextTable     % number of next table to be output
\newcount\NextItem      % Next item to consider by order in stack

\newcount\StatusStack   % set to point to top of STATUS stack
\newcount\NumStack      % set to point to top of NUMBER stack
\newcount\TypeStack     % set to point to top of TYPE stack
\newcount\SpanStack     % set to point to top of SPAN stack
\newcount\BoxStack      % set to point to top of BOX stack

\newcount\ItemSTATUS    % status of present item
\newcount\ItemNUMBER    % number of present item
\newcount\ItemTYPE      % type of present item
\newcount\ItemSPAN      % span of present item
\newbox\ItemBOX         % box of present item
\newdimen\ItemSIZE      % size of present item
                        % (calculated by GetItemBOX)

\newdimen\PageHeight    % vertical measure of full page
\newdimen\TextLeading   % distance between baselines of body text
\newdimen\Feathering    % amount of interline stretch
\newcount\LinesPerPage  % height of page in text lines
\newdimen\ColumnWidth   % width of 1 column of text
\newdimen\ColumnGap     % size of gap between columns
\newdimen\PageWidth     % = \ColumnWidth * 2 + \ColumnGap
\newdimen\BodgeHeight   % Bodge to align figures and tables with text
\newcount\Leading       % Set to same as \TextLeading above

\newdimen\ZoneBSize  % size of items in ZoneB
\newdimen\TextSize   % size of text in ZoneB
\newbox\ZoneABOX     % contains Zone A material
\newbox\ZoneBBOX     % contains Zone B material
\newbox\ZoneCBOX     % contains Zone C material

\newif\ifFirstSingleItem
\newif\ifFirstZoneA
\newif\ifMakePageInComplete
\newif\ifMoreFigures \MoreFiguresfalse % set true in join stack
\newif\ifMoreTables  \MoreTablesfalse  % set true in join stack

\newif\ifFigInZoneB % used to determine in which zone an item
\newif\ifFigInZoneC % will be placed based on what is in other
\newif\ifTabInZoneB % zones already for a given page.
\newif\ifTabInZoneC

\newif\ifZoneAFullPage

\newbox\MidBOX    % = LeftBOX+gap+RightBOX
\newbox\LeftBOX
\newbox\RightBOX
\newbox\PageBOX   % complete made-up page

\newif\ifLeftCOL  % flags first pass through output routine
\LeftCOLtrue

\newdimen\ZoneBAdjust

\newcount\ItemFits
\def\Yes{1}
\def\No{2}

\def\LineAdjust#1{\global\ZoneBAdjust=#1\TextLeading\relax}


% Setup file.

\MaxItems=15
\NextFigure=\z@        % used for article opening
\NextTable=\@ne

\BodgeHeight=6pt
\TextLeading=11pt    % baselineskip of body text
\Leading=11
\Feathering=\z@      % amount of interline stretch
\LinesPerPage=61     % number of text lines per full page -1
\topskip=\TextLeading
\ColumnWidth=20pc    % width of text columns
\ColumnGap=2pc       % gap between columns

\newskip\ItemSepamount  % space between floats
\ItemSepamount=\TextLeading plus \TextLeading minus 4pt

\parskip=\z@ plus .1pt
\parindent=18pt
\widowpenalty=\z@
\clubpenalty=10000
\tolerance=1500
\hbadness=1500
\abovedisplayskip=6pt plus 2pt minus 1pt
\belowdisplayskip=6pt plus 2pt minus 1pt
\abovedisplayshortskip=6pt plus 2pt minus 1pt
\belowdisplayshortskip=6pt plus 2pt minus 1pt

\frenchspacing

\ninepoint % start main text size

\PageHeight=682pt
\PageWidth=2\ColumnWidth
\advance\PageWidth by \ColumnGap

\pagestyle{headings}


%--------------------------------------------------------%
%                         STACKS                         %
%--------------------------------------------------------%

% THE ITEM STACK
% The item stack contains contains figures and tables
% in the order in which they appear in the article source
% code.

% allocate stack space

\newcount\DUMMY \StatusStack=\allocationnumber
\newcount\DUMMY \newcount\DUMMY \newcount\DUMMY 
\newcount\DUMMY \newcount\DUMMY \newcount\DUMMY 
\newcount\DUMMY \newcount\DUMMY \newcount\DUMMY
\newcount\DUMMY \newcount\DUMMY \newcount\DUMMY 
\newcount\DUMMY \newcount\DUMMY \newcount\DUMMY

\newcount\DUMMY \NumStack=\allocationnumber
\newcount\DUMMY \newcount\DUMMY \newcount\DUMMY 
\newcount\DUMMY \newcount\DUMMY \newcount\DUMMY 
\newcount\DUMMY \newcount\DUMMY \newcount\DUMMY 
\newcount\DUMMY \newcount\DUMMY \newcount\DUMMY 
\newcount\DUMMY \newcount\DUMMY \newcount\DUMMY

\newcount\DUMMY \TypeStack=\allocationnumber
\newcount\DUMMY \newcount\DUMMY \newcount\DUMMY 
\newcount\DUMMY \newcount\DUMMY \newcount\DUMMY 
\newcount\DUMMY \newcount\DUMMY \newcount\DUMMY 
\newcount\DUMMY \newcount\DUMMY \newcount\DUMMY 
\newcount\DUMMY \newcount\DUMMY \newcount\DUMMY

\newcount\DUMMY \SpanStack=\allocationnumber
\newcount\DUMMY \newcount\DUMMY \newcount\DUMMY 
\newcount\DUMMY \newcount\DUMMY \newcount\DUMMY 
\newcount\DUMMY \newcount\DUMMY \newcount\DUMMY 
\newcount\DUMMY \newcount\DUMMY \newcount\DUMMY 
\newcount\DUMMY \newcount\DUMMY \newcount\DUMMY

\newbox\DUMMY   \BoxStack=\allocationnumber
\newbox\DUMMY   \newbox\DUMMY \newbox\DUMMY 
\newbox\DUMMY   \newbox\DUMMY \newbox\DUMMY 
\newbox\DUMMY   \newbox\DUMMY \newbox\DUMMY 
\newbox\DUMMY   \newbox\DUMMY \newbox\DUMMY 
\newbox\DUMMY   \newbox\DUMMY \newbox\DUMMY

\def\wlog{\immediate\write\m@ne}

% \GetItemSTATUS, \GetItemNUMBER, \GetItemTYPE, \GetItemSPAN,
% \GetItemBox 
% are used to get details of a particular item from the item
% stack. The argument to each of these is the items position
% in the stack (usually \StackPointer)...not the items number.

\def\GetItemAll#1{%
 \GetItemSTATUS{#1}
 \GetItemNUMBER{#1}
 \GetItemTYPE{#1}
 \GetItemSPAN{#1}
 \GetItemBOX{#1}
}

% Note: \LeaveStack uses this routine. Do not destroy \Point
\def\GetItemSTATUS#1{%
 \Point=\StatusStack
 \advance\Point by #1
 \global\ItemSTATUS=\count\Point
}

% Note: \LeaveStack uses this routine. Do not destroy \Point
\def\GetItemNUMBER#1{%
 \Point=\NumStack
 \advance\Point by #1
 \global\ItemNUMBER=\count\Point
}

% Note: \LeaveStack uses this routine. Do not destroy \Point
\def\GetItemTYPE#1{%
 \Point=\TypeStack
 \advance\Point by #1
 \global\ItemTYPE=\count\Point
}

% Note: \LeaveStack uses this routine. Do not destroy \Point
\def\GetItemSPAN#1{%
 \Point\SpanStack
 \advance\Point by #1
 \global\ItemSPAN=\count\Point
}

% Note: \LeaveStack uses this routine. Do not destroy \Point
\def\GetItemBOX#1{%
 \Point=\BoxStack
 \advance\Point by #1
 \global\setbox\ItemBOX=\vbox{\copy\Point}
 \global\ItemSIZE=\ht\ItemBOX
 \global\advance\ItemSIZE by \dp\ItemBOX
 \TEMPCOUNT=\ItemSIZE
 \divide\TEMPCOUNT by \Leading
 \divide\TEMPCOUNT by 65536
 \advance\TEMPCOUNT \@ne
 \ItemSIZE=\TEMPCOUNT pt
 \global\multiply\ItemSIZE by \Leading
}

% item joins stack

\def\JoinStack{%
 \ifnum\LengthOfStack=\MaxItems % stack is full of items
  \Warn{WARNING: Stack is full...some items will be lost!}
 \else
  \Point=\StatusStack
  \advance\Point by \LengthOfStack
  \global\count\Point=\ItemSTATUS
  \Point=\NumStack
  \advance\Point by \LengthOfStack
  \global\count\Point=\ItemNUMBER
  \Point=\TypeStack
  \advance\Point by \LengthOfStack
  \global\count\Point=\ItemTYPE
  \Point\SpanStack
  \advance\Point by \LengthOfStack
  \global\count\Point=\ItemSPAN
  \Point=\BoxStack
  \advance\Point by \LengthOfStack
  \global\setbox\Point=\vbox{\copy\ItemBOX}
  \global\advance\LengthOfStack \@ne
  \ifnum\ItemTYPE=\Figure % used in \MakePage
   \global\MoreFigurestrue
  \else
   \global\MoreTablestrue
  \fi
 \fi
}

% item leaves stack
% #1=physical position of the item to be removed

\def\LeaveStack#1{%
 {\Iteration=#1
 \loop
 \ifnum\Iteration<\LengthOfStack
  \advance\Iteration \@ne
  \GetItemSTATUS{\Iteration}
   \advance\Point by \m@ne
   \global\count\Point=\ItemSTATUS
  \GetItemNUMBER{\Iteration}
   \advance\Point by \m@ne
   \global\count\Point=\ItemNUMBER
  \GetItemTYPE{\Iteration}
   \advance\Point by \m@ne
   \global\count\Point=\ItemTYPE
  \GetItemSPAN{\Iteration}
   \advance\Point by \m@ne
   \global\count\Point=\ItemSPAN
  \GetItemBOX{\Iteration}
   \advance\Point by \m@ne
   \global\setbox\Point=\vbox{\copy\ItemBOX}
 \repeat}
 \global\advance\LengthOfStack by \m@ne
}

% clean stack
% This routine scans through the stack and removes anything
% that does not have STATUS=\InStack.

\newif\ifStackNotClean

\def\CleanStack{%
 \StackNotCleantrue
 {\Iteration=\z@
  \loop
   \ifStackNotClean
    \GetItemSTATUS{\Iteration}
    \ifnum\ItemSTATUS=\InStack
     \advance\Iteration \@ne
     \else
      \LeaveStack{\Iteration}
    \fi
   \ifnum\LengthOfStack<\Iteration
    \StackNotCleanfalse
   \fi
 \repeat}
}

% Find item.
% This macro searches from the top to the bottom of the
% stack for an item of a specified type and number.
% #1=type, #2=number
% If the specified item is found, then \StackPointer is set
% to point to it, else \StackPointer=-1.
% This routine is used to find the next figure or table
% by number.

\def\FindItem#1#2{%
 \global\StackPointer=\m@ne % assume item isn't in stack for now
 {\Iteration=\z@
  \loop
  \ifnum\Iteration<\LengthOfStack
   \GetItemSTATUS{\Iteration}
   \ifnum\ItemSTATUS=\InStack
    \GetItemTYPE{\Iteration}
    \ifnum\ItemTYPE=#1
     \GetItemNUMBER{\Iteration}
     \ifnum\ItemNUMBER=#2
      \global\StackPointer=\Iteration
      \Iteration=\LengthOfStack % terminate loop
     \fi
    \fi
   \fi
  \advance\Iteration \@ne
 \repeat}
}

% Find next type
% This macro searches from the top to the bottom of the stack
% looking for the first item which has STATUS=\InStack.
% If it is a figure then a figure is what will be considered
% next by \MakePage else table.

\def\FindNext{%
 \global\StackPointer=\m@ne % assume stack is empty for now
 {\Iteration=\z@
  \loop
  \ifnum\Iteration<\LengthOfStack
   \GetItemSTATUS{\Iteration}
   \ifnum\ItemSTATUS=\InStack
    \GetItemTYPE{\Iteration}
   \ifnum\ItemTYPE=\Figure
    \ifMoreFigures
      \global\NextItem=\Figure
      \global\StackPointer=\Iteration
      \Iteration=\LengthOfStack % terminate loop
    \fi
   \fi
   \ifnum\ItemTYPE=\Table
    \ifMoreTables
      \global\NextItem=\Table
      \global\StackPointer=\Iteration
      \Iteration=\LengthOfStack % terminate loop
    \fi
   \fi
  \fi
  \advance\Iteration \@ne
 \repeat}
}

% Change status
% Macro to change the status of a specified item in stack.
% #1=item, #2=new status

\def\ChangeStatus#1#2{%
 \Point=\StatusStack
 \advance\Point by #1
 \global\count\Point=#2
}


%--------------------------------------------------------%
%                       MAKEPAGE                         %
%--------------------------------------------------------%

% This macro is called at the start of every new page
% including the first. It scans through the stack picking
% out items which should be placed on this page. It then
% leaves space for the items to be placed later. The routine
% terminates when either there is no room on the page to
% fit the next figure or table, or there are no more items
% in the stack.

\def\Zone{\InZoneA}

\ZoneBAdjust=\z@

\def\MakePage{% allocate space on this page for stack items
 \global\ZoneBSize=\PageHeight
 \global\TextSize=\ZoneBSize
 \global\ZoneAFullPagefalse
 \global\topskip=\TextLeading
 \MakePageInCompletetrue
 \MoreFigurestrue
 \MoreTablestrue
 \FigInZoneBfalse
 \FigInZoneCfalse
 \TabInZoneBfalse
 \TabInZoneCfalse
 \global\FirstSingleItemtrue
 \global\FirstZoneAtrue
 \global\setbox\ZoneABOX=\box\VOIDBOX
 \global\setbox\ZoneBBOX=\box\VOIDBOX
 \global\setbox\ZoneCBOX=\box\VOIDBOX
 \loop
  \ifMakePageInComplete
 \FindNext
 \ifnum\StackPointer=\m@ne
  \NextItem=\m@ne
  \MoreFiguresfalse
  \MoreTablesfalse
 \fi
 \ifnum\NextItem=\Figure
   \FindItem{\Figure}{\NextFigure}
   \ifnum\StackPointer=\m@ne \global\MoreFiguresfalse
   \else
    \GetItemSPAN{\StackPointer}
    \ifnum\ItemSPAN=\Single \def\Zone{\InZoneB}\relax
     \ifFigInZoneC \global\MoreFiguresfalse\fi
    \else
     \def\Zone{\InZoneA}
     \ifFigInZoneB \def\Zone{\InZoneC}\fi
    \fi
   \fi
   \ifMoreFigures\Print{}\FigureItems\fi
 \fi
\ifnum\NextItem=\Table
   \FindItem{\Table}{\NextTable}
   \ifnum\StackPointer=\m@ne \global\MoreTablesfalse
   \else
    \GetItemSPAN{\StackPointer}
    \ifnum\ItemSPAN=\Single\relax
     \ifTabInZoneC \global\MoreTablesfalse\fi
    \else
     \def\Zone{\InZoneA}
     \ifTabInZoneB \def\Zone{\InZoneC}\fi
    \fi
   \fi
   \ifMoreTables\Print{}\TableItems\fi
 \fi
   \MakePageInCompletefalse % assume page is complete
   \ifMoreFigures\MakePageInCompletetrue\fi
   \ifMoreTables\MakePageInCompletetrue\fi
 \repeat
%\Print{TextSize=\the\TextSize}
%\Print{ZoneBSize=\the\ZoneBSize}
 \ifZoneAFullPage
  \global\TextSize=\z@
  \global\ZoneBSize=\z@
  \global\vsize=\z@\relax
  \global\topskip=\z@\relax
  \vbox to \z@{\vss}
  \eject
 \else
 \global\advance\ZoneBSize by -\ZoneBAdjust
 \global\vsize=\ZoneBSize
 \global\hsize=\ColumnWidth
 \global\ZoneBAdjust=\z@
 \ifdim\TextSize<23pt
 \Warn{}
 \Warn{* Making column fall short: TextSize=\the\TextSize *}
 \vskip-\lastskip\eject\fi
 \fi
}

\def\MakeRightCol{% allocate space for the right column of text
 \global\TextSize=\ZoneBSize
 \MakePageInCompletetrue
 \MoreFigurestrue
 \MoreTablestrue
 \global\FirstSingleItemtrue
 \global\setbox\ZoneBBOX=\box\VOIDBOX
 \def\Zone{\InZoneB}
 \loop
  \ifMakePageInComplete
 \FindNext
 \ifnum\StackPointer=\m@ne
  \NextItem=\m@ne
  \MoreFiguresfalse
  \MoreTablesfalse
 \fi
 \ifnum\NextItem=\Figure
   \FindItem{\Figure}{\NextFigure}
   \ifnum\StackPointer=\m@ne \MoreFiguresfalse
   \else
    \GetItemSPAN{\StackPointer}
    \ifnum\ItemSPAN=\Double\relax
     \MoreFiguresfalse\fi
   \fi
   \ifMoreFigures\Print{}\FigureItems\fi
 \fi
 \ifnum\NextItem=\Table
   \FindItem{\Table}{\NextTable}
   \ifnum\StackPointer=\m@ne \MoreTablesfalse
   \else
    \GetItemSPAN{\StackPointer}
    \ifnum\ItemSPAN=\Double\relax
     \MoreTablesfalse\fi
   \fi
   \ifMoreTables\Print{}\TableItems\fi
 \fi
   \MakePageInCompletefalse % assume page is complete
   \ifMoreFigures\MakePageInCompletetrue\fi
   \ifMoreTables\MakePageInCompletetrue\fi
 \repeat
 \ifZoneAFullPage
  \global\TextSize=\z@
  \global\ZoneBSize=\z@
  \global\vsize=\z@\relax
  \global\topskip=\z@\relax
  \vbox to \z@{\vss}
  \eject
 \else
 \global\vsize=\ZoneBSize
 \global\hsize=\ColumnWidth
 \ifdim\TextSize<23pt
 \Warn{}
 \Warn{* Making column fall short: TextSize=\the\TextSize *}
 \vskip-\lastskip\eject\fi
\fi
}

\def\FigureItems{% Stack pointer points to next figure
 \Print{Considering...}
 \ShowItem{\StackPointer}
 \GetItemBOX{\StackPointer} % auto calculates ItemSIZE
 \GetItemSPAN{\StackPointer}
  \CheckFitInZone % check to see if item fits
  \ifnum\ItemFits=\Yes
   \ifnum\ItemSPAN=\Single
     \ChangeStatus{\StackPointer}{\InZoneB} % flag to be output
     \global\FigInZoneBtrue
     \ifFirstSingleItem
      \hbox{}\vskip-\BodgeHeight
     \global\advance\ItemSIZE by \TextLeading
     \fi
     \unvbox\ItemBOX\ItemSep
     \global\FirstSingleItemfalse
     \global\advance\TextSize by -\ItemSIZE% allocate space
     \global\advance\TextSize by -\TextLeading
   \else
    \ifFirstZoneA
     \global\advance\ItemSIZE by \TextLeading
     \global\FirstZoneAfalse\fi
    \global\advance\TextSize by -\ItemSIZE
    \global\advance\TextSize by -\TextLeading
    \global\advance\ZoneBSize by -\ItemSIZE
    \global\advance\ZoneBSize by -\TextLeading
    \ifFigInZoneB\relax
     \else
     \ifdim\TextSize<3\TextLeading
     \global\ZoneAFullPagetrue
     \fi
    \fi
    \ChangeStatus{\StackPointer}{\Zone}
    \ifnum\Zone=\InZoneC \global\FigInZoneCtrue\fi
  \fi
   \Print{TextSize=\the\TextSize}
   \Print{ZoneBSize=\the\ZoneBSize}
  \global\advance\NextFigure \@ne
   \Print{This figure has been placed.}
  \else
   \Print{No space available for this figure...holding over.}
   \Print{}
   \global\MoreFiguresfalse
  \fi
}

\def\TableItems{% Stack pointer points to next table
 \Print{Considering...}
 \ShowItem{\StackPointer}
 \GetItemBOX{\StackPointer} % auto calculates ItemSIZE
 \GetItemSPAN{\StackPointer}
  \CheckFitInZone % check to see of item fits in Zone
  \ifnum\ItemFits=\Yes
   \ifnum\ItemSPAN=\Single
    \ChangeStatus{\StackPointer}{\InZoneB}
     \global\TabInZoneBtrue
     \ifFirstSingleItem
      \hbox{}\vskip-\BodgeHeight
     \global\advance\ItemSIZE by \TextLeading
     \fi
     \unvbox\ItemBOX\ItemSep
     \global\FirstSingleItemfalse
     \global\advance\TextSize by -\ItemSIZE
     \global\advance\TextSize by -\TextLeading
   \else
    \ifFirstZoneA
    \global\advance\ItemSIZE by \TextLeading
    \global\FirstZoneAfalse\fi
    \global\advance\TextSize by -\ItemSIZE
    \global\advance\TextSize by -\TextLeading
    \global\advance\ZoneBSize by -\ItemSIZE
    \global\advance\ZoneBSize by -\TextLeading
    \ifFigInZoneB\relax
     \else
     \ifdim\TextSize<3\TextLeading
     \global\ZoneAFullPagetrue
     \fi
    \fi
    \ChangeStatus{\StackPointer}{\Zone}
    \ifnum\Zone=\InZoneC \global\TabInZoneCtrue\fi
   \fi
%   \Print{TextSize=\the\TextSize}
%   \Print{ZoneBSize=\the\ZoneBSize}
  \global\advance\NextTable \@ne
   \Print{This table has been placed.}
  \else
  \Print{No space available for this table...holding over.}
   \Print{}
   \global\MoreTablesfalse
  \fi
}

% These macros check to see if an item of ItemSIZE will
% fit in a particular zone. If it will, then ItemFits
% will be set true else false.

\def\CheckFitInZone{%
{\advance\TextSize by -\ItemSIZE
 \advance\TextSize by -\TextLeading
 \ifFirstSingleItem
  \advance\TextSize by \TextLeading
 \fi
 \ifnum\Zone=\InZoneA\relax
  \else \advance\TextSize by -\ZoneBAdjust
 \fi
 \ifdim\TextSize<3\TextLeading \global\ItemFits=\No
 \else \global\ItemFits=\Yes\fi}
}

\def\BeginOpening{%
  % start 9pt a.s.a.p. so that \New.. commands get a chance to init.
  \ninepoint
  \thispagestyle{titlepage}%
  \global\setbox\ItemBOX=\vbox\bgroup%
    \hsize=\PageWidth%
    \hrule height \z@
    \ifsinglecol\vskip 6pt\fi % Bodge, to get same pos. as two-column!
}

\let\begintopmatter=\BeginOpening  %  alias for \BeginOpening

\def\EndOpening{%
  \One%  1 line fixed space below opening
  \egroup
  \ifsinglecol
    \box\ItemBOX%
    \vskip\TextLeading plus 2\TextLeading% var. space: min 1, max 3 lines
    \@noafterindent
  \else
    \ItemNUMBER=\z@%
    \ItemTYPE=\Figure
    \ItemSPAN=\Double
    \ItemSTATUS=\InStack
    \JoinStack
  \fi
}


% Figures

\newif\if@here  \@herefalse

\def\no@float{\global\@heretrue}
\let\nofloat=\relax % only enabled for one column

\def\beginfigure{%
  \@ifstar{\global\@dfloattrue \@bfigure}{\global\@dfloatfalse \@bfigure}%
}

\def\@bfigure#1{%
  \par
  \if@dfloat
    \ItemSPAN=\Double
    \TEMPDIMEN=\PageWidth
  \else
    \ItemSPAN=\Single
    \TEMPDIMEN=\ColumnWidth
  \fi
  \ifsinglecol
    \TEMPDIMEN=\PageWidth
  \else
    \ItemSTATUS=\InStack
    \ItemNUMBER=#1%
    \ItemTYPE=\Figure
  \fi
  \bgroup
    \hsize=\TEMPDIMEN
    \global\setbox\ItemBOX=\vbox\bgroup
      \eightpoint\nostb@ls{10pt}%
      \let\caption=\fig@caption
      \ifsinglecol \let\nofloat=\no@float\fi
}

\def\fig@caption#1{%
  \vskip 5.5pt plus 6pt%
  \bgroup % grouping and size change needed for plate pages
    \eightpoint\nostb@ls{10pt}%
    \setbox\TEMPBOX=\hbox{#1}%
    \ifdim\wd\TEMPBOX>\TEMPDIMEN
      \noindent \unhbox\TEMPBOX\par
    \else
      \hbox to \hsize{\hfil\unhbox\TEMPBOX\hfil}%
    \fi
  \egroup
}

\def\endfigure{%
  \par\egroup % end \vbox
  \egroup
  \ifsinglecol
    \if@here \midinsert\global\@herefalse\else \topinsert\fi
      \unvbox\ItemBOX
    \endinsert
  \else
    \JoinStack
    \Print{Processing source for figure \the\ItemNUMBER}%
  \fi
}


% Tables

\newbox\tab@cap@box
\def\tab@caption#1{\global\setbox\tab@cap@box=\hbox{#1\par}}

\newtoks\tab@txt@toks
\long\def\tab@txt#1{\global\tab@txt@toks={#1}\global\table@txttrue}

\newif\iftable@txt  \table@txtfalse
\newif\if@dfloat    \@dfloatfalse

\def\begintable{%
  \@ifstar{\global\@dfloattrue \@btable}{\global\@dfloatfalse \@btable}%
}

\def\@btable#1{%
  \par
  \if@dfloat
    \ItemSPAN=\Double
    \TEMPDIMEN=\PageWidth
  \else
    \ItemSPAN=\Single
    \TEMPDIMEN=\ColumnWidth
  \fi
  \ifsinglecol
    \TEMPDIMEN=\PageWidth
  \else
    \ItemSTATUS=\InStack
    \ItemNUMBER=#1%
    \ItemTYPE=\Table
  \fi
  \bgroup
    \eightpoint\nostb@ls{10pt}%
    \global\setbox\ItemBOX=\vbox\bgroup
      \let\caption=\tab@caption
      \let\tabletext=\tab@txt
      \ifsinglecol \let\nofloat=\no@float\fi
}

\def\endtable{%
  \par\egroup % end \vbox
  \egroup
  \setbox\TEMPBOX=\hbox to \TEMPDIMEN{%
    \eightpoint\nostb@ls{10pt}%
    \hss
    \vbox{%
      \hsize=\wd\ItemBOX
      \ifvoid\tab@cap@box
      \else
        \noindent\unhbox\tab@cap@box
        \vskip 5.5pt plus 6pt%
      \fi
      \box\ItemBOX
      \iftable@txt
        \vskip 10pt%
        \noindent\the\tab@txt@toks
        \global\table@txtfalse
      \fi
    }%
    \hss
  }%
  \ifsinglecol
    \if@here \midinsert\global\@herefalse\else \topinsert\fi
      \box\TEMPBOX
    \endinsert
  \else
    \global\setbox\ItemBOX=\box\TEMPBOX
    \JoinStack
    \Print{Processing source for table \the\ItemNUMBER}%
  \fi
}


\def\UnloadZoneA{%
\FirstZoneAtrue
 \Iteration=\z@
  \loop
   \ifnum\Iteration<\LengthOfStack
    \GetItemSTATUS{\Iteration}
    \ifnum\ItemSTATUS=\InZoneA
     \GetItemBOX{\Iteration}
     \ifFirstZoneA \vbox to \BodgeHeight{\vfil}%
     \FirstZoneAfalse\fi
     \unvbox\ItemBOX\ItemSep
     \LeaveStack{\Iteration}
     \else
     \advance\Iteration \@ne
   \fi
 \repeat
}

\def\UnloadZoneC{%
\Iteration=\z@
  \loop
   \ifnum\Iteration<\LengthOfStack
    \GetItemSTATUS{\Iteration}
    \ifnum\ItemSTATUS=\InZoneC
     \GetItemBOX{\Iteration}
     \ItemSep\unvbox\ItemBOX
     \LeaveStack{\Iteration}
     \else
     \advance\Iteration \@ne
   \fi
 \repeat
}


%--------------------------------------------------------%
%                         DIAGNOSTICS                    %
%--------------------------------------------------------%

\def\ShowItem#1{% Show details of on item entry in stack
  {\GetItemAll{#1}
  \Print{\the#1:
  {TYPE=\ifnum\ItemTYPE=\Figure Figure\else Table\fi}
  {NUMBER=\the\ItemNUMBER}
  {SPAN=\ifnum\ItemSPAN=\Single Single\else Double\fi}
  {SIZE=\the\ItemSIZE}}}
}

\def\ShowStack{% 
 \Print{}
 \Print{LengthOfStack = \the\LengthOfStack}
 \ifnum\LengthOfStack=\z@ \Print{Stack is empty}\fi
 \Iteration=\z@
 \loop
 \ifnum\Iteration<\LengthOfStack
  \ShowItem{\Iteration}
  \advance\Iteration \@ne
 \repeat
}

\def\B#1#2{%
\hbox{\vrule\kern-0.4pt\vbox to #2{%
\hrule width #1\vfill\hrule}\kern-0.4pt\vrule}
}


%-------------------------------------------------------%
%             SINGLE COLUMN OUTPUT ROUTINE              %
%-------------------------------------------------------%

\newif\ifsinglecol   \singlecolfalse

\def\onecolumn{%
  \global\output={\singlecoloutput}%
  \global\hsize=\PageWidth
  \global\vsize=\PageHeight
  \global\ColumnWidth=\hsize
  \global\TextLeading=12pt
  \global\Leading=12
  \global\singlecoltrue
  \global\let\onecolumn=\relax%         stop them using \onecolumn again
  \global\let\footnote=\sing@footnote%  enable footnotes
  \global\let\vfootnote=\sing@vfootnote
  \ninepoint % reset \baselineskip after leading change
  \message{(Single column)}%
}

\def\singlecoloutput{%
  \shipout\vbox{\PageHead\vbox to \PageHeight{\pagebody\vss}\PageFoot}%
  \advancepageno
%
  \ifplate@page
    \shipout\vbox{%
      \sp@pagetrue
      \def\sp@type{plate}%
      \global\plate@pagefalse
      \PageHead\vbox to \PageHeight{\unvbox\plt@box\vfil}\PageFoot%
    }%
    \message{[plate]}%
    \advancepageno
  \fi
%
  \ifnum\outputpenalty>-\@MM \else\dosupereject\fi%
}

\def\ItemSep{\vskip\ItemSepamount\relax}

\def\ItemSepbreak{\par\ifdim\lastskip<\ItemSepamount
  \removelastskip\penalty-200\ItemSep\fi%
}

% Modify plain's \endinsert so that the mn's spacing is used

\let\@@endinsert=\endinsert % save plain's original \endinsert

\def\endinsert{\egroup % finish the \vbox
  \if@mid \dimen@\ht\z@ \advance\dimen@\dp\z@ \advance\dimen@12\p@
    \advance\dimen@\pagetotal \advance\dimen@-\pageshrink
    \ifdim\dimen@>\pagegoal\@midfalse\p@gefalse\fi\fi
  \if@mid \ItemSep\box\z@\ItemSepbreak
  \else\insert\topins{\penalty100 % floating insertion
    \splittopskip\z@skip
    \splitmaxdepth\maxdimen \floatingpenalty\z@
    \ifp@ge \dimen@\dp\z@
    \vbox to\vsize{\unvbox\z@\kern-\dimen@}% depth is zero
    \else \box\z@\nobreak\ItemSep\fi}\fi\endgroup%
}


% Footnotes (only enabled in single column)

\def\gobbleone#1{}
\def\gobbletwo#1#2{}
\let\footnote=\gobbletwo % Gobble footnote's unless enabled by \onecolumn
\let\vfootnote=\gobbleone

\def\sing@footnote#1{\let\@sf\empty % parameter #2 (the text) is read later
  \ifhmode\edef\@sf{\spacefactor\the\spacefactor}\/\fi
  \hbox{$^{\hbox{\eightpoint #1}}$}\@sf\sing@vfootnote{#1}%
}

\def\sing@vfootnote#1{\insert\footins\bgroup\eightpoint\b@ls{9pt}%
  \interlinepenalty\interfootnotelinepenalty
  \splittopskip\ht\strutbox % top baseline for broken footnotes
  \splitmaxdepth\dp\strutbox \floatingpenalty\@MM
  \leftskip\z@skip \rightskip\z@skip \spaceskip\z@skip \xspaceskip\z@skip
  \noindent $^{\scriptstyle\hbox{#1}}$\hskip 4pt%
    \footstrut\futurelet\next\fo@t%
}

% Kill footnote rule
\def\footnoterule{\kern-3\p@ \hrule height \z@ \kern 3\p@}

\skip\footins=19.5pt plus 12pt minus 1pt
\count\footins=1000
\dimen\footins=\maxdimen

% for footnotes in double column: use \note{$\star$}{footnote}
\def\note#1#2{%
  \let\@sf=\empty \ifhmode\edef\@sf{\spacefactor\the\spacefactor}\/\fi
  #1\insert\footins\bgroup
    \eightpoint\b@ls{10pt}\rm
    \interlinepenalty\interfootnotelinepenalty
%    \splittopskip\ht\strutbox % top baseline for broken footnotes
    \splitmaxdepth\dp\strutbox \floatingpenalty\@MM
    \leftskip\z@skip \rightskip\z@skip \spaceskip\z@skip \xspaceskip\z@skip
    \noindent\footstrut #1$\,$#2\strut\par
  \egroup
  \@sf\relax}

% Landscape

\def\landscape{%
  \global\TEMPDIMEN=\PageWidth
  \global\PageWidth=\PageHeight
  \global\PageHeight=\TEMPDIMEN
  \global\let\landscape=\relax%         stop them using \landscape again.
  \onecolumn
  \message{(landscape)}%
  \raggedbottom
}


%-------------------------------------------------------%
%               TWO COLUMN OUTPUT ROUTINE               %
%-------------------------------------------------------%

% Very slight redefinition of the \output routine of mn.tex, to allow footnotes.
\output{%
  \ifLeftCOL
    \global\setbox\LeftBOX=\vbox to \ZoneBSize{\box255\unvbox\ZoneBBOX
      \ifvoid\footins\else
        \vskip\skip\footins\unvbox\footins\fi
    }%
    \global\LeftCOLfalse
    \MakeRightCol
  \else
    \setbox\RightBOX=\vbox to \ZoneBSize{\box255\unvbox\ZoneBBOX
      \ifvoid\footins\else
        \vskip\skip\footins\unvbox\footins\fi
    }%
    \setbox\MidBOX=\hbox{\box\LeftBOX\hskip\ColumnGap\box\RightBOX}%
    \setbox\PageBOX=\vbox to \PageHeight{%
      \UnloadZoneA\box\MidBOX\UnloadZoneC}%
    \shipout\vbox{\PageHead\vbox to \PageHeight{\box\PageBOX\vss}\PageFoot}%
    \advancepageno
%
    \ifplate@page
      \shipout\vbox{%
        \sp@pagetrue
        \def\sp@type{plate}%
        \global\plate@pagefalse
        \PageHead\vbox to \PageHeight{\unvbox\plt@box\vfil}\PageFoot%
      }%
      \message{[plate]}%
      \advancepageno
    \fi
%
    \global\LeftCOLtrue
    \CleanStack
    \MakePage
  \fi
}



% Startup message

\Warn{\start@mess}

\newif\ifCUPmtplainloaded % for use in documents
\ifprod@font
  \global\CUPmtplainloadedtrue
\fi

\def\mnmacrosloaded{} % so articles can see if a format file has been used.

\catcode `\@=12 % @ signs are non-letters

% \dump

% end of mn.tex


%
% overmerging paper
%
% Eelco van Kampen
%
% Institute for Astronomy, Edinburgh, 1998-1999
%

\ifx\mnmacrosloaded\undefined \input mn\fi

% author's definitions

\input psfig
\def\halve{{\scriptstyle 1 \over 2}}
\def\Mpc{$h_0^{-1}$Mpc}

\newif\ifAMStwofonts
%\AMStwofontstrue

\ifCUPmtplainloaded \else
  \NewTextAlphabet{textbfit} {cmbxti10} {}
  \NewTextAlphabet{textbfss} {cmssbx10} {}
  \NewMathAlphabet{mathbfit} {cmbxti10} {} % for math mode
  \NewMathAlphabet{mathbfss} {cmssbx10} {} %  "   "    "
  %
  \ifAMStwofonts
    %
    \NewSymbolFont{upmath} {eurm10}
    \NewSymbolFont{AMSa} {msam10}
    \NewMathSymbol{\upi}     {0}{upmath}{19}
    \NewMathSymbol{\umu}     {0}{upmath}{16}
    \NewMathSymbol{\upartial}{0}{upmath}{40}
    \NewMathSymbol{\leqslant}{3}{AMSa}{36}
    \NewMathSymbol{\geqslant}{3}{AMSa}{3E}
    \let\oldle=\le     \let\oldleq=\leq
    \let\oldge=\ge     \let\oldgeq=\geq
    \let\leq=\leqslant \let\le=\leqslant
    \let\geq=\geqslant \let\ge=\geqslant
  \else
    \def\umu{\mu}
    \def\upi{\pi}
    \def\upartial{\partial}
  \fi
\fi

% Marginal adjustments using \pageoffset maybe required when printing
% proofs on a Laserprinter (this is usually not needed).
% Syntax: \pageoffset{ +/- hor. offset}{ +/- vert. offset}
% e.g.    \pageoffset{-3pc}{-4pc}
\pageoffset{-2.5pc}{0pc}

\loadboldmathnames

% \Referee   %  uncomment this for referee mode (double spaced)

% \onecolumn        % enable one column mode
% \letters          % for `letters' articles
\pagerange{0--0}    % `letters' articles should use \pagerange{Ln--Ln}
\pubyear{2000}
\volume{000}
% \microfiche{}     % for articles with microfiche
% \authorcomment{}  % author comment for footline

\begintopmatter  %  start the two spanning material

\title{Overmerging in N-body simulations}
\author{Eelco van Kampen}
\affiliation{Institute for Astronomy, University of Edinburgh, Royal
Observatory, Blackford Hill, Edinburgh EH9 3HJ,\ {\tt evk@roe.ac.uk}}
\shortauthor{E.\ van Kampen}
\shorttitle{Overmerging}
\acceptedline{Accepted ... Received ...; in original form ...}

\abstract {The aim of this paper is to clarify the notion and cause of
overmerging in N-body simulations, and to present analytical estimates
for its timescale. Overmerging is the disruption of subhaloes
within embedding haloes due to {\it numerical}\ problems connected with
the discreteness of N-body dynamics. It is shown that the process responsible
for overmerging is particle-subhalo two-body heating.
%Excessive softening worsens the problem.
Various solutions to the overmerging problem are discussed.}

\keywords {galaxies: evolution - dark matter - large-scale structure of Universe}
\maketitle   %  finish the two spanning material
% \Referee     %  uncomment this for referee mode

\section{Introduction}

In the study of the formation and evolution of large-scale structure in the
universe, clusters of galaxies, galaxies, and many other gravitational systems,
haloes play an important r\^ole.
A {\it halo}\ is defined as a collapsed and virialized density maximum.
A halo can contain several smaller haloes, denoted as {\it subhaloes}.
We denote a halo that contains subhaloes as an {\it embedding halo}.
The existence of subhaloes is an important issue in cosmology, especially for
galaxies, and groups and clusters of galaxies. For example,
hierarchical structure formation scenarios for CDM-like spectra predict
many more dwarf galaxies (or satellites) than observed (Klypin et al.\ 1999b,
Moore et al.\ 1999).
Also, a spiral galaxy cannot retain its disk if there is an high abundance
of subhaloes within its halo (Moore et al.\ 1999). Thus, the question
is whether the initial density fluctuation spetrum is such that not many
dwarf galaxies form in the first place, or that they are easily destroyed
within our Galaxy, and hard to find outside it. On larger scale, clusters
of galaxies do contain an abundance of subhaloes, i.e.\ its member galaxies,
which are often distorted and stripped, but probably not destroyed.

N-body simulations are routinely used to model the formation, evolution,
and clustering of galaxy and galaxy cluster haloes.
However, the N-body simulation method does have its limitiations, and care
should be taken with the interpretation of the simulation results.
One such limitation arises from the use of particles to represent
the mass distribution whose evolution one tries to simulate.
If the physical mass distribution is effectively collisionless,
as is often the case, the use of particles gives rise to artificial
collisional effects within the numerical mass distribution, especially
though two-body interaction. Two-body encounters between simulation
particles, either close or distant, deflect their orbits significantly,
while they should behave like test particles, and respond only to the
mean potential. This is especially a problem for subhaloes, which are
easily destroyed in an N-body simulation with insufficient resolution
(White et al.\ 1987; Carlberg 1994; van Kampen 1995).
We use the term {\it overmerging}\ for the numerical processes that
artificially merge haloes and subhaloes in an N-body model, usually by
disrupting the subhalo. Thus, the term {\it merging}\ only denotes
merging due to physical processes.

\beginfigure{1}
{\psfig{file=over.eps,width=8.5cm,silent=1}}
\caption{{\bf Figure 1.} Graphical illustration of the main
numerical disruption processes that cause overmerging.
Open circles represent the 'cold' particles of an isolated
halo or a subhalo within an embedded halo, whose 'hot'
particles are indicated by filled circles.}
\endfigure

However, there seems to be some confusion in the literature over the
nature, cause, and importance of the overmerging problem.
This paper attempts to clarify the difference between the three most
important two-body processes operating on subhaloes, and provide
estimates for their associated timescales.
The first process is {\it two-body evaporation}, which is an
{\it internal}\ process operation within any halo or subhalo.
It is due to two-body interactions between the particles within the halo
or subhalo. The second process is {\it particle-subhalo two-body heating},
which is the heating of `cold' subhaloes by particles from the `hot'
embedding halo through two-body interactions.
The third process is {\it particle-subhalo tidal heating}, where the subhalo
is considered collisionless, and increases its kinetic energy through
tidal interactions with particles from the embedding halo. All three
process are illustrated in Fig.\ 1.

Besides the two-body processes, the use of {\it softened}\ particles, in order
to minimize two-body effects, can cause overmerging as well by artificially
enhancing physical processes like merging and disruption by tidal forces
(van Kampen 1995; Moore et al.\ 1996). Groups of softened particles are not
as compact as real haloes, and their artificially larger sizes make N-body
groups more prone to tidal disruption.

Carlberg (1994) proposed particle-subhalo two-body heating as the main
cause for overmerging. He gave a timescale for this process, but no
derivation. This was provided by van Kampen (1995).
It has been shown before (Carlberg 1994; van Kampen 1995) that the
two-body heating time-scale for small subhaloes orbiting an embedding
halo is short enough to result in their complete destruction and dispersion.
Subsequent authors, including Moore et al.\ (1996) and Klypin et al.\ (1999a),
referenced Carlberg (1994) as saying that `particle-halo heating'
is at the root of the problem. Moore et al.\ (1996) then claim that the
process is not important for the resolution of the simulation performed by
Carlberg (1994) because the timescale is too long.
However, the process Moore et al.\ (1996) actually describes and derives a
timescale for is a different one,
driven by tidal encounters between simulation particles and perfectly
collisionless subhaloes, while Carlberg (1994) and van Kampen (1995)
clearly had a collisonal process in mind, driven by two-body encounters
between individual subhalo particles and particles from the embedding halo.
This paper shows that the latter process has a much shorter timescale, and
therefore, along with excessive softening, is the main cause for overmerging.

\section{Two-body effects in N-body simulations}

Two-body effects become dominant for systems modelled by small numbers of
particles. This is usually quantified by the two-body relaxation timescale,
which is defined as the time it takes, on average, for a particle to
change its velocity by of order itself. After this time a system is
denoted as {\it relaxed}. The relaxation timescale is defined
in terms of the {\it half-mass radius}\ $r$, the {\it typical velocity}\
$v$ (usually taken to be equal to the velocity dispersion), and the
average change $\Delta v$ per {\it crossing time}\ $r/v$:
$$t_{\rm relax}\equiv {v^2 \over (\Delta v)^2} {r \over v}\ . \eqno\stepeq$$
\newcount\timescaledefinition
\timescaledefinition=\Eqnno
For an {\it isolated}\ virialized system of $N$ point particles, it is easy
to show that this is of order $0.1 N/\ln N$ crossing times (eg.\ Binney \& 
Tremaine 1987). If the time interval one tries to cover for a particular
problem is larger than the two-body relaxtion timescale, the problem becomes
artificially collisional.

Although many systems are likely to endure physical mechanisms like violent
relaxation and phase mixing during some stage of their evolution, an obvious
worry is that such physical mechanisms might not actually be important
in a given situation, so that two-body interactions are very much unwanted
as they might mimic the effects of physical mechanisms.
A different problem is that a system might completely evaporate through
two-body interactions.

The problem can be alleviated somewhat by softening
the particles, which reduces the two-body relaxation timescale to
$0.1 N/\ln \Lambda$ crossing times (see van Kampen (1995) and references
theirein), where $\Lambda={\rm Min}(R/4\epsilon, N)$, with $R$ the effective
size of the system, which we take to be twice the half-mass radius $r$,
and $\epsilon$ the softening length of the N-body particles.
However, $\epsilon$ is necessarily a function of both $N$ and $r$, as softened
particles should not overlap too much. Too large a choice for $\epsilon$ will
prevent particles from clustering properly and produce haloes which are too
extended and too cold (that is, the velocity dispersion is too small).
Given that $N/2$ particles reside within $r$ by definition, the mean particle
number density within $r$ is $3N/(8\pi r^3)$. The maximum mean particle density
desirable is set by the minimum mean nearest neighbour distance for the
particles: $n_{\rm max}=3/(4\pi r^3_{\rm nn})$. Most often used is Plummer
softening, which just means that particles have a Plummer density
profile, $\rho(r)\sim(r^2+\epsilon^2)^{5/2}$. The effective force
resolution, defined as the separation between two particles for which
the radial component of the softened force between them is half its
Newtonian value, is $\approx 2.6\epsilon$ for Plummer softening
(Gelb \& Bertschinger 1994), so we want $r_{\rm nn}\ga 2.6\epsilon$,
which gives $n_{\rm max}\approx 0.014/\epsilon^3$.
Thus, we find a maximum realistic softening length
$$\epsilon \approx {r\over 2 N^{1\over 3}}\ . \eqno\stepeq$$
\newcount\softeningnumber
\softeningnumber=\Eqnno
For this $\epsilon$ the relaxation time becomes $0.3 N/\ln N$
crossing times, i.e.\ three times larger than for the point particles case.

Even though softening alleviates the problem of two-body effects somewhat,
softened particle groups are more extended and less strongly bound (van Kampen 1995).
This makes them more vulnerable to two-body disruption processes, which are more
efficient for larger subhaloes, as shown below.
Furthermore, the timescales for {\it physical}\ disruption processes are effected.
Subhalo-subhalo tidal heating has a timescale inversely proportional to the
subhalo size (van Kampen 2000), and is therefore slower, although the lower
binding energy might compensate for this.
%Dynamical friction does not or weakly depend on subhalo size. 
Tidal stripping and disruption will be artificially enhanced, however, because
of the larger subhalo size and the weaker binding of the particles inside the
group (van Kampen 1995).
Because the enhanced tidal disruption due to softening has the same net
effect as two-body disruption, which is also enhanced due to the larger
subhalo size, the two disruption processes accelerate each other.
%In order to examine which process is the most important, one can look at
%simulations of the same matter distribution at different resolutions.
%If disruption occurs at the same timescale for two different resolutions,
%it is likely to be tidal, whereas if it is only seen to operate for the
%lower resolution simulation, it must be two-body disruption.
%Of the two, two-body disruption seems the dominant process (van Kampen 1995).
In the next section we derive two-body disruption timescales without taking
into account tidal disruption, and then treat these timescales as upper limits.

\section{Disruption timescales}

\subsection{Two-body evaporation}

This process is internal to haloes and subhaloes
in other words, it is a self-disruption process. Two-body interactions
between particles within the same (sub)halo change their orbits and
velocities, thus every once in a while the velocity will be larger 
than the escape velocity, and a particle will `leak' out of the (sub)halo.
The timescale for this process is about a hundred times the relaxation
timescale (e.g.\ Binney \& Tremaine 1987),
$$t_{\rm dis}\equiv 30 {N\over\ln N} {r \over v}
  \ , \eqno\stepeq$$
so for small $N$ this becomes important.
As an example, for galaxy haloes, evaporation becomes an issue for $N<10$,
as the crossing time for most galaxy haloes is larger than 0.2 Gyr,
independent of their mass.

Moore et al. (1996) tested whether this process gets enhanced for
subhaloes within embedding haloes due to the influence of the mean
tidal field of the embedding halo. They simulated a
collisional group of particles within a {\it smooth}, and therefore
collisionless, isothermal system. They found that the evaporation
rate was similar to that for an isolated group, and concluded
that {\it "relaxation effects are not important at driving mass loss
from haloes within current simulations"}.
Their conclusion is incorrect, however, as they did not consider
the particle-subhalo two-body heating process, which we discuss next.
%Their numerical tests should have included a particle distribution
%for the over-dense region as well, which would have heated the small
%group into dissolution.

\subsection{Particle-subhalo two-body heating}

Particles within a subhalo do not just interact amongst themselves
(driving the evaporation process describe above), but also with
the particles of the embedding halo.
As the latter are usually hotter than those of the
subhalo, velocity changes to the subhalo particles will always
be positive. The process very much resembles the kinetic heating
of a cold system that is introduced into a hot bath:
an embedding halo `boils' the subhalo into dissolution.
A derivation for the disruption timescale of this process is
given by van Kampen (1995, his eq.\ 15, which is erroneous by 
a factor of two):
$$t_{\rm dis} \approx {v_{\rm s}^2 \over v_{\rm h}^2}
  {N_{\rm h} \over 12\ln (r_{\rm h}/2\epsilon)} 
  {r_{\rm h} \over v_{\rm h}} \ .  \eqno\stepeq$$
\newcount\disruptiontimescale
\disruptiontimescale=\Eqnno
Here $N$ denotes the number of particles,
and the subscripts {\rm h} and {\rm s} denote embedding halo and subhalo
respectively. A similar expression was given earlier by
Carlberg (1994, his eq.\ 13 with his indices c and g swapped,
no derivation given):
$$t_{\rm dis} \approx {v_{\rm s}^2 \over v_{\rm h}^2}
  {N_{\rm h} \over 8\ln (r_{\rm h}/\epsilon)}
  {r_{\rm h} \over v_{\rm h}}\ . \eqno\stepeq$$
We can rewrite eq.\ $(\the\disruptiontimescale)$, using eq.\
(\the\softeningnumber) and the virial theorem for both halo and
subhalo, as
$$t_{\rm dis} \approx {N_{\rm s} \over 4 \ln N_{\rm h}}
  {r_{\rm h} \over r_{\rm s}} {r_{\rm h} \over v_{\rm h}} 
  \approx {N^{2\over 3}_{\rm s} \over 8 \ln N_{\rm h}}
  {r^2_{\rm h} \over v_{\rm h}} \epsilon^{-1}
  \ . \eqno\stepeq$$
\newcount\distimescale
\distimescale=\Eqnno
This timescale is shorter than that for two-body evaporation,
by a factor of (van Kampen 1995)
$$ 100 {v_{\rm h}\over v_{\rm s}} {r_{\rm s}^2 \over r_{\rm h}^2}
   {\ln N_{\rm h}\over \ln N_{\rm s}}\ , \eqno\stepeq$$
where the virial theorem, $v^2\sim N/r$, is used for both systems.

Because $r_{\rm h}$ is at least several times $r_{\rm s}$,
the disruption time (\the\distimescale) is at least
$\approx N_{\rm s}/\ln (N_{\rm h})$ embedding halo crossing
times, which covers the range $0.05-0.15 N_{\rm s}$ crossing
times for $N_{\rm h}\approx 10^3-10^9$. Thus, it is a much faster
process than two-body evaporation.

\subsection{Particle-subhalo tidal heating}

A different cause for overmerging was proposed by Moore et al.\
(1996): the tidal heating of subhaloes by particles of their embedding
haloes. Subhaloes are taken to be {\it collisionless}, and get
disrupted through an increase of their internal kinetic energy
by tidal distortion from passing N-body particles, which are artificially
large as compared to the true dark matter halo particles.

The time-scale for this process as given by Moore et al.\ (1996;
their eq.\ (3), which is eq.\ (7-67) of Binney \& Tremaine 1987 with
the assumption that the {\it r.m.s.}\ radius is equal to the half-mass
radius) reads
$$t_{\rm dis} \approx 0.03
  {v_{\rm h} \over G n_{\rm p}}
  {m_{\rm s}\over m^2_{\rm p}}
  {r^2_{\rm p}\over r^3_{\rm s}}\ , \eqno\stepeq$$
\newcount\tdismoore
\tdismoore=\Eqnno
where the subscript p stands for {\it perturber}. The perturber is an
N-body particle of the embedding halo with mass $m_{\rm p}$ and size
$r_{\rm p}$, at a distance $q$ from the centre of the embedding halo.
Note that the impulse approximation implies
${v^2 / \Delta v^2} = {E / \Delta E}$.
Moore et al.\ (1996) then assume the embedding halo to be isothermal,
so that $n_{\rm p} \approx v^2_{\rm h}/2 \pi G m_{\rm p} q^2$,
set the half-mass radius of the subhalo equal to the tidal radius,
$q v_{\rm s}/ (3 v_{\rm h})$, and assume the subhalo to be virialized.
This gives
$$t_{\rm dis} \approx 94 \Bigl({v_{\rm h}\over 1000\ {\rm km\ s}^{-1}}\Bigr)
  \Bigl({r_{\rm p}\over 10\ {\rm kpc}} \Bigr)^2
  \Bigl({10^9 {\rm M}_{\sun} \over m_{\rm p}}\Bigr) {\rm Gyr}\ . \eqno\stepeq$$
\newcount\mooretime
\mooretime=\Eqnno

Relation (\the\tdismoore) was originally derived by Spitzer (1958) for
the disruption by giant molecular clouds of open star clusters.
An important assumption in its derivation is the tidal approximation,
which is only valid for impact parameters $b>b_{\rm min}$.
Aguilar \& White (1985) found that $b_{\rm min}$ should be at least
five times the size of {\it both} the perturber and the perturbed system.
Binney \& Tremaine (1987) use the tidal approximation down to
$b_{\rm min}=r_{\rm cluster}<r_{\rm cloud}$, and introduce a correction
factor $g=3$ to take into account the encounters for which the tidal
approximation fails.

Moore et al.\ (1996) take this result and apply it to tidal interactions
between the N-body particles of an embedding halo and its subhaloes theirin.
Thus, they set $r_{\rm p}$ to the gravitational softening length $\epsilon$.
However, as the size of the perturbers is now {\it smaller} than the size
of the perturbed subhaloes, the tidal approximation, even with the correction
factor $g$ included, is only valid for $b>r_{\rm s}$. Therefore, setting
$r_{\rm p}=\epsilon$ in eq.\ (\the\mooretime) is incorrect; instead, one
should set $r_{\rm p}=r_{\rm s}$.
This means that the timescale becomes $(r_{\rm s}/\epsilon)^2$ times longer.
Using eq.\ (\the\softeningnumber), the time-scale becomes $4 N^{2/3}_{\rm s}$
times larger than proposed by Moore et al.\ (1996).

But there is another change to be made, as it is in fact the close
encounters of halo particles that do the most damage to the subhaloes.
According to Binney \& Tremaine (1987), a good estimate for
the disruption timescale can be had from an interpolation between the
approximations for tidal encounters and for penetrating ($b=0$) encounters. 
For each tidal encounter (Binney \& Tremaine 1987, their eq.\ 7-55),
$$(\Delta E)_{\rm tid} = 
  {4 G^2 m^2_{\rm p} m_{\rm s} r^2_{\rm s}\over 3 v^2_{\rm h}}
  {1\over b^4} \ , \eqno\stepeq$$
while for each penetrating encounter (Binney \& Tremaine 1987, their
eq.\ 7-57)
$$(\Delta E)_{\rm pen} = {4 \pi G^2 m^2_{\rm p}\over v^2_{\rm h}}
  \int_0^{\infty} {R^3\over (R^2+\epsilon^2)^2} \Sigma_{\rm s}(R) dR
  \ . \eqno\stepeq$$
If the perturbed subhalo is an isothermal sphere, i.e.\ 
$\Sigma_{\rm s}(R)=v^2_{\rm s}/(6GR)\approx 0.2m_{\rm h}/(r_{\rm h} R)$, we find
$$(\Delta E)_{\rm pen} \approx
  {2 G^2 m^2_{\rm p} m_{\rm s} r^2_{\rm s}\over v^2_{\rm h}}
  {1 \over \epsilon r^3_{\rm s}} . \eqno\stepeq$$
Interpolating contributions from the tidal and penetrating encounters, i.e.\
$$\Delta E = {4 G^2 m^2_{\rm p} m_{\rm s} r^2_{\rm s}\over 3 v^2_{\rm h}}
  {1 \over b^4+{2\over 3}\epsilon r^3_{\rm s}}\ , \eqno\stepeq$$
finally allows us to integrate over {\it all}\ encounters.
Following the procedure of Binney \& Tremaine (1987), we simply find
eq.\ (\the\tdismoore) with $r_{\rm p}$ ($=\epsilon$) replaced by
$0.52(\epsilon r^3_{\rm s})^{1/2}$. Following Moore et al.\ (1996) again
we get the same functional form as eq.\ (\the\mooretime), but the timescale
is approximately $2(r_{\rm s}/\epsilon)^{3/2}\approx 5 N^{1/2}_{\rm s}$
times {\it longer}\ than estimated by Moore et al.\ (1996).

By definition, $m_{\rm s}/m_{\rm p}=N_{\rm s}$, and we use
eq.\ (\the\softeningnumber) to get
$$t_{\rm dis} \approx 4.5 N^{5\over 6}_{\rm s}
  {r_{\rm h} \over r_{\rm s}}
  {r_{\rm h} \over v_{\rm h}}
  \approx 2.2 N^{1\over 2}_{\rm s}
  {r^2_{\rm h} \over v_{\rm h}} \epsilon^{-1}
  \ . \eqno\stepeq$$
\newcount\tdisNs
\tdisNs=\Eqnno
As $r_{\rm h}$ is at least a few times $r_{\rm s}$, the disruption
time is at least $20 N^{5/6}_{\rm s}$ embedding halo crossing times.
It is also a factor of $18 N^{-1/6}_{\rm s} \ln N_{\rm h}\approx 100$ times
longer than the particle-subhalo two-body disruption timescale.

\section{Conclusions and discussion}

Overmerging is the numerical disruption of subhaloes within embedding
haloes. Of the three main two-body disruption processes, particle-subhalo
two-body heating is clearly identified as the cause for overmerging.
Its timescale is shown to be much shorter than that for the two other
processes, two-body evaporation and particle-subhalo tidal heating.
Note that softened particles form into more extended subhaloes than is
realistic, so they are more vulnerable to these disruption processes
(van Kampen 1995), and to possible physical disruption processes as well.

Recently several research groups used simulations with a very high resolution
in order to resolve the overmerging problem (Klypin et al.\ 1999a;
Ghinga et al.\ 1998, 1999; Moore et al.\ 1999).
Unfortunately, different group finders and different definitions for disruption
times were used, so a direct comparison of the results is not straightforward.
Still, the consensus is that increasing the number of particles overcomes,
at least partially, the overmerging problem. However, the resolution needs to be
rather high:
%Klypin et al.\ (1999a) find that the larger subhaloes survive for resolutions
%of a few kpc and 10$^8$-10$^9$ $M_\odot$ respectively.
for N-body simulations on a cosmological scale, this requires the use of at
least $10^9$ particles, which is not very practical.
Furthermore, for the smallest groups the overmerging problem simply remains.

Another option is to include a baryonic component. With the addition
of dissipative particles, haloes should be more compact and have a higher
central density for the same numbre of particles.
However, as Klypin et al.\ (1999a) remark, there is a limit to this as some
fraction of the baryons tend to end up in rotationally supported disks.
A more practical problem with dissipative particles is the actual simulation
techniques needed, which usually is some form of smoothed particle
hydrodynamics (SPH). The resolution of SPH codes is typically not as high as that
of N-body codes, so for the purpose of resolving the overmerging problem
it is not a useful alternative at present.

A third option is to use halo particles, which prevents overmerging by
construction (van Kampen 1995). The idea is that a group of particles that
has collapsed into a virialised system is replaced by a single halo particle.
Local density percolation, also called adaptive friends-of-friends,
is adopted for finding the groups.
This is designed to identify the embedded haloes that the 
traditional percolation group finder links up with their parent halo.
By applying the algorithm several times during the evolution,
merging of already-formed galaxy haloes is taken into account as well.
Once a halo particle is formed, more N-body particles will group around
it at later times. If such a group can virialize, it is replaced by a
more massive halo particle. This will usually happen in the field.
However, for halo particles that end up in overdense regions, the
particles that swarm around a halo particles will be stripped quite
rapidly.

Once the overmerging problem is resolved down to the subhalo mass-scale
one is interested in, the physical processes can be studied. 
This is becoming feasible for current simulations.
However, whether the physical processes themselves are properly modelled
using N-body simulations has yet to be proven. The problem of artificially
large subhaloes due to softening needs to be solved, for example. Another
problem might be the modelling of dynamical friction, which requires a very
smooth distribution of particles in the embedding halo in order to produce
the wake that generates the drag force.

\section*{ACKNOWLEDGEMENTS}

I am grateful to John Peacock and Ben Moore for useful discussion,
suggestions and comments.

\section*{REFERENCES}

\beginrefs

\bibitem Aquilar L.A., White S.D.M., 1985, ApJ, 295, 374
%
\bibitem Allan A.J., Richstone D.O., 1988, ApJ, 325, 583

\bibitem Binney J., Tremaine S., 1987, Galactic Dynamics, Princeton

\bibitem Carlberg R.G., 1994, ApJ, 433, 468

\bibitem Gelb J., Bertschinger E., 1994, ApJ, 436, 467

\bibitem Ghigna S., Moore B., Governato F., Lake G., Quinn T., Stadel J.,
	1998, MNRAS, 300, 146

\bibitem Ghigna S., Moore B., Governato F., Lake G., Quinn T., Stadel J.,
	1999, astro-ph/9910166
%
\bibitem Heisler J., White S.D.M., 1990, MNRAS, 243, 199

\bibitem Klypin A.A., Gottl\"ober S., Kravtsov A.V., Khokhlov A.M., 1999a,
	ApJ, 516, 530

\bibitem Klypin A.A., Kravtsov A.V., Valenzuela O., Prada F., 1999b,
	astro-ph/9901240
%
\bibitem Lin D.N.C., Tremaine S., 1983, ApJ, 264, 364
%
\bibitem Mateo M., 1998, ARA\&A, 36, 435

\bibitem Moore B., Katz N., Lake G., 1996, ApJ, 457, 455

\bibitem Moore B., Governato F., Quinn T., Stadel J., Lake G., 1998,
	ApJ, 499, L5
%
\bibitem Moore B., Lake G., Quinn T., Stadel J., 1999, MNRAS, 304, 465

\bibitem Moore B., Ghigna S., Governato F., Lake G., Quinn T., Stadel J.,
	Tozzi P., 1999,	ApJ, 524, L19
%
\bibitem Saslaw W.C., 1985, Gravitational physics of stellar and galactic
%	systems, Cambridge

\bibitem Spitzer L., 1958, ApJ, 127, 17
%
\bibitem Tormen G., Diaferio A., Syer D., 1998, 299, 728
%
\bibitem Tremaine S., 1976, ApJ, 203, 72

\bibitem van Kampen E., 1995, MNRAS, 273, 295
%
\bibitem van Kampen E., Katgert P., 1997, MNRAS, 289, 327
%
\bibitem van Kampen E., Jimenez R., Peacock J.A., 1999, MNRAS, 310, 43
