% from letter.sty 21 Jul 85 < Copyright (C) 1985 by Leslie Lamport >
% letterhead stationery for University of Wisconsin - Madison, Mathematics Department
% The W.eps logo was created with xfig.
% Requires: Latex2e, dvips and Ghostscript/Ghostview
% Prints best on a postscript printer.
% Setting optimised for the Math Depts' HPLJ 4M printers
%
\typeout{Document Style WMath}
\typeout{mod by Yvonne Nagel}
\typeout{for Yvonne Nagel}
%
\oddsidemargin -.1in \evensidemargin -.1in \marginparwidth 90pt \marginparsep 11pt \marginparpush 5pt
%
% Mod to headheight,topmargin, and footskip to put some more space on top
%
\topmargin -.25in 
% \headheight 12pt \headsep 25pt \footheight 12pt \footskip 15pt
% \footheight is obsolete in latex2e
\headheight 12pt \headsep 25pt \footskip 15pt
\textheight 8.5in \textwidth 6.5in \columnsep 10pt \columnseprule 0pt
\raggedbottom 

\longindentation=4.3truein

\def\opening#1{\ifx\@empty\fromaddress
 \thispagestyle{firstpage}
    {\par\vspace*{.2truein}\hskip\longindentation\today\par}
 \else \thispagestyle{empty}
 % Next line changed for margin alignment and name inclusion
 {\font\this=cmr8 at 8truept \baselineskip=8pt
 {\this
 \raggedright\ignorespaces
 \hskip\longindentation \phantom{Please Reply To:} \\ 
 \hskip\longindentation\begin{minipage}{1.5in}\this\baselineskip=8pt
        \phantom{\fromaddress}\end{minipage}\\
 \hskip\longindentation\phantom{\telephonenum} \\
 \hskip\longindentation\phantom{\loginname}\\*[-2\parskip]}
 \hskip\longindentation\today\par}
 \vskip10pt
 \fi
 %
 \vspace{2\parskip}
% Next line changed to allow empty address for a ``To Whom
%       It May Concern Letter''
 \ifx\@empty\toname
 \else {\raggedright \toname \\ \toaddress \par}\vspace{2\parskip}
 \fi
 #1\par\nobreak}
%
% Add a wee bit of extra space before the closing
%
\renewcommand{\closing}[1]{\par\nobreak\vspace{\parskip}%
  \stopbreaks
  \noindent
  \hspace*{\longindentation}
  \parbox{\indentedwidth}{\raggedright
       \ignorespaces #1\\[6\medskipamount]%
       \ifx\@empty\fromsig
           \fromname \\ \fromtitle
       \else \fromsig  \\ \fromtitle \fi\strut}%
   \par}
\medskipamount=\parskip

\def\ps{\par\startbreaks}



\long\def\letter#1{\newpage
 \c@page\@ne
 \interlinepenalty=200 \@processto{#1}}
%
\def\endletter{\stopletter\@@par\pagebreak\@@par
 \if@filesw
 \begingroup
 \def\protect{\string}
 \let\\=\relax
 \def\protect##1{\string##1\space}
 \immediate\write\@auxout{\string\mlabel{\fromname\\ \fromaddress}{\toname
 \\\toaddress}}
 \endgroup
 \fi}
%
\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\def\par{\@@par\penalty 200}}
%
%
\def\name#1{\def\fromname{#1}}
%
%
\def\title#1{\def\fromtitle{#1}}
\def\fromtitle{}
%
\def\login#1{\def\loginname{#1}}
%
%
\def\signature#1{\def\fromsig{#1}}
\def\fromsig{}
%
%\long\def\address#1{\def\fromaddress{#1}}
\def\fromaddress{}
%
%       Location -- not used in Berkeley letter format
\def\location#1{\def\fromlocation{#1}}
\def\fromlocation{}
%
%       Telephone #
\def\telephone#1{\def\telephonenum{#1}}
%
%
\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\endgroup
 \if@filesw \immediate\openout\@mainaux=\jobname.aux
 \immediate\write\@mainaux{\string\startlabels\string\@startlabels}\fi
 \def\do##1{\let ##1\@notprerr}
 \@preamblecmds
 \let\do\noexpand
 \@normalsize\everypar{}}
%
\def\enddocument{\@checkend{document}\newpage\begingroup
\if@filesw \immediate\closeout\@mainaux
\makeatletter\input \jobname.aux\clearpage
\fi\endgroup\deadcycles\z@\@@end}

