% \iffalse meta-comment
%<*internal>
\iffalse
%</internal>
%<*readme>
----------------------------------------------------------------
The uealttr package --- A letter class for the University of 
  East Anglia (UEA)
Maintained by Joseph Wright
E-mail: joseph.wright@uea.ac.uk
Released under the LaTeX Project Public License v1.3c or later
See http://www.latex-project.org/lppl.txt
----------------------------------------------------------------

The uealttr class is version of the standard LaTeX letter class
customised for use at the University of East Anglia (UEA).  It
is based on the Word template made available by the Publications
Office.  Although aimed at UEA, the class is readily adapted to
other organisations.

Installation
------------

The package is supplied in dtx format and as a pre-extracted zip
file, uealttr.tds.zip. The later is most convenient for most 
users: simply unzip this in your local texmf directory and run 
texhash to update the database of file locations. If you want to
unpack the dtx yourself, running 'tex uealttr.dtx' will extract
the package whereas 'latex uealttr.dtx will extract it and also 
typeset the documentation.

Typesetting the documentation requires a number of packages in
addition to those needed to use the package. This is mainly 
because of the number of demonstration items included in the 
text. To compile the documentation without error, you will 
need the packages:
 - hypdoc
 - listings
 - lmodern
 - mathpazo
 - microtype
%</readme>
%<*internal>
\fi
\def\nameofplainTeX{plain}
\ifx\fmtname\nameofplainTeX\else
  \expandafter\begingroup
\fi
%</internal>
%<*install>
\input docstrip.tex
\keepsilent
\askforoverwritefalse
\preamble
----------------------------------------------------------------
The uealttr package --- A letter class for the University of 
  East Anglia (UEA)
Maintained by Joseph Wright
E-mail: joseph.wright@uea.ac.uk
Released under the LaTeX Project Public License v1.3c or later
See http://www.latex-project.org/lppl.txt
----------------------------------------------------------------

\endpreamble
\postamble

Copyright (C) 2008,2010 by
  Joseph Wright <joseph.wright@uea.ac.uk>

It may be distributed and/or modified under the conditions of
the LaTeX Project Public License (LPPL), either version 1.3c of
this license or (at your option) any later version.  The latest
version of this license is in the file:

   http://www.latex-project.org/lppl.txt

This work is "maintained" (as per LPPL maintenance status) by
  Joseph Wright.

This work consists of the file  uealttr.dtx
          and the derived files uealttr.cls,
                                uealttr.ins and
                                uealttr.pdf.

\endpostamble
\usedir{tex/latex/uealttr}
\generate{
  \file{\jobname.cls}{\from{\jobname.dtx}{class}}
}
%</install>
%<install>\endbatchfile
%<*internal>
\usedir{source/latex/uealttr}
\generate{
  \file{\jobname.ins}{\from{\jobname.dtx}{install}}
}
\nopreamble\nopostamble
\usedir{doc/latex/uealttr}
\generate{
  \file{README.txt}{\from{\jobname.dtx}{readme}}
}
\ifx\fmtname\nameofplainTeX
  \expandafter\endbatchfile
\else
  \expandafter\endgroup
