%\filename{lettermacros.tex}
%\edited{last by stolfi on Tue Apr 21 03:41:34 1987}

% TEX macros and layout parameters for letters
%   To be \input after loading a paper format (such as am10fmt)

\catcode`@=11 \endlinechar=-1

% LETTER TITLES

  \message{letter titles ...}

  % Date, signature, etc.

    %  Usage:
    %    \whitehousehead
    %    \date{Washington, DC, February 30, 1984}
    %    \sendto{M. Gorbachev
    %       Big Boss at the Kremlin
    %       Moscow, URSS.}
    %    \oh{Dear Mike:}
    %       Thanks for the invitation. Let's meet tomorrow at 11:30
    %       pm at the Moulin Rouge. We can have dinner afterwards
    %       (at your place or mine, as you prefer).
    %    \sincerely
    %    \signed{Ronnie R.}
    %    \fillit\bye

    \def\date#1{\null\vskip 1cm plus 15cm\hbox to \textwidth{\hfil#1}}

    \def\sendto{\begingroup\obeylines\s@ndto}

    \def\s@ndto#1{\vskip 0.5cm plus 20cm
      {\parindent 0pt\parsep 0pt \rm #1\par}
      \endgroup
      \vskip 0.5cm plus5cm}

    \def\oh#1{\vskip 0.7cm plus5cm\noindent #1\par
      \vskip 1cm plus10cm}

    \def\sincerely{\vskip 1cm plus 5cm minus 0.5cm
      \hmode\hskip2cm Sincerely,\par}

    \def\signed#1{\vskip 2cm plus30cm minus 1cm
      \hbox to \textwidth{\hfil
        \vbox{\hrule\vskip5pt\hbox{\hskip 30pt #1\hskip30 pt}}
        \hskip2cm}}

    \def\fillit{\par\vskip0cm plus 45cm}

  % Letterheads

    \long\def\myhead{{
      \setbox2\vbox{
        \normalsize\rm
        \parindent 0pt \leftglue=0pt plus1fill
        \parsep=0pt
        \hmode\SRCheadfont Jorge Stolfi\par
        19 Coleman Avenue, Apt. 30\par
        Menlo Park, CA 94025\par
        Tel. (415) 325-4423\par
      }
      \baselinesep -1pt \linesep 0pt\parsep 0pt
      \null\vskip-1.0cm
      \box2
      \vskip 0.5cm
     }}

    \long\def\SRChead#1#2{{
      \def\@I##1{\hbox to 10pt{\hss ##1\hss\vrule depth 5pt height 17pt}}
      \def\logo{}
      % \def\logo{
      %    \vbox{\DEClogofont\hrule
      %        \hbox{\vrule\@I d\@I i\@I g\@I i\@I t\@I a\@I l}
      %        \hrule}
      % }
      \setbox0\vbox to 0pt{\logo\vss}
      \setbox2\vbox{
        \normalsize\rm
        \parindent 0pt \leftglue=0pt plus1fill
        \parsep=0pt
        \hmode\SRCheadfont #1\par
        DEC Systems Research Center\par
        130 Lytton Avenue\par
        Palo Alto, CA 94301-1044\par
        Tel. (415) #2\par
      }
      \baselinesep -1pt \linesep 0pt\parsep 0pt
      \null\vskip-1.0cm
      \box0
      \box2
      \vskip 0.5cm
     }}

    \long\def\stanfordhead{
      \vbox{\centered STANFORD UNIVERSITY\par
        COMPUTER SCIENCE DEPARTMENT}
      \vskip5pt
      \vbox{\centered\smallsize\rm Stanford, CA 94305}}

    \def\emptyhead{\vskip 1cm plus 10cm}

% OUTPUT ROUTINE

  \message{output ...}

  % Uses same routine as PaperMacros, except for header.

    \printfilestampfalse

  % Page header format

    \def\makeheadline{\vbox{
      \vbox to 0pt{
        \vskip0pt minus1000pt
        \hbox to \pagewidth
         {\headerfont \iffirstpage \else \hfil\number\pageno \fi}
        }
      \vskip 20pt}}

% ADDITIONAL FONTS:

    \font\DEClogofont=cmss10 scaled \magstep2 % font for |d|i|g|i|t|a|l| logo.
    \font\SRCheadfont=cmss10 % font for  rest of SRC header

% LAYOUT PARAMETERS

  \advance\pagewidth by -30pt
  \advance\hoffset by 30pt

  \advance\textwidth by -30pt
  \hsize=\textwidth

  \advance\textheight by -70pt
  \vsize=\textheight

  {\normalsize\rm
   \global\parindent=5em
   \global\normalparsep=1.2ex plus 0.4ex
   \global\normalbaselinesep=2.6ex plus 0.5ex}
   
  \message{done.}

\catcode`@=12 \endlinechar=`\^^M

% END

