% Generic header for use with TeX.  Normal (non-technical) papers should use
% this to get a decent environment to work in.

% The format is simple:
% 	1) No page numbers
% 	2) 1 inch margins except for the left which is 1.5 (to allow for
% 	    hole-punching)
%	3) 12 point type.

% To use an alternate font family, call either:
% 	\timesroman --- for the Times-Roman font family
%	\helvetica  --- for the Helvetica font family
%	\palatino   --- for the Palatino font family
%	\newcen     --- for the New Century Schoolbook font family
%       \bookman    --- for the Bookman Demi font family
% If none of these are \def'd, then default to Computer Modern Roman
% If several of these are defined, then I don't know what will happen.

% To use the generic title macros:
%	\title      --- the title of the paper
%	\author     --- the name of the writer
%	\class	    --- the class it is written for
%	\date	    --- the date turned in/written/whatever.

% \titlepage:
% 	Produces a whole page for the title.

% \makeshorttitle:
%	Produces a simple title at the top of the first page.  name, class,
% date are right-justified.  Title is large and centered.

% \footnote{Text to be footnoted}
% 	Causes a footnote to be output.  Numbering is automatic.
% \resetfootnotenum
%	To reset numbers to '1'

% \doublespace
%       To doublespace a document

% \enumerate environment
%	Enter a list environment where each item will be numbered
% sequentially.  \item command is replaced with the enumerated version.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%  N O   M O R E   D O C U M E N T A T I O N  %%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% Make @ active
\def\atfrob{\expandafter\xdef\csname c@tcode\endcsname{\the\catcode`\@}%
\catcode`\@=11}
\atfrob

\def\endatfr@b{\catcode`\@=\c@tcode}

% All of these are amgreene's macros.  (Thanks, Rhu!)
\input fonts
\input margins
\input environments
\input shorthand

%% New font switching thingies.  They're really bogus.
\def\timesroman{\atfrob\input PS-timrom\endatfr@b}
\def\palatino{\atfrob\input PS-pal\endatfr@b}
\def\helvetica{\atfrob\input PS-helv\endatfr@b}
\def\newcen{\atfrob\input PS-newcen\endatfr@b}
\def\bookman{\atfrob\input PS-bookman\endatfr@b}

% Make the margins stuff happen
\setmargins

% Set the default point size and page style.
\twelvepoint
\nopagenumbers

% Double spacing :-P stuff
\def\doublespace{\baselineskip=2\baselineskip}

%% Footnote stuff
\let\f@@tnote=\footnote
\def\footnote#1{\advance\f@@tnum by1\f@@tnote{\prf@@tnum}{#1}}
\def\prf@@tnum{$^\the\f@@tnum$}
\newcount\f@@tnum
\f@@tnum=0
\def\resetfootnotenum{\global\f@@tnum=0}

%% Title stuff
\def\title#1{\def\t@tle{#1}}
\def\author#1{\def\@uthor{#1}}
\def\class#1{\def\cl@ss{#1}}
\def\date#1{\def\d@te{#1}}

% Predefine the title macros
\def\t@tle{\relax}
\def\@uthor{\relax}
\def\cl@ss{\relax}
\def\d@te{\relax}

% The short title 
\def\makeshorttitle{
\rightline{\@uthor}
\rightline{\cl@ss}
\rightline{\d@te}
\bigskip
\bigskip
\centerline{\largest\t@tle}
}

% The title page
\def\titlepage{
\pageno=0
\vbox to\vsize{
\sf
\vskip .6in
\largest
\rightline{\t@tle}
\larger
\vfil
\rightline{\@uthor}
\rightline{\cl@ss}
\vfil
\rightline{\d@te}
\vskip 2in
}
}

% Save old value of \end and \bye since I'm about to trash them
\let\@@end=\end
\def\bye{\par\vfill\supereject\@@end}

% Simple environment commands that I think will work.
\def\begin#1{\csname #1\endcsname}
\def\end#1{\csname end#1\endcsname}

% Enumeration type.
\newcount\en@mguy
\def\enumerate{\smallskip\bgroup\en@mguy=0\let\pr@vitem=\item
    \def\item{\global\advance\en@mguy by1\pr@vitem{\the\en@mguy.}}}
\def\endenumerate{\egroup\par\smallskip}

% Restore @ to old catcode
\endatfr@b

%%% !!! Want to make double space an environment.
