%%% ====================================================================
%%%  @LaTeX-style-file{
%%%     author          = "David M. Jones",
%%%     version         = "3.01",
%%%     date            = "21 October 1993",
%%%     time            = "14:30:46 EDT",
%%%     filename        = "lcsletter.sty",
%%%     address         = "MIT Laboratory for Computer Science
%%%                        Room NE43-316
%%%                        545 Technology Square
%%%                        Cambridge, MA 02139
%%%                        USA",
%%%     telephone       = "(617) 253-5936",
%%%     FAX             = "(617) 253-3480",
%%%     checksum        = "42051 1357 4663 44689",
%%%     email           = "dmjones@theory.lcs.mit.edu",
%%%     codetable       = "ISO/ASCII",
%%%     keywords        = "",
%%%     supported       = "yes",
%%%     docstring       = "This is a letter style file to produce a
%%%         facsimile of the MIT Laboratory for Computer Science
%%%         letterhead, including the MIT logo.
%%%
%%%         The checksum field above contains a CRC-16 checksum as the
%%%         first value, followed by the equivalent of the standard
%%%         UNIX wc (word count) utility output of lines, words, and
%%%         characters.  This is produced by Robert Solovay's checksum
%%%         utility.",
%%%     edit-history    = "
%%%         v3.01, 21 Oct 1993 -- Minor update.  Fixed onepage option
%%%         so that it actually works with the new logo.  Also added
%%%         the 'newstyle' option for symmetry with the oldstyle
%%%         option and made the zip code a user-definable parameter
%%%         with the default being 02139-3539 instead of 02139-4307 as
%%%         per Newton Loui's suggestion.
%%%
%%%         v3.0, 20 Oct 1993 -- Major update.  Changed masthead to
%%%         the new LCS style (the old style is still available with
%%%         the 'oldstyle' document-style option) and added the memo
%%%         environment as an alternative to the letter environment.
%%%
%%%         v2.06, 27 Sep 1993 -- changed default value of \@pslogo to
%%%         just 'mitlogo.ps', without giving explicit path name.
%%%
%%%         v2.05, 19 Aug 1993 -- Added \frenchspacing to definitions
%%%         of \opening, \closing, and \letter.
%%%
%%%         v2.4, 14 Jun 1993 -- Minor update.  Changed the handling
%%%         of telephone numbers and room numbers so they are (a)
%%%         orthogonal and (b) both optional.
%%%
%%%         v2.3, 21 Apr 1993 -- Minor update.  Made changes to
%%%         masthead to bring it into line with the official
%%%         stationary.  Added middle initial to Zue's name, changed
%%%         ``Massachusetts'' to ``MA'' (blech), changed ``Phone'' to
%%%         ``Telephone'' and put it above the fax number.  Also added
%%%         a little more space between lines of masthead.
%%%
%%%         v2.2, 17 Feb 1993 -- Minor update.  Added V. Zue to list
%%%         of Associate directors.  Modified \startlabels by
%%%         replacing \xpt by a toplevel size changing command,
%%%         depending on \@ptsize. (Fix by Rainer Sch\"opf.)
%%%
%%%         v2.1, 4 Sep 1992 -- Minor update.  Added the \pslogo
%%%         command to specify where the MIT logo is kept.
%%%
%%%         v2.0, 3 Jul 1992 -- Major update.  Added support for a
%%%         bibliography.  Made changes so \date command would work as
%%%         expected.  Also made various updates to bring this in line
%%%         with the 25 mar 1992 version of letter.sty.
%%%
%%%         v1.1, 13 Sep 1990 -- original version by David Jones,
%%%         based on earlier anonymous work.",
%%%  }
%%% ====================================================================

% Based on:
%
% LETTER DOCUMENT STYLE -- Released 20 Sep 88
%    for LaTeX version 2.09
% Copyright (C) 1987 by Leslie Lamport

% Also based on work done by an anonymous hacker, who wrote the
% original code for producing the LCS masthead

\typeout{Document Style `lcsletter'. Version 3.01 <21 Oct 1993>.}

% PREPARING A FOREIGN LANGUAGE VERSION:
%
% This document style is for documents prepared in the English
% language.  To prepare a version for another language, various
% English words must be replaced.  All the English words that required
% replacement are indicated below, where we give the name of the
% command in which the words appear, and which must be redefined, with
% the actual words underlined.
%
% \cc:
\def\ccname{cc}
%           ~~
%
% \encl:
\def\enclname{encl}
%             ~~~~
%
% \page:
\def\pagename{Page}
%             ~~~~
%
% Running head:
\def\headtoname{To}
%               ~~
% \thebibliography:
\def\refname{References}
%            ~~~~~~~~~~
% \re:
\def\refername{Re}
%              ~~

% CHOOSING THE TYPE SIZE:
%
%  The type size option is handled by \def'ing \@ptsize to the
%  following values:
%       10pt : 0, 11pt : 1, 12pt : 2
%  Then loading the different fonts accordingly.
%

\def\@ptsize{0}                     % Default is 10pt.
\@namedef{ds@11pt}{\def\@ptsize{1}} % 11pt option.
\@namedef{ds@12pt}{\def\@ptsize{2}} % 12pt option.

%    ****************************************
%    *        DOCUMENT STYLE OPTIONS        *
%    ****************************************

% no twoside option
%
\@twosidefalse

% disable the fullpage style option
\def\ds@fullpage{}

%  draft option
%
% \overfullrule = 0pt              % Default is don't mark overfull
                                   % hboxes.
\def\ds@draft{\overfullrule 5\p@}  % Causes overfull hboxes to be
                                   % marked.

%  fullpage option

\newif\if@onepage \@onepagefalse

\def\ds@onepage{\@onepagetrue}

%   oldstyle option -- Use the old LCS masthead instead of the ugly
%   new one
%
%   The 'newstyle' optino is provided for symmetry.

\newif\if@oldstyle \@oldstylefalse

\def\ds@oldstyle{\@oldstyletrue}

\def\ds@newstyle{\@oldstylefalse}

% The \@options command causes the execution of every command \ds@FOO
% which is defined and for which the user typed the FOO option in his
% \documentstyle command.  For every option BAR he typed for which
% \ds@BAR is not defined, the file BAR.sty will be read after the
% present (main) .STY file is executed.

\@options

%  ****************************************
%  *               FONTS                  *
%  ****************************************
%

\lineskip 1pt            % \lineskip is 1pt for all font sizes.
\normallineskip 1pt
\def\baselinestretch{1}

% Each size-changing command \SIZE executes the command
%        \@setsize\SIZE{BASELINESKIP}\FONTSIZE\@FONTSIZE
% where:
%   BASELINESKIP = Normal value of \baselineskip for that size.
%                  (Actual value will be
%                       \baselinestretch * BASELINESKIP.)
%
%  \FONTSIZE     = Name of font-size command.  The currently available
%                  (preloaded) font sizes are: \vpt (5pt), \vipt
%                  (6pt), \viipt (etc.), \viiipt, \ixpt, \xpt, \xipt,
%                  \xiipt, \xivpt, \xviipt, \xxpt, \xxvpt.
%  \@FONTSIZE    = The same as the font-size command except with an
%                  '@' in front---e.g., if \FONTSIZE = \xivpt then
%                  \@FONTSIZE = \@xivpt.
%
% For reasons of efficiency that needn't concern the designer, the
% document style defines \@normalsize instead of \normalsize .  This
% is done only for \normalsize, not for any other size-changing
% commands.

\ifcase \@ptsize\relax   % 10pt option

\def\@normalsize{\@setsize\normalsize{12pt}\xpt\@xpt
\abovedisplayskip 10\p@ plus2\p@ minus5\p@
\belowdisplayskip \abovedisplayskip
\abovedisplayshortskip  \z@ plus3\p@
\belowdisplayshortskip  6\p@ plus3\p@ minus3\p@
\let\@listi\@listI}   % Setting of \@listi added 22 Dec 87

\def\small{\@setsize\small{11pt}\ixpt\@ixpt
\abovedisplayskip 8.5\p@ plus3\p@ minus4\p@
\belowdisplayskip \abovedisplayskip
\abovedisplayshortskip \z@ plus2\p@
\belowdisplayshortskip 4\p@ plus2\p@ minus2\p@
\def\@listi{\leftmargin\leftmargini %% Def of \@listi added 22 Dec 87
\topsep 4\p@ plus2\p@ minus2\p@\parsep 2\p@ plus\p@ minus\p@
\itemsep \parsep}}

\def\footnotesize{\@setsize\footnotesize{9.5pt}\viiipt\@viiipt
\abovedisplayskip 6\p@ plus2\p@ minus4\p@
\belowdisplayskip \abovedisplayskip
\abovedisplayshortskip \z@ plus\p@
\belowdisplayshortskip 3\p@ plus\p@ minus2\p@
\def\@listi{\leftmargin\leftmargini %% Def of \@listi added 22 Dec 87
\topsep 3\p@ plus\p@ minus\p@\parsep 2\p@ plus\p@ minus\p@
\itemsep \parsep}}

\def\scriptsize{\@setsize\scriptsize{8pt}\viipt\@viipt}
\def\tiny{\@setsize\tiny{6pt}\vpt\@vpt}
\def\large{\@setsize\large{14pt}\xiipt\@xiipt}
\def\Large{\@setsize\Large{18pt}\xivpt\@xivpt}
\def\LARGE{\@setsize\LARGE{22pt}\xviipt\@xviipt}
\def\huge{\@setsize\huge{25pt}\xxpt\@xxpt}
\def\Huge{\@setsize\Huge{30pt}\xxvpt\@xxvpt}

\or  % 11pt option

\def\@normalsize{\@setsize\normalsize{13.6pt}\xipt\@xipt
\abovedisplayskip 11\p@ plus3\p@ minus6\p@
\belowdisplayskip \abovedisplayskip
\abovedisplayshortskip  \z@ plus3\p@
\belowdisplayshortskip  6.5\p@ plus3.5\p@ minus3\p@
\let\@listi\@listI}   % Setting of \@listi added 22 Dec 87

\def\small{\@setsize\small{12pt}\xpt\@xpt
\abovedisplayskip 10\p@ plus2\p@ minus5\p@
\belowdisplayskip \abovedisplayskip
\abovedisplayshortskip  \z@ plus3\p@
\belowdisplayshortskip  6\p@ plus3\p@ minus3\p@
\def\@listi{\leftmargin\leftmargini %% Def of \@listi added 22 Dec 87
\topsep 6\p@ plus2\p@ minus2\p@\parsep 3\p@ plus2\p@ minus\p@
\itemsep \parsep}}

\def\footnotesize{\@setsize\footnotesize{11pt}\ixpt\@ixpt
\abovedisplayskip 8\p@ plus2\p@ minus4\p@
\belowdisplayskip \abovedisplayskip
\abovedisplayshortskip \z@ plus\p@
\belowdisplayshortskip 4\p@ plus2\p@ minus2\p@
\def\@listi{\leftmargin\leftmargini %% Def of \@listi added 22 Dec 87
\topsep 4\p@ plus2\p@ minus2\p@\parsep 2\p@ plus\p@ minus\p@
\itemsep \parsep}}

\def\scriptsize{\@setsize\scriptsize{9.5pt}\viiipt\@viiipt}
\def\tiny{\@setsize\tiny{7pt}\vipt\@vipt}
\def\large{\@setsize\large{14pt}\xiipt\@xiipt}
\def\Large{\@setsize\Large{18pt}\xivpt\@xivpt}
\def\LARGE{\@setsize\LARGE{22pt}\xviipt\@xviipt}
\def\huge{\@setsize\huge{25pt}\xxpt\@xxpt}
\def\Huge{\@setsize\Huge{30pt}\xxvpt\@xxvpt}

\or  % 12pt option

\def\@normalsize{\@setsize\normalsize{15pt}\xiipt\@xiipt
\abovedisplayskip 12\p@ plus3\p@ minus7\p@
\belowdisplayskip \abovedisplayskip
\abovedisplayshortskip  \z@ plus3\p@
\belowdisplayshortskip  6.5\p@ plus3.5\p@ minus3\p@
\let\@listi\@listI}   % Setting of \@listi added 22 Dec 87

\def\small{\@setsize\small{13.6pt}\xipt\@xipt
\abovedisplayskip 11\p@ plus3\p@ minus6\p@
\belowdisplayskip \abovedisplayskip
\abovedisplayshortskip  \z@ plus3\p@
\belowdisplayshortskip  6.5\p@ plus3.5\p@ minus3\p@
\def\@listi{\leftmargin\leftmargini %% Def of \@list i added 22 Dec 87
\parsep 4.5\p@ plus2\p@ minus\p@
            \itemsep \parsep
            \topsep 9\p@ plus3\p@ minus5\p@}}

\def\footnotesize{\@setsize\footnotesize{12pt}\xpt\@xpt
\abovedisplayskip 10\p@ plus2\p@ minus5\p@
\belowdisplayskip \abovedisplayskip
\abovedisplayshortskip  \z@ plus3\p@
\belowdisplayshortskip  6\p@ plus3\p@ minus3\p@
\def\@listi{\leftmargin\leftmargini %% Def of \@list i added 22 Dec 87
\topsep 6\p@ plus2\p@ minus2\p@\parsep 3\p@ plus2\p@ minus\p@
\itemsep \parsep}}

\def\scriptsize{\@setsize\scriptsize{9.5pt}\viiipt\@viiipt}
\def\tiny{\@setsize\tiny{7pt}\vipt\@vipt}
\def\large{\@setsize\large{18pt}\xivpt\@xivpt}
\def\Large{\@setsize\Large{22pt}\xviipt\@xviipt}
\def\LARGE{\@setsize\LARGE{25pt}\xxpt\@xxpt}
\def\huge{\@setsize\huge{30pt}\xxvpt\@xxvpt}
\let\Huge=\huge
\fi

\normalsize  % Choose the normalsize font.

%  ****************************************
%  *            PAGE LAYOUT               *
%  ****************************************
%
% All margin dimensions measured from a point one inch from top and
% side of page.  Dimensions shrink by about 2 percent

% SIDE MARGINS:
\oddsidemargin   0pt   % Left margin on odd-numbered pages.
\evensidemargin  0pt   % Left margin on even-numbered pages.
\marginparwidth  90pt  % Width of marginal notes.
\marginparsep    11pt  % Horizontal space between outer margin and
                       % marginal note
\marginparpush 5pt     % Minimum vertical space between marginal
                       % notes.

% VERTICAL SPACING:
                         % Top of page:
\topmargin 27pt          %    Nominal distance from top of page to top
                         %    of box containing running head.
\headheight 12pt         %    Height of box containing running head.
\headsep 25pt            %    Space between running head and text.
% \topskip = 10pt        %    '\baselineskip' for first line of page.
                         % Bottom of page:
\footheight 12pt         %    Height of box containing running foot.
\footskip25pt            %    Distance from baseline of box containing
                         %    foot to baseline of last line of text.

% DIMENSION OF TEXT:

\textheight525pt         % Height of text (including footnotes and
                         % figures, excluding running head and foot).
\textwidth 471pt         % Width of text line.
                         % For two-column mode:
\columnsep 10pt          %    Space between columns
\columnseprule 0pt       %    Width of rule between columns.

\raggedbottom             % 'ragged bottom' (all pages set to natural
                          % height, with no stretch or shrinkage)

% Now we check to see if the onepage setting is in effect and, if so,
% changed the page layout parameters accordingly.

\if@onepage
    \if@oldstyle
        \advance\textheight by\headheight \headheight0pt
        \advance\textheight by\headsep \headsep0pt
    \fi
    \advance\textheight by\footheight \footheight0pt
    \advance\textheight by\footskip \footskip0pt
\fi

% FOOTNOTES:

\footnotesep 12pt    % Height of strut placed at the beginning of
                     % every footnote.
\skip\footins 10pt plus 2pt minus 4pt  % Space between last line of
                                       % text and top of first
                                       % footnote.

% FLOATS:
%   The following items must be defined, even though there are no
%   floats in this style.
\floatsep 12pt plus 2pt minus 2pt
\textfloatsep  20pt plus 2pt minus 4pt
\intextsep 12pt plus 2pt minus 2pt
\dblfloatsep 12pt plus 2pt minus 2pt
\dbltextfloatsep 20pt plus 2pt minus 4pt
\@maxsep 20pt
\@dblmaxsep 20pt
\@fptop 0pt plus 1fil
\@fpsep 8pt plus 2fil
\@fpbot 0pt plus 1fil
\@dblfptop 0pt plus 1fil
\@dblfpsep 8pt plus 2fil
\@dblfpbot 0pt plus 1fil

%    ****************************************
%    *           LETTER COMMANDS            *
%    ****************************************
%
% The following declarations, shown with examples, give information
% about the sender:
%
% \name{Dr. L. User} : to be used for the return address on the
%          envelope.
%
% \signature{Larry User} : goes after the closing.
%
% \address{3245 Foo St.\\Gnu York} : used as the return address in the
%          letter and on the envelope.  If not declared, then an
%          institutional standard address is used.
%
% \location{Room 374} : Acts as modifier to the standard institutional
%          address.
%
% \telephone{(415)123-4567} : Just in case some style puts it on the
%          letter.
%
% The \makelabels declaration causes mailing labels to be made.  It
% must go before the \begin{document} command.
%
% The letter environment: creates a new letter, starting from page 1.
% (The first page is unnumbered.)  It has a single argument, which is
% the adressee and his address, as in
%    \begin{letter}{Sam Jones \\
%                   Institute for Retarded Study\\ Princeton, N.J.}
%
% Local declarations, such as \address, can follow the \begin{letter}.
%
% Text is begun with the \opening command, whose argument generates
% the salutation, as in
%           \opening{Dear Henry,}
% The body of the letter follows, ended by a \closing command, as in
%            \closing{Yours truly,}
% The 'signature' is provided automatically.
%
% After the \closing you can put arbitrary stuff, which is typeset
% with \parindent = 0 and no page breaking.  Commands designed for use
% after the closing are:
%
%  \cc{Tinker\\Evers\\Chance} -- which produces:
%        cc: Tinker
%            Evers
%            Chance
%
%  \encl{Foo(2)\\Bar} -- which produces:
%        encl: Foo(2)
%              Bar
%
%
%  DOCUMENT STYLE PARAMETERS AND COMMANDS.  CHANGE THESE TO
%  CUSTOMIZE LETTER STYLE.
%
%  \opening{Dear Mr. Foo:}- Command to produce everything up to and
%     including the 'Dear Mr. Foo:' and a \par command that follows.
%     Since there's a \vfil at the bottom of every page, it can add
%     vertical fil to position a short letter.  It should use the
%     following commands:
%
%     \toname       : name part of 'to' address.  Will be one line
%                     long.
%     \toaddress    : address part of 'to' address. Lines separated
%                     by \\.
%     \fromname     : name of sender.
%     \fromaddress  : argument of current \address declaration--null
%                     if none.  Should use standard institutional
%                     address if null.
%     \fromlocation : argument of current \location declaration--null
%                     if none.
%     \telephonenum : argument of current \telephone declaration--null
%                     if none.
%
%     Note that  \ifx\foo\@empty  tests for a null value of \foo.
%
%  \closing{TXT} : Generates the closing matter, and the signature.
%     An obvious thing to do is to use a \parbox for the closing and
%     the signature.  Should use the following:
%
%     \fromsig    : argument of current \signature declaration or, if
%                   null, the \fromname .
%     \stopbreaks : a macro that inhibits page breaking.
%
%  \cc{ARG} and \encl{ARG} : obvious use of a \parbox[t] .
%
%  \ps : The only thing that this needs to do is call \startbreaks,
%        which allows page breaking again.
%
%  \stopletter : Command called by \endletter to do the following:
%     * Add any desired  fil  or other material at the end of the
%       letter.
%     * Define \returnaddress to be the return address for the mailing
%       label.  More precisely, it is the first argument of the
%       \mlabel command described below. It should be \def'd to null
%       if the return address doesn't appear on the labels.  Any
%       command, other than \\, that should not be expanded until the
%       \mlabel command is actually executed must be preceded by
%       \protect.  Whenever possible, \protect commands in the
%       definition of \returnaddress---it's much more efficient that
%       way.  In particular, when the standard return address is used,
%       you should \def \returnaddress to something like
%       \protect\standardreturnaddress .
%
% CUSTOMIZING THE LABELS
%
% Commands for generating the labels are put on the .AUX file, which
% is read in and processed by the \end{document} command.  You have to
% define the following two commands:
%
%    \startlabels : Should reset the page layout parameters if
%                   necessary.
%
%    \mlabel{RETURN ADDRESS}{TO ADRESS} : Command to generate a single
%        label.
%

%    ****************************************
%    *        THE LCS LETTER FORMAT         *
%    ****************************************
%
% The author of much of the following code is unknown.  No attempt has
% been made to my code separate from the original code.

% We need the following size changing commands, which may not be
% defined if you're using the new font mechanism of Mittlebach and
% Sch\"opf.  Yes, the definitions look silly, but they do work.

% \def\scriptsize{\@setsize\scriptsize{9.5pt}\viiipt\@viiipt}
% \@ifundefined{NAME}{YES}{NO}

\@ifundefined{viiipt}%
    {\def\viiipt{\@setsize\viiipt{9.5pt}\viiipt\@viiipt}}{}
\@ifundefined{xpt}%
    {\def\xpt{\@setsize\xpt{12pt}\xpt\@xpt}}{}
\@ifundefined{xviipt}%
    {\def\xviipt{\@setsize\xviipt{22pt}\xviipt\@xviipt}}{}

\newdimen\@headwidth
\@headwidth = 7.5in

\newdimen\@raisehead
\@raisehead = 0.9in

\newdimen\predateskip

\predateskip = 8pt

\def\@headline#1{\hbox to\hsize{\hss\hbox to\@headwidth{#1}\hss}}

\newbox\masthead

% The \pslogo command is used to specify the location of the
% PostScript file containing the MIT logo.

\def\pslogo{\def\@pslogo}
\def\@pslogo{mitlogo.ps}

\def\@letterhead{%
    \if@oldstyle
        \old@letterhead
    \else
        \new@letterhead
    \fi
}

\def\@sbreak{\break\strut}

\font\head@rm=cmss8
\font\head@bf=cmssbx10 at8pt
\font\head@tt=cmtt8
\font\head@it=cmssi8
\let \head@sl\head@it

\def\@headfonts{%
    \let\rm\head@rm
    \let\bf\head@bf
    \let\tt\head@tt
    \let\it\head@it
    \let\sl\head@sl
}

\def\new@letterhead{%
    \null
    \vskip-.9in
    \moveleft.525in
    \hbox{%
    \parindent=0pt
    \rightskip = 0pt plus 1 fill\relax
    \@headfonts\rm
    \baselineskip=9.5pt
    \setbox\strutbox\hbox{\vrule\@height.7\baselineskip
        \@depth.3\baselineskip \@width\z@}%
    \rlap{\vtop{\strut Massachusetts\@sbreak
                       Institute\@sbreak
                       of Technology}}%
%    \rlap{\special{psfile=newlogo.ps}}%
    \rlap{\@lcslogo}%
    \hskip 1.7in
    \rlap{\vtop{\bf\strut Laboratory for\@sbreak
                          Computer\@sbreak
                          Science}}%
    \hskip 1.1in
    \rlap{\vtop{\strut 545\@sbreak
                       Technology\@sbreak
                       Square}}%
    \hskip .9in
    \rlap{\vtop{\strut Cambridge,\@sbreak
                       Massachusetts\@sbreak
                       \@zip}}%
    \hskip 1.1in
    \rlap{\vtop{%
        \strut
        \ifx\telephonenum\@empty \else
            Telephone \telephonenum
        \fi
        \ifx\@fax\@empty \else
            \@sbreak Fax \@fax
        \fi
        \ifx\fromlocation\@empty \else
             \@sbreak Room \fromlocation
        \fi
        \ifx\@netaddress\@empty \else
            \@sbreak {\tt \@netaddress}
        \fi
    }}%
    \hskip 1.8in
    \rlap{\vtop{\strut M.L. Dertouzos\@sbreak Director\@sbreak\@sbreak
                       R.L. Rivest\@sbreak A. Vezza\@sbreak
                       W.V. Zue \@sbreak Associate Directors}}%
}
}

\def\old@letterhead{%
    \mbox{}%
    \vskip -\topmargin
    \vskip -\headsep
    \vskip -\@raisehead
    \@headline{\xpt\sc massachusetts institute of technology\hfil}%
    \kern .72in
    \@headline{\xviipt\special{psfile=\@pslogo}\hfil Laboratory
        for Computer Science\hfil}%
    \kern -5pt
    \@headline{\vbox{\hrule height1.4pt width\@headwidth}}%
    \kern -3pt
    \@headline{\viiipt M.L. Dertouzos, Director
        \hfil R.L. Rivest, A. Vezza, and V. Zue, Associate Directors
        \hfil 545 Technology Square, Cambridge, Massachusetts 02139%
    }
    \if@memo\else
        \ifx\@fax\@empty \else
            \kern -4.0pt%
            \@headline{\viiipt\hfil Fax: \@fax}%
        \fi
        \kern -4.0pt
        \@headline{%
            \viiipt\hfil
            \ifx\fromlocation\@empty \else
                Room \fromlocation,\hspace{.75em}%
            \fi
            \ifx\telephonenum\@empty
                \settowidth{\dimen255}{0000}%
                Phone: (617) 253--\hbox to \dimen255{\hfil}%
            \else
                Phone: \telephonenum
            \fi
        }%
        \kern -4.0pt
        \@headline{%
            \viiipt\hfil
            \ifx\@netaddress\@empty \else
                \@netaddress
            \fi
        }%
    \fi
    \vskip\predateskip
}

\def\fax{\def\@fax}
\def\@fax{(617) 258--8682}

\def\zip{\def\@zip}
\def\@zip{02139-3539}

\def\netaddress{\def\@netaddress}
\def\@netaddress{}

\def\room{\def\fromlocation}

\def\extension#1{\def\telephonenum{(617) 253--#1}}

\def\re{\def\@retext}
\def\@retext{}

%    ****************************************
%    *             THE LCS LOGO             *
%    ****************************************

%%  The LCS logo is implemented here as a PostScript literal special.
%%  This works with dvips, but may need modification for other device
%%  drivers.

\def\@lcslogo{%
    \special{"
        gsave
        100 38 translate
        4.5 setlinewidth
        /drawline {newpath
            -50 moveto
            0 200 rlineto
          stroke
        } def
        /drawbox {
            gsave
                translate
                45 rotate
                newpath
                    -27 -27 moveto
                    0 54 rlineto
                    54 0 rlineto
                    0 -54 rlineto
                    closepath
                clip
                45 rotate
                -35.9338 7.1867 35.9338 { drawline } for
            grestore
        } def
    0 0 drawbox
    90 rotate
    0 9 2 sqrt mul drawbox
    grestore
    }%
}

%    ****************************************
%    *        THE SRI LETTER FORMAT         *
%    ****************************************
%
% Much of the following is copied from the letter format in the
% TeXbook.

\newdimen\longindentation
\longindentation=.5\textwidth
\newdimen\indentedwidth
\indentedwidth=\textwidth
\advance\indentedwidth -\longindentation

\newdimen\closingindentation
\closingindentation=\longindentation

\def\@resetfont{\csname reset@font\endcsname}

\def\opening{%
    \if@memo\else
        \expandafter\@letopening
    \fi
}

\def\@letopening#1{%
    \ifx\@empty\fromaddress
        \thispagestyle{empty}% was firstpage --dmj 9/15/90
        \@letterhead
        \vskip 1ex plus .5cm
        \noindent\hspace*{\closingindentation}\@date\par
        \vskip 5ex plus 1.5cm minus 2.5ex
    \else
        \def\@texttop{\ifnum\c@page=1\vskip0pt plus.00006fil\relax\fi}%
        \thispagestyle{empty}%
        \vskip 0pt plus 2cm
        {\raggedleft
            \begin{tabular}{l}%
                \frenchspacing
                \ignorespaces\fromaddress \\*[2\parskip]%
                \@date
            \end{tabular}\par}%
        \vskip 5ex plus 1cm
    \fi
    \vspace{2\parskip}%
    {\frenchspacing\raggedright \toname \\ \toaddress \par}%
    \ifx\@empty\@retext \else
       \par \vskip10pt \noindent
       \parbox[t]{\textwidth}{\@hangfrom{\@resetfont\rm \refername: }%
                              \ignorespaces\@retext\strut}%
       \let\@retext\@empty
       \par
    \fi
    \vspace{2\parskip}%
    \frenchspacing\noindent\ignorespaces #1\par\nobreak
}

\def\@memopening{%
    \thispagestyle{empty}%
    \@letterhead
    \vskip 1ex plus .5cm
    \vspace{2\parskip}%
    \begin{tabular}{@{}ll}%
        \toname\\
        \toaddress
    \end{tabular}%
    \vspace{2\parskip}%
}

\long\def\closing#1{%
    \par\nobreak\vspace{\parskip}%
    \stopbreaks
    \noindent\hspace*{\closingindentation}%
    \parbox{\indentedwidth}{\raggedright
        \frenchspacing\ignorespaces #1\\[6\medskipamount]%
        \ifx\@empty\fromsig
            \fromname
        \else
            \fromsig
        \fi\strut}%
    \par
}

\def\ps{\par\startbreaks}

\def\cc#1{\par\noindent
\parbox[t]{\textwidth}{\@hangfrom{\@resetfont\rm \ccname: }%
                       \ignorespaces #1\strut}\par}

\def\encl#1{\par\noindent
\parbox[t]{\textwidth}{\@hangfrom{\@resetfont\rm \enclname: }%
                       \ignorespaces #1\strut}\par}

\def\stopletter{\vskip 0pt plus 1fil}

%    ****************************************
%    *            THE MEMO FORMAT           *
%    ****************************************
%

\newif\if@memo\@memofalse

\def\memo{\@memotrue\letter}

\let\endmemo\endletter

% Labels

\def\returnaddress{}
\newcount\labelcount

% The following \startlabels command sets things up for producing
% labels in two columns of five 2" X 4-1/4" labels each, suitable for
% reproducing onto Avery brand number 5352 address labels.

% 91/06/15 RmS
% Replace \xpt by toplevel size changing command, depending on
% \@ptsize.

\def\startlabels{\labelcount\z@
\pagestyle{empty}%
\let\@texttop\relax
\topmargin -50\p@
\headsep \z@
\oddsidemargin -35\p@
\evensidemargin -35\p@
\textheight 10in
\@colht\textheight  \@colroom\textheight \vsize\textheight
\textwidth 550\p@
\columnsep 25\p@
\ifcase \@ptsize\relax
  \normalsize
\or
  \small
\or
  \footnotesize
\fi
\baselineskip \z@
\lineskip \z@
\boxmaxdepth \z@
\parindent \z@      %% corrected 3/5/86
\twocolumn\relax}

\def\mlabel#1#2{%
    \setbox0\vbox{\parbox[b]{3.6in}{\strut\ignorespaces #2}}%
    \vbox to 2in{\vss \box0 \vss}}

%    ****************************************
%    *     THE GENERIC LETTER COMMANDS      *
%    ****************************************
%

%% FMi & RmS: added \leavevmode to catch empty argument, 16 Aug 91
%% RmS ...and added \ignorespaces, 21 Feb 92

\long\def\letter#1{%
    \newpage
    \c@page\@ne
%%  \interlinepenalty=200 % smaller than the TeXbook value
    \interlinepenalty=0     % \interlinepenalty=0 seems to produce
    \@processto{\leavevmode\ignorespaces #1}% better results --dmj
    \if@memo\@memopening\fi                 % 9/15/90
}

\def\endletter{\stopletter\@@par\pagebreak\@@par
    \if@labels\if@filesw
      \begingroup
         \let\\=\relax
         \def\protect##1{\string##1\space}%
         \immediate\write\@auxout{\string\mlabel{\returnaddress}{\toname
             \\\toaddress}}%
      \endgroup
  \fi\fi}

% \@processto gets the \toname and \toaddress from the letter
% environment's macro.
%
\long\def\@processto#1{\@xproc #1\\@@@\ifx\toaddress\@empty
    \else \@yproc #1@@@\fi}
\long\def\@xproc #1\\#2@@@{\def\toname{#1}\def\toaddress{#2}}
\long\def\@yproc #1\\#2@@@{\def\toaddress{#2}}

\def\stopbreaks{\interlinepenalty \@M
   \def\par{\@@par\nobreak}\let\\=\@nobreakcr
   \let\vspace\@nobreakvspace}

\def\@nobreakvspace{\@ifstar{\@nobreakvspacex}{\@nobreakvspacex}}

\def\@nobreakvspacex#1{\ifvmode\nobreak\vskip #1\relax\else
               \@bsphack\vadjust{\nobreak\vskip #1}\@esphack\fi}

\def\@nobreakcr{\vadjust{\penalty\@M}\@ifstar{\@xnewline}{\@xnewline}}

\def\startbreaks{\let\\=\@normalcr
%%    \interlinepenalty 200 % 0 seems to be better --dmj 9/15/90
\interlinepenalty0\def\par{\@@par\penalty 200\relax}}
%% \relax added 20 Sep 88

\def\name{\def\fromname}
\def\fromname{}

\def\signature{\def\fromsig}
\def\fromsig{}

\long\def\address{\def\fromaddress}
\def\fromaddress{}

\def\location{\def\fromlocation}
\def\fromlocation{}

\def\telephone{\def\telephonenum}
\def\telephonenum{}

% Now we set the default telephone number to the general LCS number.
\extension{5851}

% \document redefined so it writes '\startlabels\@startlabels' on the
% AUX file if it's making one.

% Starred lines below provided by Piet van Oostrum (piet@cs.ruu.nl) to
% make letter work with Mittelbach and Scho\"pf's font selection
% scheme.
\def\document{\endgroup
  \@colht\textheight \@colroom\textheight \vsize\textheight
   \columnwidth\textwidth \@clubpenalty\clubpenalty
   \if@twocolumn \advance\columnwidth -\columnsep
      \divide\columnwidth\tw@ \hsize\columnwidth \@firstcolumntrue
   \fi
  \hsize\columnwidth \linewidth\hsize
  \begingroup\@floatplacement\@dblfloatplacement
    \makeatletter\let\@writefile\@gobbletwo
    \let\startlabels\relax
    \let\@startlabels\relax
    \let\mlabel\@gobbletwo
    \@input{\jobname.aux}\endgroup
  \if@filesw
    \immediate\openout\@mainaux=\jobname.aux
    \immediate\write\@mainaux{\relax}%
    \if@labels
    \immediate\write\@mainaux{\string\startlabels\string\@startlabels}%
    \fi
  \fi
  \csname process@table\endcsname %% **
  \let\glb@currsize\@empty  %% Force \baselineskip initialisation.
  \def\do##1{\let ##1\@notprerr}%
  \@preamblecmds
  \let\do\noexpand
  \ifx\undefined\selectfont\else %% **
  \gdef\xpt{\family{cmr}\series{m}\shape{n}\size{10}{12pt}\selectfont}%
  \fi %%**
  \@normalsize\everypar{}\@noskipsecfalse}

% Redefine \enddocument so it outputs the last page of labels, if
% necessary.

\def\enddocument{\@checkend{document}%
    \newpage
    \begingroup
        \if@filesw \immediate\closeout\@mainaux
            \if@labels \else
                \let\startlabels\relax
                \let\@startlabels\relax
                \let\mlabel\@gobbletwo
            \fi
            \def\@namedef##1##2{\@tempa=\@tempa}%
            \def\newlabel{\@testdef r}%
            \def\bibcite{\@testdef b}\@tempswafalse
            \makeatletter\input \jobname.aux
            \if@tempswa
                \@warning{Label(s) may have changed.  Rerun to get
                          cross-references right}%
            \fi
            \clearpage
        \fi
    \endgroup
    \deadcycles\z@\@@end}

\newif\if@labels \@labelsfalse

\def\makelabels{\@labelstrue\@fileswtrue}

{\def\do{\noexpand\do\noexpand}
    \xdef\@preamblecmds{\@preamblecmds \do \makelabels}}

\def\@startlabels{}

%    ****************************************
%    *            PAGE STYLES               *
%    ****************************************
%

% The letter style sets \@texttop to \vskip 0pt plus .00006fil on the
% first page of a letter, which centers a short letter on the page.
% This fil value may have to be changed for other letterheads.

%%  \def\@texttop{\ifnum\c@page=1\vskip 0pt plus .00006fil\relax\fi}

\let\@texttop\relax

\def\ps@headings{\def\@oddhead{\sl \headtoname{} \ignorespaces\toname
    \hfil \@date
    \hfil \pagename{} \thepage}\def\@oddfoot{}}

\def\ps@empty{\def\@oddhead{}\def\@oddfoot{}%
\def\@evenhead{}\def\@evenfoot{}}

\let\ps@firstpage\ps@empty

\def\ps@plain{\def\@oddhead{}\def\@oddfoot{\rm\hfil\thepage
     \hfil}\def\@evenhead{}\let\@evenfoot\@oddfoot}

%  ****************************************
%  *           PARAGRAPHING               *
%  ****************************************
%
\parskip .7em                      % Extra vertical space between
                                   % paragraphs.
\parindent 0pt                     % Width of paragraph indentation.
\topsep .4em                       % Extra vertical space, in addition
                                   % to \parskip, added above and
                                   % below list and paragraphing
                                   % environments.
\partopsep 0pt                     % Extra vertical space, in addition
                                   % to \parskip and \topsep, added
                                   % when user leaves blank line
                                   % before environment.
\itemsep .4em                      % Extra vertical space, in addition
                                   % to \parskip, added between list
                                   % items.

% The following page-breaking penalties are defined

\@lowpenalty   51  % Produced by \nopagebreak[1] or \nolinebreak[1]
\@medpenalty  151  % Produced by \nopagebreak[2] or \nolinebreak[2]
\@highpenalty 301  % Produced by \nopagebreak[3] or \nolinebreak[3]

\@beginparpenalty -\@lowpenalty % Before a list or paragraph
                                % environment.
\@endparpenalty   -\@lowpenalty % After a list or paragraph
                                % environment.
\@itempenalty     -\@lowpenalty % Between list items.

% \clubpenalty         % 'Club line'  at bottom of page.
% \widowpenalty        % 'Widow line' at top of page.
% \displaywidowpenalty % Math display widow line.
% \predisplaypenalty   % Breaking before a math display.
% \postdisplaypenalty  % Breaking after a math display.
% \interlinepenalty    % SET BY THE LETTER COMMANDS
% \brokenpenalty       % Breaking after a hyphenated line.

%    ****************************************
%    *                LISTS                 *
%    ****************************************
%

% The following commands are used to set the default values for the
% list environment's parameters. See the LaTeX manual for an
% explanation of the meanings of the parameters.  Defaults for the
% list environment are set as follows.  First, \rightmargin,
% \listparindent and \itemindent are set to 0pt.  Then, for a Kth
% level list, the command \@listK is called, where 'K' denotes 'i',
% 'ii', ... , 'vi'.  (I.e., \@listiii is called for a third-level
% list.)  By convention, \@listK should set \leftmargin to
% \leftmarginK.
%
% For efficiency, level-one list's values are defined at top level,
% and \@listi is defined to be a no-op.

\leftmargini   2.5em
\leftmarginii  2.2em    % > \labelsep + width of '(m)'
\leftmarginiii 1.87em   % > \labelsep + width of 'vii.'
\leftmarginiv  1.7em    % > \labelsep + width of 'M.'
\leftmarginv   1em
\leftmarginvi  1em

\leftmargin\leftmargini
\labelwidth\leftmargini\advance\labelwidth-\labelsep
\labelsep 5pt
\parsep 0pt
\let\@listi\relax

\def\@listii{\leftmargin\leftmarginii
   \labelwidth\leftmarginii\advance\labelwidth-\labelsep}

\def\@listiii{\leftmargin\leftmarginiii
    \labelwidth\leftmarginiii\advance\labelwidth-\labelsep
    \topsep .2em
    \itemsep \topsep}

\def\@listiv{\leftmargin\leftmarginiv
     \labelwidth\leftmarginiv\advance\labelwidth-\labelsep}

\def\@listv{\leftmargin\leftmarginv
     \labelwidth\leftmarginv\advance\labelwidth-\labelsep}

\def\@listvi{\leftmargin\leftmarginvi
     \labelwidth\leftmarginvi\advance\labelwidth-\labelsep}

% ENUMERATE
%  Enumeration is done with four counters: enumi, enumii, enumiii and
%  enumiv, where enumN controls the numbering of the Nth level
%  enumeration.  The label is generated by the commands \labelenumi
%  ... \labelenumiv.  The expansion of \p@enumN\theenumN defines the
%  output of a \ref command.

\def\labelenumi{\theenumi.}
\def\theenumi{\arabic{enumi}}

\def\labelenumii{(\theenumii)}
\def\theenumii{\alph{enumii}}
\def\p@enumii{\theenumi}

\def\labelenumiii{\theenumiii.}
\def\theenumiii{\roman{enumiii}}
\def\p@enumiii{\theenumi(\theenumii)}

\def\labelenumiv{\theenumiv.}
\def\theenumiv{\Alph{enumiv}}
\def\p@enumiv{\p@enumiii\theenumiii}

% ITEMIZE
%  Itemization is controlled by four commands: \labelitemi,
%  \labelitemii, \labelitemiii, and \labelitemiv, which define the
%  labels of the various itemization levels.

\def\labelitemi{$\m@th\bullet$}
\def\labelitemii{\bf --}
\def\labelitemiii{$\m@th\ast$}
\def\labelitemiv{$\m@th\cdot$}

% VERSE
%  The verse environment is defined by making clever use of the list
%  environment's parameters.  The user types \\ to end a line.  This
%  is implemented by \let'in \\ equal \@centercr.
%
\def\verse{\let\\=\@centercr
  \list{}{\itemsep\z@ \itemindent -15\p@\listparindent \itemindent
          \rightmargin\leftmargin\advance\leftmargin 15\p@}\item[]}
\let\endverse\endlist

% QUOTATION
%   Fills lines
%   Indents paragraph
%
\def\quotation{\list{}{\listparindent 1.5em
    \itemindent\listparindent
    \rightmargin\leftmargin}\item[]}
\let\endquotation=\endlist

% QUOTE -- same as quotation except no paragraph indentation,
%
\def\quote{\list{}{\rightmargin\leftmargin}\item[]}
\let\endquote=\endlist

% DESCRIPTION
%
%  To change the formatting of the label, you must redefine
%  \descriptionlabel.

\def\descriptionlabel#1{\hspace\labelsep \bf #1}
\def\description{\list{}{\labelwidth\z@ \itemindent-\leftmargin
       \let\makelabel\descriptionlabel}}

\let\enddescription\endlist

%    ****************************************
%    *         OTHER ENVIRONMENTS           *
%    ****************************************
%
%
% THEOREM
% \@begintheorem ... \@endtheorem are the commands executed at the
% beginning and end of a (user-defined) theorem-like environment.
% Except \@opargbegintheorem is executed when an optional argument is
% given.  Cf. LATEX.TEX.

\def\@begintheorem#1#2{\it \trivlist
    \item[\hskip \labelsep{\bf #1\ #2}]}
\def\@opargbegintheorem#1#2#3{\it \trivlist
      \item[\hskip \labelsep{\bf #1\ #2\ (#3)}]}
\def\@endtheorem{\endtrivlist}


% EQUATION and EQNARRAY
%
% \newcounter{equation}
%  Default is for left-hand side of equations to be flushleft.
%  To make them flushright, do:
%  \let\@eqnsel = \hfil
%

\def\theequation{\arabic{equation}}

% \jot = 3pt         % Extra space added between lines of an eqnarray
                     % environment

\arraycolsep 5pt     % Half the space between columns in an array
                     % environment.
\tabcolsep 6pt       % Half the space between columns in a tabular
                     % environment.
\arrayrulewidth .4pt % Width of rules in array and tabular
                     % environment.
\doublerulesep 2pt   % Space between adjacent rules in array or
                     % tabular env.

% TABBING
%
\tabbingsep \labelsep   % Space used by the \' command.  (See LaTeX
                        % manual.)

% MINIPAGE
%  \@minipagerestore is called upon entry to a minipage environment to
%  set up things that are to be handled differently inside a minipage
%  environment. In the current styles, it does nothing.
%
% \skip\@mpfootins : plays same role for footnotes in a minipage as
%                    \skip\footins does for ordinary footnotes

\skip\@mpfootins = \skip\footins

% FRAMEBOX
%
\fboxsep = 3pt    % Space left between box and text by \fbox and
                  % \framebox.
\fboxrule = .4pt  % Width of rules in box made by \fbox and \framebox.

%    ****************************************
%    *             FOOTNOTES                *
%    ****************************************
%
% \footnoterule is a macro to draw the rule separating the footnotes
% from the text.  It should take zero vertical space, so it needs a
% negative skip to compensate for any positive space taken by the
% rule.  (See PLAIN.TEX.)

\def\footnoterule{\kern-1\p@
  \hrule width .4\columnwidth
  \kern .6\p@}                 % The \hrule has default height of .4pt.

% \newcounter{footnote}

% The numbering style (arabic, alph, etc.) for ordinary footnotes is
% defined by the macro \thefootnote.
%
%   \@makefntext{NOTE} :
%        Must produce the actual footnote, using \@thefnmark as the
%        mark of the footnote and NOTE as the text.  It is called when
%        effectively inside a \parbox, with \hsize = \columnwidth.

\long\def\@makefntext#1{\noindent %Macro to make the text of a footnote
    \hangindent 5\p@\hbox
    to5\p@{\hss $\m@th^{\@thefnmark}$}#1}

% \@makefnmark : A macro to generate the footnote marker that goes
%                in the text.  Default definition used.

%    ****************************************
%    *         FIGURES AND TABLES           *
%    ****************************************
%
% Float placement parameters set by some commands.  Easier to define
% them than change the commands.

\c@topnumber=2
\def\topfraction{.7}
\c@bottomnumber=1
\def\bottomfraction{.3}
\c@totalnumber=3
\def\textfraction{.2}
\def\floatpagefraction{.5}
\c@dbltopnumber= 2
\def\dbltopfraction{.7}
\def\dblfloatpagefraction{.5}

%    ****************************************
%    *             BIBLIOGRAPHY             *
%    ****************************************
%
% The thebibliography environment executes the following commands:
%
%  \def\newblock{\hskip .11em plus .33em minus .07em} --
%      Defines the `closed' format, where the blocks (major units of
%      information) of an entry run together.
%
%  \sloppy  -- Used because it's rather hard to do line breaks in
%      bibliographies,
%
%  \sfcode`\.=1000\relax --
%      Causes a `.' (period) not toproduce an end-of-sentence space.

\def\thebibliography#1{\addvspace{3.5ex plus 1ex minus .2ex}%
    {\Large\bf \refname}\list
  {[\arabic{enumi}]}{\settowidth\labelwidth{[#1]}\leftmargin\labelwidth
    \advance\leftmargin\labelsep
    \usecounter{enumi}}%
    \def\newblock{\hskip .11em plus .33em minus .07em}%
    \sloppy\clubpenalty4000\widowpenalty4000
    \sfcode`\.=1000\relax}

\let\endthebibliography=\endlist

% \def\@biblabel#1{[#1]\hfill}  % Produces the label for a
                                % \bibitem[...] command.
% \def\@cite#1{[#1]}            % Produces the output of the \cite
                                % command.

%    ****************************************
%    *            MISCELLANEOUS             *
%    ****************************************
%
% DATE
%
\def\today{\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\day, \number\year}

%    ****************************************
%    *           INITIALIZATION             *
%    ****************************************
%
% Default initializations

\smallskipamount=.5\parskip  % These values are used by the letter
                             % macros.
\medskipamount=\parskip
\bigskipamount=2\parskip

\ps@plain                    % 'plain' page style
\pagenumbering{arabic}       % Arabic page numbers
\onecolumn                   % Single-column
%%\@fileswfalse              % Inhibits writing of .AUX file.

\endinput