\fi
%</internal>
%<*driver>
\documentclass[a4paper]{ltxdoc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage[osf]{mathpazo}
\usepackage[scaled=0.95]{helvet}
\usepackage[final]{listings,microtype}
\usepackage[numbered]{hypdoc}
\EnableCrossrefs
\CodelineIndex
\RecordChanges
\begin{document}
  \DocInput{\jobname.dtx}
\end{document}
%</driver>
% \fi
% 
%\makeatletter 
%
%^^A \DescribeOption is in l3doc but not ltxdoc
%\newcommand*\DescribeOption{^^A
%  \leavevmode
%  \@bsphack
%  \begingroup
%    \MakePrivateLetters
%    \Describe@Option
%}
%\newcommand*\Describe@Option[1]{^^A
%    \endgroup
%  \marginpar{^^A
%    \raggedleft
%    \PrintDescribeEnv{#1}^^A
%  }%
%  \SpecialOptionIndex{#1}^^A
%  \@esphack
%  \ignorespaces
%}
%\newcommand*\SpecialOptionIndex[1]{^^A
%  \@bsphack
%  \index{^^A
%    #1\actualchar{\protect\ttfamily#1} (option)\encapchar usage^^A
%  }^^A
%  \index{^^A
%    options:\levelchar#1\actualchar{\protect\ttfamily#1}
%    \encapchar usage^^A
%  }^^A
%  \@esphack
%}
% 
%^^A For creating examples with nice highlighting of code, and so
%^^A on; based on the system used in the listings source (lstsample).
%\lst@RequireAspects{writefile}
%\newsavebox{\LaTeXdemo@box}
%\lstnewenvironment{LaTeXdemo}[1][code and example]
%  {^^A
%    \global\let\lst@intname\@empty
%    \expandafter\let\expandafter\LaTeXdemo@end
%      \csname LaTeXdemo@#1@end\endcsname
%    \@nameuse{LaTeXdemo@#1}^^A
%  }
%  {\LaTeXdemo@end}
%\newcommand*\LaTeXdemo@new[3]{^^A
%  \expandafter\newcommand\expandafter*\expandafter
%    {\csname LaTeXdemo@#1\endcsname}{#2}^^A
%  \expandafter\newcommand\expandafter*\expandafter
%    {\csname LaTeXdemo@#1@end\endcsname}{#3}^^A
%}
%\newcommand*\LaTeXdemo@common{^^A
%  \setkeys{lst}
%    {
%      basicstyle   = \small\ttfamily,
%      basewidth    = 0.51em,
%      gobble       = 3,
%      keywordstyle = \color{blue},
%      language     = [LaTeX]{TeX},
%      moretexcs    = 
%        {
%          address   ,
%          closing   , 
%          email     , 
%          faculty   ,
%          fax       ,
%          logo      ,
%          name      ,
%          opening   ,
%          position  ,
%          school    ,
%          sigfile   ,
%          signature ,
%          signemail ,
%          signphone ,
%          subject   ,
%          telephone ,
%          web       ,
%        }
%    }^^A 
%}
%\newcommand*\LaTeXdemo@input{^^A
%  \MakePercentComment
%  \catcode`\^^M=10\relax
%  \small
%  \begingroup
%    \setkeys{lst}
%      {
%        SelectCharTable=\lst@ReplaceInput{\^\^I}{\lst@ProcessTabulator}
%      }^^A
%    \leavevmode 
%      \input{\jobname.tmp}^^A
%  \endgroup
%  \MakePercentIgnore
%}
%\LaTeXdemo@new{code only}
%  {\LaTeXdemo@common}{}
%  
%\providecommand*\file{\texttt}
%\providecommand*\opt{\texttt}
%\providecommand*\pkg{\textsf}
%
%\makeatother
%
%\title{\pkg{uealttr} --- A letter class for the University of 
%  East Anglia (UEA)^^A
%  \thanks{This file describes version v1.1, last revised 2010/12/23.}}
%\author{Joseph Wright^^A
%  \thanks{E-mail: joseph.wright@uea.ac.uk}}
%\date{Released 2010/12/23}
%
%\maketitle
%
%\changes{v1.0}{2008/07/21}{First public release}
%\changes{v1.0a}{2008/07/23}{Altered \cs{subject} macro to alter style
%  used by the Registry}
%\changes{v1.1}{2008/08/14}{Improved match of layout with official
%  template}
%\changes{v1.2}{2010/12/23}{Use \cs{school} in place of \cs{department}
%  (which is depreciated)}
%\changes{v1.2}{2010/12/23}{Use \cs{telephone} in place of \cs{phone}
%  (which is depreciated)}
%\changes{v1.2}{2010/12/23}{Format \cs{today} correctly}
%\changes{v1.2}{2010/12/23}{New \cs{sigfile} function}
%
%\begin{abstract}
% The \pkg{uealttr} class is version of the standard \LaTeX\ letter class
% customised for use at the University of East Anglia (UEA).  It is
% based on the \href
% {http://www.uea.ac.uk/mac/comm/publicationsoffice/logosbrandguidelines/templates}
% {Word template} made available by the Publications Office. Although
% aimed at UEA, the class is readily adapted to other organisations.
%\end{abstract}
%
%\begin{multicols}{2}
%  \tableofcontents
%\end{multicols}
%
%\section{Introduction}
% The \pkg{uealttr} class is based on the standard \LaTeX\ class
% \pkg{letter}.  It therefore inherits all of the normal macros from
% the parent: \cs{name}, \cs{opening}, \cs{closing}, \emph{etc}. 
% However, the class follows the current guidelines given by UEA for 
% official letters. This makes use of a number of additional data 
% macros, and also allows ready customisation.  It also makes layout 
% changes to include a logo and address information.
% 
%\section{Installation}
%
%\changes{v3.4}{2010/01/15}{More detail on installation}
% The package is supplied in \file{dtx} format and as a pre-extracted
% zip file, \file{\jobname.tds.zip}. The later is most convenient for
% most users: simply unzip this in your local texmf directory and
% run \texttt{texhash} to update the database of file locations. If
% you want to unpack the \file{dtx} yourself, running 
% \texttt{tex \jobname.dtx} will extract the package whereas
% \texttt{latex \jobname.dtx} will extract it and also typeset the
% documentation.
% 
% Typesetting the documentation requires a number of packages in
% addition to those needed to use the package. This is mainly 
% because of the number of demonstration items included in the text. To
% compile the documentation without error, you will need the packages:
% \begin{itemize}
%   \item \pkg{hypdoc}
%   \item \pkg{listings}
%   \item \pkg{lmodern}
%   \item \pkg{mathpazo}
%   \item \pkg{microtype}
%\end{itemize}
%
%\section{Requirements}
%
% The \pkg{uealttr} class requires the following packages in addition
% to material from the \LaTeX\ \pkg{required} and \pkg{tools} bundles:
%\begin{itemize}
%  \item \pkg{eso-pic}
%  \item \pkg{geometry}
%  \item \pkg{helvet}
%  \item \pkg{ifpdf}
%  \item \pkg{kvopions}
%  \item \pkg{parskip}
%\end{itemize} 
% These are normally present in the current major \TeX\ distributions,
% but are also available from \href{http://www.ctan.org}{The 
% Comprehensive TeX Archive Network}.
%
%\section{Using the class}
%
%\DescribeOption{draft}
%\DescribeOption{final}
% The class is loaded in the usual way, as the argument to
% \cs{documentclass}. The package recognises the \opt{draft} option,
% which will result in the inclusion of thick black bars to show
% overfull boxes.  Any graphics will still be included, as
% \pkg{graphicx} is loaded with the \opt{final} option.
%
%\DescribeMacro{\logo}
% To allow setting up of a graphical logo, the \cs{logo} macro is
% provided by the package.  This is used to set the name  of the file
% containing the logo.  To allow use both with \LaTeX\ and
% pdf\LaTeX\, this macro should not include the file extension. Like
% other \pkg{letter} macros, \cs{logo} takes a single argument.
%\begin{LaTeXdemo}[code only]
%  \logo{uealogo}
%\end{LaTeXdemo}
% will therefore cause the class to look for \file{uealogo.eps} if
% compilation uses \LaTeX, or \file{uealogo.pdf} if using pdf\LaTeX.
% The default setting of \cs{logo} is \opt{uealogo}.
%
% For UEA users, the official logo is available as a \file{eps} file
% from the \href
% {http://www.uea.ac.uk/mac/comm/publicationsoffice/logosbrandguidelines/uealogos}
% {Publications Office}. The file can be converted to a \file{pdf}
% using \pkg{epstopdf}.  Doing this and saving both files to the
% \TeX\ path will allow compilation with either \LaTeX\ or pdf\LaTeX.
%
%\DescribeOption{logo}
% The class is designed so that the first page printed always
% contains space for the logo.  Second and subsequent pages are
% adjusted so that more of the paper is used for printing and the
% logo is not required. The option \opt{logo} governs whether
% the class attempts to print the logo, or simply reserves the space.
% The option takes the values \opt{true} and \opt{false}, using the
% key--value method.  To prevent printing the logo, the class is
% loaded as follows.
%\begin{LaTeXdemo}[code only]
%  \documentclass[logo=false]{uealttr}
%\end{LaTeXdemo}
% Note that by default, the class prints the logo (\emph{i.e.}~as if
% \opt{logo=true} had been given).
%
%\DescribeOption{personal}
%\DescribeOption{confidential}
% The \opt{personal} and \opt{confidential} options are provided.
% These take Boolean (true/false) values using key--value syntax,
% but can also be given alone.  Thus
%\begin{LaTeXdemo}[code only]
%  \documentclass[personal]{uealttr}
%\end{LaTeXdemo}
% and
%\begin{LaTeXdemo}[code only]
%  \documentclass[personal=true]{uealttr}
%\end{LaTeXdemo}
% act in the same way.  The two options will include ``PERSONAL'',
% ``CONFIDENTIAL'' or ``PERSONAL \& CONFIDENTIAL'' in the address
% area, if required.
%
%\DescribeMacro{\subject}
%\DescribeMacro{\faculty}
%\DescribeMacro{\school}
% A number of pieces of data can be gathered by the standard
% \pkg{letter} class, in macros such as \cs{name}, \cs{address},
% \emph{etc}. The \pkg{uealttr} package adds a number of macros to this
% list, all of which should be given before \cs{opening}. The
% \cs{subject} macro is used to place a subject line in the output. The
% \cs{faculty} and \cs{school} macros include the obvious
% information into the output file, before the contents of
% \cs{address}.
%
%\DescribeMacro{\email}
%\DescribeMacro{\telephone}
%\DescribeMacro{\fax}
%\DescribeMacro{\web}
% The macros \cs{email}, \cs{telephone} and \cs{fax} are used to include
% general contact details underneath the address area.  In the same
% way, \cs{web} includes a website in the same part of the letter.
% This information will often be general departmental contact
% details.
%\DescribeMacro{\position}
%\DescribeMacro{\signemail}
%\DescribeMacro{\signphone}
% In contrast, \cs{position}, \cs{signemail} and \cs{signphone} add
% information under the signature.  Thus these are intended to relate
% to the person signing the letter.  Notice that the name for the
% signature is taken from \cs{signature} if available, otherwise the
% \cs{name} macro is used.
%\DescribeMacro{\sigfile}
% To allow the inclusion of a scanned signature, the class provides
% the \cs{sigfile} macro, which can be set to the file name of
% such a scan. If \cs{sigfile} is set, the graphic will be included in
% the space for a signature.
%
%\section{A demonstration letter}
%
% A simple letter, with all of the data directly in the source, might
% read as follows.
%\begin{LaTeXdemo}[code only]
%  \documentclass[english,UKenglish]{uealttr}
%  \usepackage[final]{microtype}
%  \usepackage{babel}
%  \name{Joseph Wright}
%  \faculty{Faculty of Science}
%  \school{School of Chemistry}
%  \address{
%    University of East Anglia \\
%    Norwich NR4 7TJ \\
%    United Kingdom}
%  \email{joseph.wright@uea.ac.uk}
%  \telephone{+44 (0)1603 592902}
%  \fax{+44 (0)1603 592003}
%  \web{www.uea.ac.uk}
%  \position{Senior Research Associate}
%  \begin{document}
%  \begin{letter}
%  {Mr.~A.N.~Other \\ Some Company \\ Some Street \\ Sometown}
%  \subject{A demonstration letter}
%  \opening{Dear Mr.~Other,}
%
%  This is a rather boring letter, which simply shows how to use
%  the class file.
%
%  \closing{Yours faithfully,}
%  \end{letter}
%  \end{document}
%\end{LaTeXdemo}
%
% To make configuration easier, the class will attempt to load a
% configuration file \file{uealttr.cfg}.  This can be used to set up
% repeated data. This can also contain other instructions for \LaTeX.
%  For example, to include the standard data above in every letter,
% the class author uses a configuration file reading
%\begin{LaTeXdemo}[code only]
%  \name{Joseph Wright}
%  \faculty{Faculty of Science}
%  \school{School of Chemistry}
%  \address{
%    University of East Anglia \\
%    Norwich NR4 7TJ \\
%    United Kingdom}
%  \email{joseph.wright@uea.ac.uk}
%  \telephone{+44 (0) 1603 592902}
%  \fax{+44 (0) 1603 592003}
%  \web{www.uea.ac.uk}
%  \position{Senior Research Associate}
%  \RequirePackage[final]{microtype}
%  \RequirePackage{babel}
%\end{LaTeXdemo}
%
% The letter can then be reduced to.
%\begin{LaTeXdemo}[code only]
%  \documentclass[english,UKenglish]{uealttr}
%  \begin{document}
%  \begin{letter}
%  {Mr.~A.N.~Other \\ Some Company \\ Some Street \\ Sometown}
%  \subject{A demonstration letter}
%  \opening{Dear Mr.~Other,}
%
%  This is a rather boring letter, which simply shows how to use
%  the class file.
%
%  \closing{Yours faithfully,}
%  \end{letter}
%  \end{document}
%\end{LaTeXdemo}
%
%\StopEventually{%
%  \PrintChanges
%  \PrintIndex}
%
%    \begin{macrocode}
%<*class>
%    \end{macrocode}
%
%\section{The code}
% The package starts with the usual identification.
%    \begin{macrocode}
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{uealttr}
  [2010/12/23 v1.2 A letter class for UEA]
%    \end{macrocode}
% The standard support packages are loaded.
%    \begin{macrocode}
\LoadClass[10pt,a4paper]{letter}
\RequirePackage[T1]{fontenc}
\RequirePackage[final]{graphicx}
\RequirePackage[parfill]{parskip}
\RequirePackage{helvet,eso-pic,ifpdf,kvoptions}
\RequirePackage[hmargin=30mm,vmargin=25mm]{geometry}
%    \end{macrocode}
%\begin{macro}{\ifuea@personal}
%\begin{macro}{\ifuea@confidential}
%\begin{macro}{\ifuea@logo}
%\begin{macro}{\ifuea@draft}
% The single package option is declared.
%    \begin{macrocode}
\SetupKeyvalOptions{
  family = uea,
  prefix = uea@}
\DeclareBoolOption{personal}
\DeclareBoolOption{confidential}
\DeclareBoolOption{logo}
\DeclareBoolOption{draft}
\DeclareComplementaryOption{final}{draft}
\setkeys{uea}{
  personal = false,
  confidential = false,
  logo = true,
  draft = false}
\ProcessKeyvalOptions{uea}
\ifuea@draft
  \setlength\overfullrule{5pt}
\else
  \setlength\overfullrule{0pt}
\fi
%    \end{macrocode}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%\begin{macro}{\uea@pandc}
% For personal and confidential letters, some text is set up here.
%    \begin{macrocode}
\newcommand*{\uea@pandc}{}
\ifuea@personal
  \renewcommand*{\uea@pandc}{PERSONAL}
  \ifuea@confidential
    \renewcommand*{\uea@pandc}{PERSONAL \& CONFIDENTIAL}
  \fi
\else
  \ifuea@confidential
    \renewcommand*{\uea@pandc}{CONFIDENTIAL}
  \fi
\fi
%    \end{macrocode}
%\end{macro}
% The UEA style is to use Helvetica for all text.
%    \begin{macrocode}
\renewcommand\familydefault{\sfdefault}
%    \end{macrocode}
%\begin{macro}{\subject}
%\begin{macro}{\lettersubject}
% The subject of the letter is set up.
%    \begin{macrocode}
\newcommand*\subject[1]{\def\lettersubject{#1}}
\subject{}
%    \end{macrocode}
%\end{macro}
%\end{macro}
%\begin{macro}{\faculty}
%\begin{macro}{\fromfaculty}
%\begin{macro}{\school}
%\begin{macro}{\department}
%\begin{macro}{\fromschool}
% A number of macros are used to store the various pieces of data
% used in the address block.  First the faculty and department.
%    \begin{macrocode}
\newcommand*\faculty[1]{\def\fromfaculty{#1}}
\newcommand*\school[1]{\def\fromschool{#1}}
\let\department\school
\faculty{}
\school{}
%    \end{macrocode}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%\begin{macro}{\email}
%\begin{macro}{\fromemail}
%\begin{macro}{\phone}
%\begin{macro}{\telephonenum}
%\begin{macro}{\fax}
%\begin{macro}{\fromfax}
%\begin{macro}{\web}
%\begin{macro}{\fromweb}
% Next come the contact details for the right-hand area.
%    \begin{macrocode}
\newcommand*\email[1]{\def\fromemail{#1}}
\let\phone\telephone
\newcommand*\fax[1]{\def\fromfax{#1}}
\newcommand*\web[1]{\def\fromweb{#1}}
\email{}
\telephone{}
\fax{}
\web{}
%    \end{macrocode}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%\begin{macro}{\position}
%\begin{macro}{\fromposition}
%\begin{macro}{\signphone}
%\begin{macro}{\fromsignphone}
%\begin{macro}{\signemail}
%\begin{macro}{\fromsignemail}
% Finally, some details added after the signature.
%    \begin{macrocode}
\newcommand*\position[1]{\def\fromposition{#1}}
\newcommand*\signphone[1]{\def\fromsignphone{#1}}
\newcommand*\signemail[1]{\def\fromsignemail{#1}}
\position{}
\signphone{}
\signemail{}
%    \end{macrocode}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%\end{macro}
%\begin{macro}{\sigfile}
% A file can be made available for a graphical signature.
%    \begin{macrocode}
\newcommand*\sigfile[1]{\def\fromsigfile{#1}}
\sigfile{}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\logo}
%\begin{macro}{\fromlogo}
% Any local configuration is loaded, and options are processed.
%    \begin{macrocode}
\newcommand*\logo[1]{\def\fromlogo{#1}}
\logo{uealogo}
\InputIfFileExists{uealttr.cfg}
  {\ClassInfo{uealttr}{Loaded local configuration file}}
  {}
%    \end{macrocode}
%\end{macro}
%\end{macro}
% If no logo is available, the package will skip trying to position
% it.
%    \begin{macrocode}
\ifpdf
  \IfFileExists{\fromlogo.pdf}
    {}
    {\ifuea@logo
       \ClassWarning{uealttr}
         {Logo file \fromlogo.pdf not found!\MessageBreak
          No logo will be included in output}
     \fi
     \uea@logofalse}
\else
  \IfFileExists{\fromlogo.eps}
    {}
    {\ifuea@logo
       \ClassWarning{uealttr}
         {Logo file \fromlogo.eps not found!\MessageBreak
          No logo will be included in output}
     \fi
     \uea@logofalse}
\fi
%    \end{macrocode}
%\begin{environment}{wider}
% A trick taken from \pkg{memoir} and the UK FAQ: here, the extra
% width needed is known.
%    \begin{macrocode}
\newenvironment{wider}{%
  \begin{list}{}{%
    \setlength{\topsep}{0pt}%
    \setlength{\leftmargin}{\z@}%
    \setlength{\rightmargin}{-22mm}%
    \setlength{\listparindent}{\parindent}%
    \setlength{\itemindent}{\parindent}%
    \setlength{\parsep}{\parskip}%
  }%
  \item[]}{\end{list}}

%    \end{macrocode}
%\end{environment}
%\begin{macro}{\opening}
% To achieve the correct layout, completely new \cs{opening}
% and \cs{closing} macros are employed.
%    \begin{macrocode}
\renewcommand*\opening[1]{%
  \thispagestyle{empty}%
  \vspace*{18mm}%
%    \end{macrocode}
% If the logo has been requested, it is included here.
%    \begin{macrocode}
  \ifuea@logo
    \AddToShipoutPicture*{%
      \setlength{\unitlength}{1mm}%
      \put(149,257.5){\includegraphics[scale=0.95]{\fromlogo}}}%
  \fi
%    \end{macrocode}
% The address block is created by using a series of minipages of the
% correct width.  All of this is nested inside a group where the
% margins are made wider.
%    \begin{macrocode}
  \begin{wider}
    \setlength{\leftmargin}{\z@}%
    \setlength{\rightmargin}{22mm}%
    \begin{minipage}[t]{80mm}
      \begin{minipage}[t]{80mm}
        \raggedright
        \ifx\@empty\uea@pandc\else
          \textbf{\uea@pandc} \\*[\baselineskip]
        \fi
        \toname \\
        \toaddress
      \end{minipage}%
%    \end{macrocode}
% A zero-width minipage is used to force the date downward to the
% desired position.
%    \begin{macrocode}
      \begin{minipage}[t]{0mm}
        \vspace*{32mm}%
      \end{minipage}
      \@date
    \end{minipage}%
%    \end{macrocode}
% This minipage generates the whitespace between the two address
% blocks.
%    \begin{macrocode}
    \begin{minipage}[t]{40mm}
      \hspace*{40mm}%
      \vspace*{50mm}%
    \end{minipage}%
%    \end{macrocode}
% For the address block, a series of checks are made so that no empty
% lines are ended with |\\|.
%    \begin{macrocode}
    \begin{minipage}[t]{50mm}
      \vspace*{-3mm}%
      \footnotesize
      \raggedright
      \ifx\@empty\fromfaculty
        \ifx\@empty\fromschool\else
          \ignorespaces\fromschool \\*[\baselineskip]
        \fi
      \else
        \ifx\@empty\fromschool
          \textbf{\ignorespaces\fromfaculty} \\*[\baselineskip]
        \else
          \textbf{\ignorespaces\fromfaculty} \\
          \ignorespaces\fromschool \\*[\baselineskip]
        \fi
      \fi
      \ifx\@empty\fromaddress\else
        \ignorespaces\fromaddress \\*[\baselineskip]
      \fi
      \ifx\@empty\fromemail\else
        Email: \ignorespaces\fromemail \\
      \fi
      \ifx\@empty\telephonenum\else
        Tel: \ignorespaces\telephonenum \\
      \fi
      \ifx\@empty\fromfax\else
        Fax: \ignorespaces\fromfax \\
      \fi
      \ifx\@empty\fromweb\else
        \ignorespaces\fromweb \\
      \fi
    \end{minipage}%
  \end{wider}
  \par\noindent#1\par\nobreak
  {\bfseries
   \ifx\@empty\lettersubject\else
     \expandafter\uea@MakeUppercase\lettersubject \\\@empty
   \fi}}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\uea@MakeUppercase}
% A support macro is needed to allow multi-line uppercase.
%    \begin{macrocode}
\def\uea@MakeUppercase#1\\#2\@empty{%
  \MakeUppercase{#1}%
  \ifx\@empty#2\@empty\else
    \\ \expandafter\uea@MakeUppercase#2\@empty
  \fi}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\closing}
% The same tricks are used for the closing.
%    \begin{macrocode}
\renewcommand\closing[1]{%
  \par\nobreak\vspace{\parskip}%
  \stopbreaks
  \noindent
  \ignorespaces #1%
  \ifx\fromsigfile\@empty
    \\[22 mm]
  \else
    \\[1 mm]
    \includegraphics{\fromsigfile}\\[1 mm]
  \fi
  \ifx\@empty\fromsig
    \fromname \\
  \else
    \fromsig \\
  \fi
  \ifx\@empty\fromposition\else
    \fromposition \\
  \fi
  \ifx\@empty\fromsignphone\else
    \fromsignphone \\
  \fi
  \ifx\@empty\fromsignemail\else
    \fromsignemail \\
  \fi
  \strut
  \par}
%    \end{macrocode}
%\end{macro}
%\begin{macro}{\stopletter}
% The \cs{stopletter} macro is used to push the contents up the page,
% in contrast to normal \LaTeX\ behaviour.
%    \begin{macrocode}
\renewcommand*\stopletter{\vfill}
%    \end{macrocode}
%\end{macro}
%
%\begin{macro}{\today}
% A quick hack to give a UK-formatted date.
%    \begin{macrocode}
\renewcommand*\today{%
  \number\day
  \space
  \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\year
}
%    \end{macrocode}
%\end{macro}
%
%    \begin{macrocode}
%</class>
%    \end{macrocode}
%
%\Finale
