%-----------------------------------------------------------------------
%;  Copyright (C) 1995
%;  Associated Universities, Inc. Washington DC, USA.
%;
%;  This program is free software; you can redistribute it and/or
%;  modify it under the terms of the GNU General Public License as
%;  published by the Free Software Foundation; either version 2 of
%;  the License, or (at your option) any later version.
%;
%;  This program is distributed in the hope that it will be useful,
%;  but WITHOUT ANY WARRANTY; without even the implied warranty of
%;  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
%;  GNU General Public License for more details.
%;
%;  You should have received a copy of the GNU General Public
%;  License along with this program; if not, write to the Free
%;  Software Foundation, Inc., 675 Massachusetts Ave, Cambridge,
%;  MA 02139, USA.
%;
%;  Correspondence concerning AIPS should be addressed as follows:
%;          Internet email: aipsmail@nrao.edu.
%;          Postal address: AIPS Project Office
%;                          National Radio Astronomy Observatory
%;                          520 Edgemont Road
%;                          Charlottesville, VA 22903-2475 USA
%-----------------------------------------------------------------------
% cers.sty  -- Workshop style definition

\def\deg{\ifmmode^\circ\else$^\circ$\fi}
\def\inv{\ifmmode^{-1}\else$^{-1}$\fi}
\def\eg{{e.g.}}
\def\ie{{i.e.}}
\def\cf{{cf.}}
\def\etal{{\it et al.}}
\def\etc{etc.}
\def\sup#1{$^{\rm #1}$}
\def\mag{\sup{m}}
\def\,{\thinspace}
%\def\lfil{\leaders\hbox to 0.4em{\hss.\hss}\hfil}
%     REFERENCES     %

%----------------------------------------------------------------------%
% Macros for references                                                %
%----------------------------------------------------------------------%
%
\def\tref#1{{\par\noindent \hangindent=3em \hangafter=1 #1\par}}

%  ****************************************
%  *            PAGE LAYOUT               *
%  ****************************************

% Create "plaintop" page style that has folios at top of page.

\def\ps@plaintop{\let\@mkboth\@gobbletwo
    \def\@oddfoot{}\def\@oddhead{\rm\hfil--\space\thepage\space--\hfil}
    \def\@evenfoot{}\let\@evenhead\@oddhead}

\ps@plaintop                         % Use "plaintop" pagestyle by default.

%  ****************************************
%  *            FRONT MATTER              *
%  ****************************************

% Make adjustments to LaTeX abstract style: optional upper case heading,
% retain current type size (should be normalsize), ignore twocolumn option
% in this substyle, add \sluginfo, and start abstract on fresh page.

%\def\abstract{%\sluginfo\clearpage
%    \begin{center}
%    {\bf{ABSTRACT}}
%    \end{center}
%    \quotation
%}

\def\abstract{%
%     \bigskip\goodbreak{\narrower\smallsize%
%     \noindent{\bf Abstract}\quotation}
      \bigskip\quotation\noindent{\bf Abstract}\quad}

% Title and author identification is by way of standard LaTeX commands
% \title and \author, although the macros themselves are rather different.
% The information is typeset by these macros in this style, rather than
% being buffered as per regular LaTeX.  The authors' principal affiliation
% is specified with a separate macro \affil.  Each \author command should
% be followed by its own \affil (or address).
%
% Authors often have affiliations above and beyond their main employer,
% and these are specified with the \altaffilmark and \altaffiltext commands.
% These commands behave like the \footnotemark and \footnotetext commands
% of LaTeX.  \altaffilmark is appended to author's names in the \author
% lists, and generates the superscript identification numbers.
% The text for the individual alternate affiliations is generated by the
% \altaffiltext command.  It is up to the author to make sure that the
% \altaffilmark numbers attached to authors' names correspond to the correct
% alternate affiliation.
%
%     \title{LUCID TEXT}
%     \author{NAME(S)}
%     \authoraddr{AUTHOR'S POSTAL ADDRESS}
%     \affil{AFFILIATION}
%     \altaffilmark{TAG NUMBER(S)}
%     \altaffiltext{NUMERICAL TAG}{TEXT}
%
% The typesetting performed by these commands is appropriate for the top of
% the first text page of the manuscript.  They could as well be used on a
% title cover page, but vertical placement would have to be controlled by
% the author.   This is not to be encouraged, since I want to discourage
% the introduction of any extra horizontal or vertical space.

\def\title#1{{\center\large\bf{#1}\endcenter}
    \thispagestyle{empty}}
\def\author#1{{\topsep\z@\center\normalsize#1\endcenter}}
\let\authoraddr=\@gobble
\def\affil#1{\vspace*{-2.5ex}{\topsep\z@\center#1\endcenter}}
\def\altaffilmark#1{$^{#1}$}
\def\altaffiltext#1#2{\footnotetext[#1]{#2}\stepcounter{footnote}}

% Redefine the LaTeX \and command for this style.

