Sharedwww / job / ucbletter.clsOpen in CoCalc
% ucbletter.cls
% Written by Paul Vojta, 15 Sep 1995.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% To change the date use the following command:
% \def\today{November 12, 1999}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% Announce the class name and version.

\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{ucbletter}[1997/11/23 University of California letter class]

% wide option - make the text wider (and taller).

\let\@wide 0
\DeclareOption{wide}{\let\@wide 1}

% signed option - memo only - put a letter-style closing at the end

\let\@signed 0
\DeclareOption{signed}{\let\@signed 1}

% center option - center the text in the page automatically

\let\@autocenter\@empty
\DeclareOption{center}{\renewcommand\@autocenter{\oddsidemargin.5\paperwidth
\evensidemargin\oddsidemargin  \indentedwidth.5\textwidth
\let\@fixbottom\@dofixbottom}}

% Pass other options on to the base letter class.

\DeclareOption*{\PassOptionsToClass{\CurrentOption}{letter}}

\ProcessOptions

%    ****************************************
%    *           LETTER COMMANDS            *
%    ****************************************
%
% The following declarations, shown with examples, give information
%
% \name{Dr. L. User} : to be used for the return address on the
%          envelope.
% \signature{Larry User} : goes after the closing.
% \address{3245 Foo St.\\Gnu York} : used as the return address in the
%          letter and on the envelope.  If not declared, then an
%          institutional standard address is used.  If declared, then
%          macro is used.
% \location{Room 374} : Acts as modifier to the standard institutional
% \telephone{(415)123-4567} : Just in case some style puts it on the
%          letter.
% \email{[email protected]} : Put into the letterhead.
% \sigspace=36pt: amount of space to allow for the signature.  The default
%          value is 36 points, which is equivalent to four typewriter line
%          spaces.  This is the standard for business letters.  I've seen more
%          space used, but not less, and recommend against decreasing it,
%          although most requests to change it seem to refer to decreasing it.
%          I should put in a nasty warning if people put in too little space.
%
% In all of the above, the \sfcode for '.' is set to 1000, so one never needs
% to say "Mr.\ User".
%
% The following modify the letterhead; default values are declared at the end
% of the file:
%
% \department{DEPARTMENT OF REDUNDANCY DEPARTMENT}
% \mailcode{9876}
%
% N.B.:  \department erases whatever \mailcode is in effect, so the \mailcode
% must come _after_ the \department.
%
% In this installation, the letterhead appears as:
%
% --------------------------------- <logo, etc.> ----------------
% \location                             BERKELEY, CALIFORNIA  94720-\mailcode
% \email *                              \telephone
%                                       \email *
%                                       date
%
% * By default, the \email appears on the right; this can be overridden by
%   specifying \emailatleft or \emailatright.
%
% The macro \adjustmargins can be used to make the margins wider--for example,
% \adjustmargins{.5in}.  This affects top and bottom margins as well, but not
% the placement of the letterhead.  This should be done before the macro
% \begin{document}.
%
% Another option is to set \textwidth and \textheight directly.  Again, this
% should be done before \begin{document}; you should also adjust \oddsidemargin,
% \evensidemargin, and \indentedwidth if you change \textwidth, and \topmargin,
% \headsep, and \footskip if you change \textheight.  An alternative is to
% use the center option on the \documentclass line; it will then center the
% letter automatically.
%
% The signature will appear on the right, aligned with the address, if one is
% given; otherwise it will appear on the left.  This can be overridden with
% \closingatright or \closingatleft.
%
% The \makelabels declaration causes mailing labels to be made.  It
% must go before the \begin{document} command.
%
% The letter environment: creates a new letter, starting from page 1.
% (The first page is unnumbered.)  It has a single argument, which
%        \begin{letter}{Sam Jones \\
%                       Institute for Retarded Study\\ Princeton, N.J.}
%
%
% For informal letters, the address of the recipient can be left out:
%        \begin{letter}{}
%
% Text is begun with the \opening command, whose argument generates the
% salutation, as in
%           \opening{Dear Henry,}
% The body of the letter follows, ended by a \closing command, as in
%            \closing{Yours truly,}
% The 'signature' is provided automatically.
%
%  After the \closing you can put arbitrary stuff, which is typeset
%  with \parindent = 0 and no page breaking.  Commands designed
%  for use after the closing are:
%
%  \cc{Tinker\\Evers\\Chance} -- which produces:
%        cc: Tinker
%            Evers
%            Chance
%
%  \encl{Foo(2)\\Bar} -- which produces:
%        encl: Foo(2)
%              Bar
%
%  THE MEMO ENVIRONMENT
%
% This format also implements the UC interdepartmental memo format as a "memo"
% environment.  The use is much the same as for the letter environment;
% we will give here the differences.
%
% The \begin macro has one argument giving the recipient(s); for example,
%       \begin{memo}{Sam Jones\\Nicolas Bourbaki}
% To declare the subject of the memo, the \begin may be followed IMMEDIATELY
% by a \subject or \re macro:
%       \re{Our recent discussion}
% The text of the memo follows; the \opening macro, if present, is ignored.
% After the memo, one can invoke the \closing macro (whose argument, in this
% case, is ignored; the macro merely serves the purpose of preventing further
% page breaks).  The usual \cc and \encl options may follow this; if they are
% not used, then there is no point in using the \closing macro, either.
% The reason for keeping the \opening and \closing macros is so that a letter
% can be converted to a memo merely by changing the name of the environment.
% The converse works as well:  the \subject or \re macros are ignored in the
% letter environment.
%
% However, there is an option, which allows the end of the memo to be treated
% as a signed letter.  To specify this option, just include "signed" as one
% of the options in the \documentstyle line.  In that case the \closing
% macro functions just as it does for a letter.
%
% The format of the top of the memo is:
%
%                                       BERKELEY:  \department
%                                                  \location
%                                                  \telephone
%                                                  \email
%
%                                                  date
%
%
%  DOCUMENT STYLE PARAMETERS AND COMMANDS.  CHANGE THESE TO
%  CUSTOMIZE LETTER STYLE.
%
%  \opening{Dear Mr. Foo:}-
%     Should produce everything up to and including the 'Dear Mr. Foo:'
%     and a \par command that follows.  Since there's a \vfil at the
%     bottom of every page, it can add vertical  fil  to position a
%     short letter. It should use the following commands:
%
%     \toname       : name part of 'to' address.
%                     Will be one line long.
%                     Lines separated by \\.
%     \fromname     : name of sender.
%                     null if none.  Should use standard institutional
%     \fromlocation : argument of current \location declaration--
%                     null if none.
%     \telephonenum : argument of current \telephone declaration--
%                     null if none.
%     \emailaddr    : argument of current \email declaration
%     \departmentname:argument of current \department declaration
%     \[email protected]: argument of current \aboveaddress declaration
%     \frommailcode : argument of current \mailcode declaration
%
%     Note that  \ifx\foo\@empty  tests for a null value of \foo.
%
%  \closing{TXT} : Generates the closing matter, and the signature.
%     An obvious thing to do is to use a \parbox for the closing
%     and the signature.  Should use the following:
%
%     \fromsig    : argument of current \signature declaration or,
%                   if null, the \fromname .
%     \stopbreaks : a macro that inhibits page breaking.
%
%  \cc{ARG} and \encl{ARG} : obvious use of a \parbox[t] .
%
%  \ps : The only thing that this needs to do is call \startbreaks,
%        which allows page breaking again.
%
%  \stopletter : Command called by \endletter to do the following:
%     * Add any desired  fil  or other material at the end of the
%       letter.
%     * Define \returnaddress to be the return address for the mailing
%       label.  More precisely, it is the first argument of the \mlabel
%       command described below. It should be \def'd to null if the
%       return address doesn't appear on the labels.  Any command,
%       other than \\, that should not be expanded until the \mlabel
%       command is actually executed must be preceded by \protect.
%       Whenever possible, \protect commands in the definition of
%       \returnaddress---it's much more efficient that way.  In
%       particular, when the standard return address is used, you
%       should \def \returnaddress to something like
%
% CUSTOMIZING THE LABELS
%
% Commands for generating the labels are put on the .AUX file, which is
% read in and processed by the \end{document} command.  You have to
% define the following two commands:
%
%    \startlabels : Should reset the page layout parameters if
%        necessary.
%
%        label.
%

