% Paper title and related stuff (author, institution, abstract, keywords)
% Usage:
% \pagetitlestuff{
% \title{P is equal to NP\cp (I think)}
% \titlerule % A nice centered \hrule
% \author{I. Newton, {\rm Department of Cyberethics}}
% \author{A. Einstein, {\rm W. C. Fields Laboratory}}
% \institution{Sacred Well Divination Institute,\cp
% Chichen Itza, Yucatan}
% \titlerule
% }
% \columntitlestuff{
% \abstract{In this paper we make some general remarks
% concerning an algorithm for solving a problem related to an
% important application of a well-known theoretical concept.}
% \keywords{the, that, of, and, in, is.}
% }
% All items (except \title) are optional.
% Any of them can be used inside either
% \columntitlestuff{} or \pagetitlestuff{}. The first option will
% typeset those items left-justified on top of the first column.
% The second option will center them on top of the first page,
% spanning both columns.
% Note that \columntitlestuff and \pagetitlestuff must occur before
% any contribution to the first page of the paper.
\def\pagetitlestuff#1{{
\def\title##1{\vskip7ex plus1ex
{\titlefont\baselineskip 2.0ex\lineskip0.1ex\ctrpar\pagewidth pt{##1}}
\vskip2ex}
\def\titlerule{\ctrpar\pagewidth pt{
\vbox{\vskip0.5ex\hrule width 2.5truein\vskip0.5ex}} }
\def\author##1{\vbox{\standardsize \ctrpar\pagewidth pt{\it ##1}}}
\def\institution##1{\vbox{\standardsize \ctrpar\pagewidth pt{\rm ##1}}}
\def\abstract##1{
\vskip3ex
\ctrpar \pagewidth pt{\standardsize
\lftpar \pageabstrwidth pt{##1}}}
\def\keywords##1{
\ctrpar \pagewidth pt{\standardsize
\lftpar \pageabstrwidth pt{{\:t KEYWORDS:} ##1}}}
\def\fixvsize{\setcount2 \textheight
\convert{1ht1}{pt} \advcount2 by -\count6
\convert{1dp1}{pt} \advcount2 by -\count6
\convert{1ht2}{pt} \advcount2 by -\count6
\ifdimen 1dp2 > 2pt % crock! - should be \the\maxdepth
{\convert{1dp2}{pt} \advcount2 by -\count6 \advcount2 by 2} \else {}
\vsize \count2 pt}
\save1\vbox{\baselineskip -1pt \lineskip 1.2ex
\vskip-7ex\unbox1 #1\vskip7ex}
\fixvsize
}}
\def\columntitlestuff#1{{
\def\title##1{\vskip2ex plus1ex minus1.5ex
{\titlefont\baselineskip 2.0ex\lineskip0.1ex
\lftpar\textwidth pt{##1}}
\vskip10pt}
\def\titlerule{\vskip0.5ex
\lftpar\textwidth pt{\vbox{\hrule width 2.5truein}}
\vskip0.5ex}
\def\author##1{\vbox{\standardsize
\lftpar\textwidth pt{\hangindent 2em after0\it ##1}}}
\def\institution##1{\vbox{
\lftpar\textwidth pt{\hangindent 4em after0\rm ##1}}}
\def\abstract##1{
\vskip3ex
\ctrpar \textwidth pt{\standardsize
\lftpar \abstrwidth pt{{\:t ABSTRACT:} ##1}}}
\def\keywords##1{
\ctrpar \textwidth pt{\standardsize
\hbox par \abstrwidth pt{{\:t KEYWORDS:} ##1}}}
\gdef\firstsection{F} % force \vskip before first \section too
{\baselineskip -1pt \lineskip 1.2ex #1 \vskip 3ex}
}}
% Support acknowledgement footnote.
% Usage:
% \support{The author was partially supported by the kind
% collaboration of a starving army of slaves, by the
% plundering of half a dozen neighboring villages,
% and by lavish gifts from Ramses III.}
\def\support#1{\botinsert{\small \hbox par \textwidth pt{#1}}}
% Section and subsection titles
% Usage:
% \section{1. Acid concepts}
% \subsection{1.1A. Annotation and Undefinitions}
% \subsection{Appendix A: The letters of the alphabet}
\def\firstsection{T} % internal - T on first call to \section
\def\section#1{
\if T\firstsection{\vskip 0.5ex\gdef\firstsection{F}}
\else{\vskip 3ex plus 2ex minus 0.5ex\penalty-800}
\hbox{{\secfont #1}}
\penalty 1000\vskip 1ex}
\def\subsection#1{
\vskip 2ex plus 1.5ex minus 0.5ex\penalty-600
\hbox{{\subsecfont #1}}
\penalty 1000\vskip 1ex}