\def\and{\vspace*{-0.5ex}{\topsep\z@\center and\endcenter}}


%  ****************************************
%  *             FOOTNOTES                *
%  ****************************************

% The following code redefines a few things so that spacing in footnotes is
% different than LaTeX defaults.  The adjustment to \skip\footins increases
% the amount of vspace inserted before the \footnoterule.  Redefine
% \@makefntext to get proper indentation.

\skip\footins 4ex plus 1ex minus .5ex
\footnotesep 3ex

%\long\def\@makefntext#1{\noindent\hbox to\z@{\hss$^{\@thefnmark}$}#1}
%\long\def\@makefntext#1{\indent\hbox{$^{\@thefnmark}$}#1}


% For ApJ, acknowledgments are set off from main body text simply by
% vertical space (no heading or type size change).  I do the same for
% the AAS manuscript style.  For use in producing more polished output
% for other journals, this macro might generate text saying
% "Acknowledg[e]ments".

\def\acknowledgments{\vskip 3ex plus .8ex minus .4ex}
\let\acknowledgements=\acknowledgments			% second spelling

% LaTeX sectioning tools.


%  ****************************************
%  *          EQUATION NUMBERING          *
%  ****************************************

% Redefine \appendix so that equation numbers are prepended with
% \theappendix number.  Reset equation counter so that equation
% numbers in the appendix begin again with 1.  Note that the
% \appendix command is NOT a sectioning command; it is merely
% a delimiting markup between the main body of the paper and the
% appendix.  Sections in the appendix are still started with
% \section commands.
%
%    \appendix

\def\appendix{\par
  \setcounter{section}{0}
  \setcounter{subsection}{0}
  \setcounter{equation}{0}
  \def\thesection{\Alph{section}.}
  \def\theequation{\hbox{\normalsize\Alph{section}\arabic{equation}}}}

% Define mathletters environment.  This is a wrapper that goes
% *around* (outside of) equation or eqnarray environments.
%
%    \begin{mathletters}
%    \end{mathletters}

\newcounter{cureqno}

\newenvironment{mathletters}{\refstepcounter{equation}%
    \setcounter{cureqno}{\value{equation}}%
    \let\@curtheeqn\theequation%
    \edef\cur@eqn{\csname theequation\endcsname}%
    \def\theequation{\cur@eqn\alph{equation}}%
    \setcounter{equation}{0}}%
    {\let\theequation\@curtheeqn%
    \setcounter{equation}{\value{cureqno}}}

% The \eqnum command allows the author to override all automatic
% equation marking schemes.
%
%    \eqnum{TEXT}

\def\eqnum#1{\def\theequation{#1}\let\@currentlabel\theequation
    \addtocounter{equation}{\m@ne}}


%  ****************************************
%  *           EPS INCLUSIONS             *
%  ****************************************

% Include Rokicki's epsf.sty file explicitly.

\input{epsf.sty}
%\@ifundefined{epsfbox}{\@input{epsf.sty}}{\relax}

% Simplified EPS inclusion macros so we can see how this goes...
% These are layered on Rokicki's dvips material, and are dependent
% on the author's use of that DVI driver.
%
%    \plotone{EPSFILE}
%    \plottwo{EPSFILE}{EPSFILE}
%    \plotfiddle{EPSFILE}{VSIZE}{ROT}{HSF}{VSF}{HTRANS}{VTRANS}
%
% \plotone inserts the plot in a space that is \columnwidth wide; the
% plot is scaled so the horizontal dimension fits in the text width,
% and the vertical dimension is scaled to maintain the aspect ratio.
% \plottwo inserts two plots next to each other in one \columnwidth,
% sort of like "two-up" mode.
%
%    EPSFILE    name of file with EPS
%
% The following arguments are for the \plotfiddle macro which formats
% the \special itself, prepares vspace, etc.  This completely bypasses
% Rokicki's macros that attempt to rationalize the EPS BoundingBox with
% the LaTeX page dimensions.
%
%    VSIZE      vertical white space to allow for plot
%    ROT        rotation angle
%    HSF        horiz scale factor
%    VSF        vert scale factor
%    HTRANS     horiz translation
%    VTRANS     vert translation

%\epsfverbosetrue

%\def\plotone#1{\centering \leavevmode
%    \epsfxsize=\columnwidth \epsfbox{#1}}

% define plotone so that the width can be scaled individually...
\def\plotone#1#2{\centering \leavevmode
    \epsfxsize=#1\columnwidth \epsfbox{#2}}

\def\plottwo#1#2{\centering \leavevmode
    \epsfxsize=.45\columnwidth \epsfbox{#1} \hfil
    \epsfxsize=.45\columnwidth \epsfbox{#2}}

\def\plotfiddle#1#2#3#4#5#6#7{\centering \leavevmode
    \vbox to#2{\rule{0pt}{#2}}
    \special{psfile=#1 voffset=#7 hoffset=#6 vscale=#5 hscale=#4 angle=#3}}