% SPACEFACTORS:
%   In return addresses, etc., periods are treated as any other character, due
%   to the preponderance of abbreviations.

\def\@dotfix{\sfcode\.\@m}

% FONTS

\font\uc=ucseal60
%\font\uc=cmr5 at 5\[email protected]
\font\five=cmr5 at 5\[email protected]
\font\six=cmr6 at 6\[email protected]
\font\topfont=cmr12 at 12\[email protected]
\font\emailfont=cmtt8 at 8\[email protected]

% DIMENSIONS

\newdimen\@lhdright        \@lhdright -4.5in
\newdimen\@lhddown         \@lhddown -26\[email protected]
\newdimen\@mhdright        \@mhdright 183\[email protected]
\newdimen\@mhddown         \@mhddown -44\[email protected]
\newdimen\emailskip        \emailskip9pt% baselineskip for email address
\setlength\footskip{79\[email protected]}
\newdimen\sigspace         \sigspace 36\[email protected]
\newdimen\@oldtextheight   \@oldtextheight\textheight

\let\@fixbottom\relax

\def\@dofixbottom{\let\@tempa\@evenfoot
\ifx\@empty\@oddfoot\else\let\@tempa\@oddfoot\fi
\ifx\@empty\@tempa\else\ifdim\footskip<20\[email protected]
\fi\fi}

