\input BasicMacros

% LetterFormat.tex of January 9, 1984 6:25 pm --- Stolfi

% TEX macros for letters using Times Roman 10 pt.

  % Things to fix

 % ADDITIONAL MACRO FILES

  \input SearchMacros

  \input TR10Fonts

 % ADDITIONAL FONT DEFINITIONS

  \font L=Logo at 24truebp % Xerox logo
  \font W=Helvetica at 8 truebp % Helvetica

\def\logofont{\:L\def\mainfont{\:L}} % Xerox logo
\def\helvetica{\:W\def\mainfont{\:W}} % Helvetica

 % TITLES

  % Begin new file

    \def\begfile#1{\gdef\filestamp{#1}\gdef\newfile{T}}

  % Date, signature, etc.

    %  Usage:
    %	 \whitehousehead
    %	 \date{Washington, DC, February 30, 1984}
    %	 \sendto{\t IU. Andropov\lb Big Boss of the Kremlin\lb Moscow, URSS}
    %	 \oh{Dear \t IUri:}
    %	 Thanks for the invitation. Let's meet tomorrow at 9:30 pm at the
    %	   Moulin Rouge. See you,
    %	 \signed{R. Reagan}
    %	 \fillit\eject\end

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

    \def\sendto#1{\vskip 0.5cm plus 20cm
      \noindent\hangindent 20pt after0{\rm #1}\par
      \vskip 0.5cm plus5cm}

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

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

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

  % Letterheads

    \def\xeroxhead#1{
      {\baselineskip -1pt \lineskip 0pt
       \null\vskip-2.5cm
       \noindent\hangindent 3cm after0
	 {\helvetica #1\lb
	  Computer Science Laboratory\lb
	  Xerox Palo Alto Research Center\lb
	  3333 Coyote Hill Road\lb
	  Palo Alto, California 94304\lb
	  Tel. (415) 494-4427}}
      \par\vskip 0.5cm
      \def\date##1{\hbox to \textwidth pt
	  {\hbox to 0pt{\null\hskip-2cm{\logofont XEROX}\hss}
	   \hfil ##1}}
     }

    \def\stanfordhead{
      \ctrpar\textwidth pt{STANFORD UNIVERSITY\cp
	COMPUTER SCIENCE DEPARTMENT}
      \vskip5pt
      \ctrpar\textwidth pt{\small Stanford, CA 94305}}

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

  % Section and subsection titles

    %  Usage:
    %	 \section{1. Acid concepts}
    %	 \subsection{1.1A. Annotation and Undefinitions}
    %	 \subsection{Appendix A: The letters of the alphabet}

    \def\section#1{
      \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}

 % OPTIONS AND DIMENSIONAL PARAMETERS

  % (dimensions in points unless otherwise indicated)

  % Page width and related parameters

    \def\pagewidth{440} % page width

    % dimensions in effect during normal text

    \def\textwidth{400} % text width
    \def\progwidth{360} % program width
    \def\algwidth{360} % width of algorithms - max: page width

    \def\theowidth{\textwidth} % width of theorems
    \def\textheight{640} % height available for text

    \def\leftskip{35} % extra space on left margin of page

    \def\ftfigwidth{300} % width of text in footnotes with figures
    \def\figcapwidth{280} % width of figure captions

  % Text

    \def\textindent{20} % extra indentation given by \indent
    \def\itemindent{20} % indentation of \item and \itemno body

    \jpar 10

    \def\stdbaselineskip{2.4}	% normal inter-baseline distance (in ex)
    \def\smallbaselineskip{2.5} % inter-baseline distance for \small (in ex)
    \def\thelineskip{0.2}	% minimum distance betweeen lines (in ex)
    \def\theparskip{2.0}       % extra skip between paragraphs (in ex)

    \def\stdparindent{40}   % standard indentation for paragraphs
    \def\smallparindent{30} % indentation of paragraphs in \small

  % References

    \def\refindent{4} % indentation of reference body (in em)
    \def\refremindent{5} % indentation of reference remarks (in em)
    \def\refvskip{2} % vskip between references (in ex)

  % Algorithms

    \def\algindent{20} % indentation of outermost bracket
    \def\algvskip{0.3} % skip between alg. steps (in ex)

    \def\algthickness{0.6} % thickness of block brackets
    \def\alglevelindent{20} % extra indent. per level (incl. \algthickness)
    \def\algstepindent{18} % indent. of \step text rel. to innermost bracket
    \def\algcommindent{18} % indent. of \comm text rel. to innermost bracket
    \def\algcontindent{8} % extra indentation of continuation lines
    \def\algstepnoskip{3} % space between step number and step text

  % Programs

    \def\progindent{20} % indentation of outermost bracket
    \def\progvskip{0.4} % skip between prog. steps (in ex)

    \def\progthickness{0.6} % thickness of block brackets
    \def\proglevelindent{12} % extra indent. per level (incl. \progthickness)
    \def\progstepindent{4} % indent. of \step text rel. to innermost bracket
    \def\progcommindent{4} % indent. of \comm text rel. to innermost bracket
    \def\progcontindent{8} % extra indentation of continuation lines

  % Theorems, definitions and proofs

    \def\theostatindent{20} % indentation of them. statements
    \def\theoitemindent{40} % \theostatindent+\itemindent
    \def\proofindent{10}    % indentation of proofs

    \def\begproofmark{{\bf Proof: }}
    \def\endproofmark{\lower0.15ex\hbox{\hskip0.2em{\mal \char'061}}} % square

  % Figures

    \def\omitfigures{F} % if T, suppress all figure spaces (just captions).
    \def\figmark{} % change to, say, \hbox{>>==>} for PressEdit and such

  % Footnotes

    \botsep{\vskip4pt plus 2pt
      \hrule width 2truein\vskip2pt} % before first \botinsert
    \botskip 3pt plus 2pt  % space between \botinserts

  % File stamp

    \def\printfilestamp{F} % put \filestamp on 1st page

 % OUTPUT ROUTINE

  % Global flags and variables (internal)

    \def\fpage{T}   % T on first page of output.
    \def\newfile{F} % T on first page of a new file.

    \setcount0 1  % page number

  % Page header and footer formats

    \def\pageheaderbox{}

    \def\pagefooterbox{\vbox
       {\vskip 15pt
	\hbox to \pagewidth pt{\small
	  \if T\fpage{}\else{\hfil {\rm \count0}\hfil}
	  \if T\printfilestamp{\null\rspose{\hbox{\it \filestamp}}}
	  \else {}} }}

  % Page format

    \output{
      \baselineskip -1pt \lineskip 0pt
      \hbox{\hskip \leftskip pt
	\vbox
	  {\pageheaderbox
	   \hbox to \pagewidth pt{\hss\vbox{\page}\hss}
	   \pagefooterbox}}
      \advcount0
      \gdef\newfile{F}
      \gdef\fpage{F}
    }

 % INITIALIZATION

  \standardsize
  \hsize\textwidth pt
  \vsize\textheight pt


