%%% mysecs.sty

\typeout{Document Style Option mysecs --  Mitch Wand's customizations, 2/17/90}

\def\support#1{\gdef\@support{\thanks{#1}}}
\gdef\@support{}                 % default is empty

%%% My \author:

\support{Work supported by the National
Science Foundation under grant number CCR-8801591.}

\author{Mitchell Wand\@support
\\
\\
College of Computer Science\\
Northeastern University\\
360 Huntington Avenue, 161CN\\
Boston, MA 02115, USA\\
wand@ccs.neu.edu
}

%%% Tailoring of section stuff, etc.

\parskip =0.75ex plus 0.25ex

%% \par-delimited sectionbegins:

\def\sectionbegin#1\par{\typeout{#1}\section{#1}}
\def\subsectionbegin#1\par{\subsection{#1}}
\def\subsubsectionbegin#1\par{\subsubsection{#1}}
\def\paragraphbegin#1\par{\paragraph{#1}}
\def\subparagraphbegin#1\par{\subparagraph{#1}}
\def\appsectionbegin#1\par{\typeout{#1}\section*{#1}}  %% don't know if this
                                                       %% works.

%% format for section headers

\def\section{\@startsection {section}{1}{\z@}{-3.5ex plus -1ex minus 
 -.2ex}{0.5ex plus .2ex}{\large\bf}}
\def\subsection{\@startsection{subsection}{2}{\z@}{-3.25ex plus -1ex minus 
 -.2ex}{0.5ex plus .2ex}{\normalsize\bf}}
\def\subsubsection{\@startsection{subsubsection}{3}{\z@}{-3.25ex plus 
 -1ex minus -.2ex}{0.5ex plus .2ex}{\normalsize\bf}}
\def\paragraph{\@startsection
 {paragraph}{4}{\z@}{3.25ex plus 1ex minus .2ex}{-1em}{\normalsize\bf}}
\def\subparagraph{\@startsection
 {subparagraph}{4}{\parindent}{3.25ex plus 1ex minus 
 .2ex}{-1em}{\normalsize\it}}

%% Make abstract like normal \section*:

\def\abstract{\section*{Abstract}}
\def\endabstract{}

%%% verbatim and code environments.  code environment is just like verbatim,
%%% but has a different name.  This is for ``literate programming''

\begingroup \catcode `|=0 \catcode `[= 1
\catcode`]=2 \catcode `\{=12 \catcode `\}=12
\catcode`\\=12 |gdef|@xverbatim#1\end{verbatim}[#1|end[verbatim]]
|gdef|@sxverbatim#1\end{verbatim*}[#1|end[verbatim*]]
|gdef|@xcode#1\end{code}[#1|end[code]]
|gdef|@sxcode#1\end{code*}[#1|end[code*]]
|endgroup

\def\verbatim{\@verbatim \frenchspacing\@vobeyspaces \@xverbatim}
\let\endverbatim=\endtrivlist

\@namedef{verbatim*}{\@verbatim\@sxverbatim}
\expandafter\let\csname endverbatim*\endcsname =\endtrivlist

\def\code{\@verbatim \frenchspacing\@vobeyspaces \@xcode}
\let\endcode=\endtrivlist

\@namedef{code*}{\@verbatim\@sxcode}
\expandafter\let\csname endcode*\endcsname =\endtrivlist

%%% date and time

% \thetime     Time in printable format   13:57
% \hours       Number of hours past midnight
% \minutes     Number of minutes past last hour

\newcount\hours
\newcount\minutes
\newcount\hh
\minutes=\time
\hours=\time
\divide\hours by60
\hh=\hours
\multiply\hh by60
\advance\minutes by -\hh

\def\thetime{\number\hours:\ifnum\minutes<10{0}\fi\number\minutes}

%%% add source-file to titlepage

\newif\ifdraft \drafttrue
\def\source#1{\gdef\@source{#1}}
\gdef\@source{}                 % default is empty

\let\oldlabel=\label
\def\label#1{\ifdraft %\marginpar{\tiny label\{#1\}} 
                      \hbox{\tiny label\{#1\}} 
                      \else\relax\fi \oldlabel{#1}}

\def\@maketitle{\newpage
 \null
 \begin{center}
  {\ifdraft\vskip -1em  {\tiny \@source\ \thetime\ \today} \vskip
  1em\else\relax\fi} 
  {\LARGE \@title \par} \vskip 1.5em {\large \lineskip .5em
  \begin{tabular}[t]{c}
     \@author 
  \end{tabular}\par} 
  \vskip 1em {\large \@date} 
  \end{center}
 \par
 \vskip 1.5em} 

%%% Miscellaneous math stuff

% '~' is used as a tie in text and to separate parts of terms in math mode
\def~{\relax\ifmmode \mskip\thinmuskip \else \penalty10000 \ \fi}

\def\forcemath#1{\relax\ifmmode #1 \else \(#1\)\fi}
\def\mdef#1#2{\def#1{\relax\ifmmode #2 \else \(#2\)\fi}}
\def\semfcn#1#2{{#1}\lbrack\!\lbrack #2 \rbrack\!\rbrack}

% for BNF grammars

\def\nt#1{\langle\hbox{\rm #1}\rangle}
\def\term#1{\,\hbox{\bf #1}\,}
\def\lparen{\term{(}}
\def\rparen{\term{)}}
\def\alt{~~\vert~~}

% for comments (Note \par)

\def\cmt#1\par{$\lbrack\!\lbrack$ #1 $\rbrack\!\rbrack$\par}

%%% program environment:  like tabbing, but everything is in math mode

\newenvironment{program}{\begingroup
\def\@startfield{\global\setbox\@curfield\hbox\bgroup\begin{math}}
\def\@stopfield{\end{math}\egroup}
\begin{tabbing}}{\end{tabbing}\endgroup}

%%% displayprogram:  like program, but centered using displaymath:

\newenvironment{displayprogram}{%
        \begin{displaymath}\vbox\bgroup\begin{program}}{%
        \end{program}\egroup \end{displaymath}}

%%% useful macros for references:

\def\popl#1{{\it {Conf. Rec. #1 ACM Symp. on Principles of Programming
Languages}\/}}
\def\lics#1{{\it Proc. #1 IEEE Symposium on Logic in Computer Science\/}}
\def\tr{Northeastern University College of Computer Science Technical Report
NU-CCS-}
\def\lfp#1{{\it Proc. #1 ACM Symp. on Lisp and Functional Programming}}