\let\@fixbottom\@dofixbottom}

%    ****************************************
%    *        THE UCB LETTER FORMAT         *
%    ****************************************

%|% Redefine the page style for the first page, so as to include the letterhead.

%|\renewcommand{\[email protected]}{%
%|   \renewcommand{\@oddfoot}{<letterfoot goes here>}%
%|}

\hbox{\topfont UNIVERSITY OF CALIFORNIA, BERKELEY}
\vskip 8\[email protected]
\hbox{\def\dot{\lower1\[email protected]\hbox{$\cdot$}}\mathsurround2.9\[email protected]\five
\vbox{\hrule height0.2\[email protected]
\hbox to322\[email protected]{\vrule height9.2\[email protected] depth5.5\[email protected] width\[email protected]\
BERKELEY\dot DAVIS\dot IRVINE\dot LOS ANGELES\dot
RIVERSIDE\dot SAN DIEGO\dot SAN FRANCISCO\hss}
\hrule height0.2\[email protected]}%
\setbox0\hbox{\lower18\[email protected]\hbox{\uc C}}\ht0=26\[email protected]\dp0=30\[email protected]
\kern-4\[email protected]\box0\kern-4\[email protected]
\vbox{\hrule height0.2\[email protected]
\hbox to122\[email protected]{\vrule height9.2\[email protected] depth5.5\[email protected] width\[email protected]\hss
SANTA BARBARA\dot SANTA CRUZ }
\hrule height0.2\[email protected]}}
\vskip2\[email protected]}

% Mechanism for actually putting the letterhead at the top of the page

% how much to skip when letterhead is present
\count\letterheadins=1000 % length multiplication factor (1 to 1)

\def\@fixindentedwidth{\indentedwidth\textwidth

\longindentation293\[email protected]
\vskip\@tempdima
\parindent\[email protected]\parskip\[email protected]\@dotfix
% make left column
\setbox0\vbox{\let\\\par\six\baselineskip8pt%
\ifx\relax\departmentname
\typeout{No department name given; hope that's OK.}%
\else\departmentname\par\fi
\fromlocation\par
\wd0\longindentation
% make right column
\setbox2\vbox{\hsize 211\[email protected]
{\six\baselineskip8pt%
\[email protected]\par
\ifx\frommailcode\@empty\else-\frommailcode\fi\par
\telephonenum\par}%
\today}%
\hbox{\hskip\@lhdright\lower\ht0\box0\lower\ht2\box2}}}%

\noindent\hspace*{\longindentation}%
\@fixindentedwidth
\parbox\indentedwidth{\parindent\[email protected]\parskip\[email protected]\@dotfix\ignorespaces
\today\par}}}

\vskip\@tempdima
\@tempdima\@mhdright
\hbox to\@tempdima{\hss
\vbox{{\six\baselineskip8pt%
\ifx\@empty\fromlocation\else\hbox{\fromlocation}\fi
\ifx\@empty\[email protected]\else\hbox{\[email protected]}\fi
\ifx\@empty\telephonenum\else\hbox{\telephonenum}\fi}%
\vspace{36\[email protected]}\hbox{\today}}}}}

% The following line modified for inclusion of ucb letterhead.

% Modify the spacing at the bottom, too, to get better spacing.

\def\@textbottom{\ifnum\[email protected]=1\vskip\[email protected] plus 216\[email protected] minus 24\[email protected]
\else \vfil \fi}

% THE LETTER ENVIRONMENT

\newif\[email protected]