\def\makelabels{\@fileswtrue}
\def\@startlabels{}



%
% Defn's for the "W" Math letterhead
% requires epsf style file
% a postscript printer would also be nice
%
\font\eight=cmr8 at 8truept
\font\headfont=cmbx12 scaled\magstep2
\def\Wmathletterhead{
 \vglue-5truept
 \hbox{\epsfig{file=W,height=.5in}\kern5truept
      \raise3truept\vbox{\hbox{\headfont University of}
        \hbox{\headfont Wisconsin--Madison}}
      \hspace{.25truein}
      \raise3truept\vbox{\hbox{\sc DEPARTMENT OF MATHEMATICS}}
   }% end of hbox
 \vskip1truept
 \hrule height1pt width6.4truein
 \vskip3truept
 \hbox{\vbox{\hbox{\eight Van Vleck Hall}\vskip-3truept
         \hbox{\eight 480 Lincoln Drive}\vskip-3truept
         \hbox{\eight Madison, WI 53706-1388}\vskip-3truept
         \hbox{\eight\phantom{Madison, WI 53706-1388}}}
     \hspace{3.5truein}
       \vbox{\hbox{\eight \hspace{50pt}Yvonne Nagel}\vskip-3truept
         \hbox{\eight \hspace{14pt} Telephone:(608) 263-7490}\vskip-3truept
         \hbox{\eight E-Mail: recep@math.wisc.edu}\vskip-3truept
         \hbox{\eight \hspace{2pt} Fax Number: (608) 263-8891}}
        } 
     
}        
%
% Defn's for the WiscMath letterhead
%
%       Our font choices
%
\font\five=cmr5 at 5truept
\font\six=cmr6 at 6truept
\font\eight=cmr8 at 8truept
%
\def\wiscmathletterhead{
 \noindent\hrule
 \vskip-4truept
 \par\noindent
 \hbox{\Huge University of Wisconsin}
 \vskip30truept
 %
 \hrule height1pt
 \vskip-7truept

{\eight
 \begin{tabular}{llr}
 \baselineskip=8pt
 \hskip-6pt Department of \hspace{1.7in} & 480 Lincoln Drive
         \hspace{1.65in} & (608)263-3054 \\
 \hskip-6pt Mathematics & Madison, Wisconsin 53706-1388
 \end{tabular}
 \par\noindent
 \vskip30truept}
 }
\vfuzz50pt
%
% End of letterhead defn's
%
% The following line mod'd for inclusion of letterhead
%\def\@texttop{\ifnum\c@page=1\vskip 50pt \wiscmathletterhead \relax\fi}
\def\@texttop{\ifnum\c@page=1\vskip -40pt \Wmathletterhead \relax\fi}
%
% Page Styles
%
\def\ps@headings{\def\@oddhead{\sl To \ignorespaces\toname \hfil \today
 \hfil Page \thepage}\def\@oddfoot{}}
 %
\def\ps@empty{\def\@oddhead{}\def\@oddfoot{}\def\@evenhead{}\def\@evenfoot{}}

\def\ps@firstpage{\def\@oddhead{}\def\@oddfoot{\raisebox
 {-45pt}[0pt]{\hbox to \textwidth
 {\hspace*{100pt}\xpt\fromlocation \hfill
\telephonenum}}\hss}\def\@evenhead{}\def\@evenfoot{}}
%
\def\ps@plain{\def\@oddhead{}\def\@oddfoot{\rm\hfil\thepage
 \hfil}\def\@evenhead{}\let\@evenfoot\@oddfoot}

\parskip .7em \parindent 0pt \topsep .4em \partopsep 0pt \itemsep .4em
\@lowpenalty 51 \@medpenalty 151 \@highpenalty 301
\@beginparpenalty -\@lowpenalty \@endparpenalty -\@lowpenalty \@itempenalty
-\@lowpenalty


\tabbingsep \labelsep
\skip\@mpfootins = \skip\footins
\fboxsep = 3pt \fboxrule = .4pt

\def\footnoterule{\kern-1\p@
 \hrule width .4\columnwidth
 \kern .6\p@}

\long\def\@makefntext#1{\noindent \hangindent 5pt\hbox
 to 5pt{\hss $^{\@thefnmark}$}#1}


\smallskipamount=.5\parskip \medskipamount=\parskip
\bigskipamount=2\parskip
%
% Change from ps@plain to ps@headings to produce running headers
%
\ps@headings \pagenumbering{arabic} \onecolumn \@fileswfalse
