%corrdefs.tex  v1.0
%See the file corrdefs.doc for documentation.

%Parameters and minor formatting :
\voffset12pt\nopagenumbers\advance\vsize by-12pt
\parskip=.3em plus1pt\interlinepenalty150\widowpenalty1000\clubpenalty1000
\raggedbottom

%Minor definitions used internally:
\def\specpar{\parindent0pt\parskip0pt}\long\def\jump#1\endjump{}
\def\copies{\ifx\copyto\empty\else cc: \slot{5truein}{\copyto}\fi}
\def\annote{\ifx\annotations\empty\else \slot{5.5truein}{\annotations}\fi}
\long\def\slot#1#2{\vtop{\hsize#1\specpar\everypar{\hangindent2em}
  \rightskip0ptplus1fil\relax#2}}

%Definitions for output:
\newif\ifheadline\headlinetrue\newif\ifwindow\windowfalse
\def\pagebody{\vbox to \vsize{\boxmaxdepth=\maxdepth\pagecontents
  \ifwindow\else\ifnum\pageno=1\vfilneg\vskip0ptplus40pt\fi\fi}}
\headline={\tenrm\heading\hfil Page \folio}
\def\makeheadline{\vbox to 0pt{\ifnum\pageno>1\ifheadline\vskip-22.5pt
  \line{\vbox to8.5pt{}\the\headline}\vskip1.6pt\hrule\vss\fi\fi}
  \nointerlineskip}
\def\noheadline{\headlinefalse\advance\vsize by 12pt\voffset0pt}
\def\window{\windowtrue}

%Other definitions appearing in forms:
\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\   
  \number \day, \number \year}                       
\def\plainmemotop{{\def\\{\noalign{\smallskip}}\null\global\pageno=1
  \ifwindow\else\vskip0pt plus-60pt\fi\ifheadline\vskip-12pt\fi
  \vskip1trueinplus40pt
  \halign{\hfil##:&\quad##\hfil\cr To&\slot{5truein}{\sendto}\cr
  \\From&\slot{5truein}{\from}\cr\\Date&\date\cr
  \\Subject&\slot{5truein}{\subject}\cr}\bigskip}}
\def\memotop{{\def\\{\noalign{\smallskip}}\vskip.6trueinplus40pt
  \halign{\hfil##:&\quad##\hfil\cr To&\slot{5truein}{\sendto}\cr
  \\From&\slot{5truein}{\from}\cr\\Date&\date\cr
  \\Subject&\slot{5truein}{\subject}\cr}\bigskip}}
\def\memoend{\par{\specpar\nobreak\bigskip\annote\nobreak\copies}
  \penalty0\ifnum\pageno=1\vskip0pt plus60pt\vfilneg\fi\vfil\eject}
\def\plainlettop{\gdef\heading{To \expandafter\untitle\addressee,@}\null
  \pageno=1\ifwindow\else\vskip0pt plus-60pt\fi
  \ifheadline\vskip-12pt\fi\vskip12truept\ifwindow\vbox to 2.742truein
  {\specpar\vfil\line{\hfil\slot{2.8truein}{\senderaddress\par\date}}
  \vfil\vfil\slot{3.5truein}{\addressee\par\address}
  \vbox to .44truein{\vfil\salutation}}\vskip.2truein\vskip-\parskip
  \else\vskip.16trueinplus25pt
  \line{\hfil\slot{2.8truein}{\senderaddress\par\date}}
  \vskip.6trueinplus25pt\vskip-\parskip\slot{4truein}{\addressee\par
  \address}\medskip\noindent\salutation\medskip\vskip-\parskip\fi}
\def\lettop{\gdef\heading{To \expandafter\untitle\addressee,@}\ifwindow
  \vbox to 2.34truein{\specpar\vfil\line{\hskip4.5truein\date\hfil}
  \vfil\slot{3.5truein}{\addressee\par\address}
  \vbox to .44truein{\vfil\salutation}}\vskip.2truein\vskip-\parskip
  \else\vskip.5trueinplus25pt\line{\hskip4.5truein\date\hfil}
  \vskip.6trueinplus25pt\vskip-\parskip\slot{4truein}{\addressee\par
  \address}\medskip\noindent\salutation\medskip\vskip-\parskip\fi}
\def\letend{\par{\specpar\nobreak\medskip\line{\hfil\slot{3truein}{\close
  \vskip.6truein\sender}}\nobreak\bigskip\annote\nobreak\copies}
  \penalty0\ifnum\pageno=1\vskip0pt plus60pt\vfilneg\fi\vfil\eject}

%Definitions for mass mailings:
\newif\ifunifsal\unifsalfalse
\def\uniformsalutation{\unifsaltrue}
\def\unparen(#1)#2@{#1}
\def\uniform{uniform}\def\same{same}
\def\makedefs#1(#2)@{\xdef\ntest{\unparen(\noexpand #2)@}\gdef\addressee{#1}
   \ifx\ntest\empty\ifunifsal\gdef\salutation{\unifsalutation}
        \else\gdef\salutation{Dear \salute#1,@}\fi
     \else\expandafter\ifx\ntest\same
        \gdef\salutation{Dear \expandafter\unspace\addressee @:}
     \else\expandafter\ifx\ntest\uniform
        \gdef\salutation{\unifsalutation}
     \else\gdef\salutation{\ntest}\fi\fi\fi}
\def\unspace#1 @{#1}
\def\untitle#1,#2@{#1}
\def\salute#1 #2,#3@{#1 \surname #2 @}
\def\surname#1 #2@{\def\test{#2}\ifx\test\empty #1:\let\upcome=\eat%
   \else\let\upcome=\surname\fi\upcome#2@}
\def\eat#1{}
{\obeylines\gdef\readname#1^^M%
   {\def\test{#1}\ifx\test\empty\let\mnext=\endinput\else%
   \let\mnext=\readaddress\makedefs#1()@\fi\mnext}%
\gdef\readaddress#1^^M^^M%
   {\let\mnext=\readname\gdef\address{#1}{\catcode`\^^M=5\letter}\mnext}}
\long\def\massmail#1#2\letend{\xdef\unifsalutation{\salutation}
   \def\letter{#2\letend}{\obeylines\expandafter\readname\input #1 }}

%Initial definition of all blanks:
{\obeylines
\gdef\date{\today}\gdef\annotations{}\gdef\copyto{}\gdef\addressee{}
\gdef\address{}\gdef\senderaddress{}\gdef\salutation{}\gdef\close{}
\gdef\sender{}\gdef\sendto{}\gdef\sender{}\gdef\subject{}\gdef\heading{}}