\renewenvironment{letter}[1]
{\@autocenter\@fixbottom
\newpage
\let\@signed1%
\[email protected] \ifodd\[email protected]
\else\thispagestyle{empty} \hbox{}\newpage\fi
\fi
\[email protected]\@ne
\@lettertrue\skip\letterheadins72\[email protected] plus 144\[email protected] minus 54\[email protected]
\let\subject\@gobble\let\re\@gobble
\interlinepenalty=200 % smaller than the TeXbook value
\@processto{\leavevmode\ignorespaces #1}}
{\stopletter\@@par\pagebreak\@@par
\[email protected]
\begingroup
\let\\=\relax
\let\protect\@[email protected]
\immediate\write\@auxout{%
\endgroup
\fi}

%    ****************************************
%    *         THE UCB MEMO FORMAT          *
%    ****************************************

\newlength{\sbjwid}

% hack for gobbling spaces (some ideas from latex.ltx)
\def\@futureletnext#1{\let\@flt#1\futurelet\next\@flti}
\def\@flti{\ifx\next\@sptoken\let\[email protected]\@fltii\else\let\[email protected]\@flt\fi\[email protected]}
\def\?{\@fltii}  \expandafter\def\? {\futurelet\next\@flti}% defines \@fltii
\let\?\undefined

\newenvironment{memo}[1]
{\@autocenter\@fixbottom
\newpage
\[email protected]\@ne
\pagestyle{memo}\thispagestyle{memo}%
\interlinepenalty=200 % smaller than the TeXbook value
\def\toname{#1}%
\@futureletnext\@memo} % skips spaces, too
{\stopletter\@@par\pagebreak\@@par}

\def\@memo{\ifx\next\subject\let\@tempa\@subject
\else
\ifx\next\re \let\@tempa\@re \else \let\@tempa\@memotop \fi
\fi
\@tempa}

\ifx\@signed1
\def\@memotop{\par
\noindent\parbox[t]{\textwidth}{\@dotfix\ignorespaces\toname\strut}\par
\ifx\@empty\sbjtext\else
\noindent\parbox[t]{\textwidth}%
{\@hangfrom{\makebox[\sbjwid][l]{\sbjtext:}}%
\ignorespaces \sbjbody\strut}\par
\fi}
\else
\def\@memotop{\par
\noindent\parbox[t]{\textwidth}{\@hangfrom{\makebox[\sbjwid][l]{To:}}%
\@dotfix\ignorespaces\toname\strut}\par
\noindent\parbox[t]{\textwidth}{\@hangfrom{\makebox[\sbjwid][l]{From:}}%
\@dotfix\ignorespaces
\ifx\@empty\fromsig \fromname \else \fromsig \fi\strut}\par
\ifx\@empty\sbjtext\else
\noindent\parbox[t]{\textwidth}%
{\@hangfrom{\makebox[\sbjwid][l]{\sbjtext:}}%
\ignorespaces \sbjbody\strut}\par
\fi}
\fi

\def\@subject#1#2{\def\sbjtext{Subject}\def\sbjbody{#2}%
\@memotop}
\def\@re#1#2{\def\sbjtext{Re}\def\sbjbody{#2}\@memotop}
\let\sbjtext\@empty

\def\subject#1{\@latexerr{\string\subject\space or \string\re\space macro must
IMMEDIATELY follow the \string\begin\space macro}{See LATEX local guide.}}
\let\re\subject

% Memo page style.

\six UNIVERSITY OF CALIFORNIA---(Letterhead for Interdepartmental Use)\hss}%

%    ****************************************
%    *          MORE DECLARATIVES           *
%    ****************************************

\def\department#1{\def\departmentname{#1}\let\frommailcode\@empty}
\let\departmentname\relax

\def\mailcode#1{\def\frommailcode{#1}}
\let\frommailcode\@empty

\let\[email protected]\@empty

\let\@emailcol 0
\def\emailatleft{\let\@emailcol l}
\def\emailatright{\let\@emailcol r}

% The following allows use of @' in the \email string, even with the amstex
% package.
\catcode\@=\active
\makeatletter

\newif\[email protected]  %\[email protected] (TeX default)
\let\closingatright\[email protected]
\let\closingatleft\[email protected]

% Opening and closing macros.

\renewcommand*{\opening}[1]{%
\[email protected]
\thispagestyle{empty}%
{\@dotfix\raggedright \ifx\@empty\toname\else\toname \\\fi
\def\next{#1}%
\ifx\@empty\next\else\ignorespaces#1\\\vspace{.8\baselineskip}\fi
}\nobreak
\else  % if memo
\@fixindentedwidth
\fi}

\renewcommand{\closing}[1]{\par\nobreak\vspace{\parskip}%
\stopbreaks
\ifx\@signed 1%
\ifnum\[email protected]=1%
\fi
\noindent
\[email protected] \hspace*{\longindentation}\fi
\parbox{\[email protected]\indentedwidth\else\textwidth\fi}{\@dotfix
\raggedright
\ignorespaces #1\\[\sigspace]%
\ifx\@empty\fromsig
\fromname
\else \fromsig \fi\strut}%
\par
\fi}

% Fix the spacing in the cc and encl commands.

\renewcommand*{\cc}[1]{%
\par\noindent\@dotfix
\parbox[t]{\textwidth}{%
\@hangfrom{\normalfont\ccname: }%
\ignorespaces #1\strut}\par}

\renewcommand*{\encl}[1]{%
\par\noindent\@dotfix
\parbox[t]{\textwidth}{%
\@hangfrom{\normalfont\enclname: }%
\ignorespaces #1\strut}\par}

% Redefine \stopletter to get better spacing.

\def\stopletter{\vskip\[email protected] plus 3in}
% Installation dependent options.

\department{DEPARTMENT OF MATHEMATICS}
\mailcode{3840}

\endinput
`