-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathucbletter.cls
311 lines (279 loc) · 10.1 KB
/
ucbletter.cls
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
% UC letterhead class
%
% NOTICE: I have made some local changes to this file. I have sent a
% patch to the owner, so please get the official version from
% <URL:http://www.cse.ucsc.edu/~elm/latex.shtml> when it becomes
% available instead of distributing this file.
% - Vebjorn Ljosa <[email protected]>
%
% $Log: ucletter.cls,v $
% Revision 1.5 2003/07/25 20:31:42 elm
% Major changes to ucletter.cls to make it look more like the standard
% UC letterhead.
%
% Added a class for doing biobibs.
%
% Revision 1.4 2003/05/11 18:04:19 elm
% Changed size of subcaption figures.
%
% Revision 1.3 2002/12/17 00:01:26 elm
% Minor formatting changes for UC letterhead.
%
% Revision 1.2 2002/12/09 19:15:30 elm
% Made changes including the use of "noaddress" to omit the
% return address.
%
% Revision 1.1 2002/06/07 21:58:38 elm
% This class is for printing letters on UC letterhead. It's similar to
% the old ucletter style, but is updated to use LaTeX2e stuff.
%
%
%
% Use the letterhead in the following way:
%
% \documentclass[ucsc,cs,shortfrom,11pt]{ucletter}
%
% \telephone{+1 (831) 459-1222}
% \email{[email protected]}
%
% This will set the document up for Computer Science at UCSC. Currently, only
% departments in the School of Engineering are supported, but this can easily
% be extended by other departments or UC schools.
%
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{ucbletter}
\RequirePackage{ifthen}
\RequirePackage{graphics}
\RequirePackage{mathptm}
\RequirePackage{times}
% Default is short return address
%\newcommand{\ucl@fromaddr}{short}
\newcommand{\ucl@fromaddr}{full}
% Defaults are for the Nuclear Engineering Department at UCB...
\newcommand{\ucl@univ}{UCB}
\newcommand{\ucl@campus}{Berkeley}
\newcommand{\ucl@school}{Department of Nuclear Engineering}
\newcommand{\ucl@univstreet}{4155 Etcheverry Hall, MC 1730}
\newcommand{\ucl@univtown}{Berkeley, CA 94720-1730}
\newcommand{\ucl@dept}{Department of Nuclear Engineering}
\newcommand{\ucl@deptphone}{+1 (510) 642-4077}
\newcommand{\ucl@deptfax}{+1 (510) 643-9685}
%\newcommand{\ucl@depturl}{http://www.cs.ucsc.edu/}
\newcommand{\ucl@telephone}{+1 (518) 229-3929}
\newcommand{\ucl@email}{[email protected]}
\newcommand{\ucl@fax}{}
\newcommand{\dept}[1]{\renewcommand{\ucl@dept}{#1}}
\newboolean{ucl@firstfooter}
\setboolean{ucl@firstfooter}{false}
\newboolean{ucl@otherfooter}
\setboolean{ucl@otherfooter}{false}
\newcommand{\ucl@pagetitle}{}
% These commands show up in the return address, but NOT in the footer on each page
\newcommand{\email}[1]{\renewcommand{\ucl@email}{#1}}
\newcommand{\fax}[1]{\renewcommand{\ucl@fax}{#1}}
\DeclareOption{ucsc}{
\renewcommand{\ucl@univ}{UCSC}
\renewcommand{\ucl@campus}{Santa Cruz}
\renewcommand{\ucl@depturl}{http://www.soe.ucsc.edu/}
\renewcommand{\ucl@univstreet}{Baskin Engineering Building}
\renewcommand{\ucl@univtown}{Santa Cruz, California 95064}
\DeclareOption{soe}{
\dept{Jack Baskin School of Engineering}
\renewcommand{\ucl@deptphone}{+1 (831) 459-2158}
\renewcommand{\ucl@school}{Jack Baskin School of Engineering}
\renewcommand{\ucl@deptfax}{+1 (831) 459-4829}
\renewcommand{\ucl@depturl}{http://www.soe.ucsc.edu/}
}
\DeclareOption{cs}{
\dept{Computer Science Department}
\renewcommand{\ucl@deptphone}{+1 (831) 459-5745}
\renewcommand{\ucl@school}{Jack Baskin School of Engineering}
\renewcommand{\ucl@deptfax}{+1 (831) 459-4829}
\renewcommand{\ucl@depturl}{http://www.cs.ucsc.edu/}
}
\DeclareOption{ce}{
\dept{Computer Engineering Department}
\renewcommand{\ucl@school}{Jack Baskin School of Engineering}
\renewcommand{\ucl@deptphone}{+1 (831) 459-5745}
\renewcommand{\ucl@deptfax}{+1 (831) 459-4829}
\renewcommand{\ucl@depturl}{http://www.ce.ucsc.edu/}
}
\DeclareOption{ee}{
\dept{Electrical Engineering Department}
\renewcommand{\ucl@school}{Jack Baskin School of Engineering}
\renewcommand{\ucl@deptphone}{+1 (831) 459-5745}
\renewcommand{\ucl@deptfax}{+1 (831) 459-4829}
\renewcommand{\ucl@depturl}{http://www.ee.ucsc.edu/}
}
\DeclareOption{ams}{
\dept{Applied Mathematics \& Statistics}
\renewcommand{\ucl@school}{Jack Baskin School of Engineering}
\renewcommand{\ucl@deptphone}{+1 (831) 459-4822}
\renewcommand{\ucl@deptfax}{+1 (831) 459-4829}
\renewcommand{\ucl@depturl}{http://www.ams.ucsc.edu/}
}
}
\DeclareOption{ucsb}{
\renewcommand{\ucl@univ}{UCSB}
\renewcommand{\ucl@campus}{Santa Barbara}
\renewcommand{\ucl@school}{}
\DeclareOption{cs}{
\renewcommand{\ucl@dept}{Department of Computer Science}
\renewcommand{\ucl@deptphone}{}
\renewcommand{\ucl@deptfax}{}
\renewcommand{\ucl@depturl}{http://www.cs.ucsb.edu/}
\renewcommand{\ucl@univstreet}{}
\renewcommand{\ucl@univtown}{Santa Barbara, California 93106-5110}
}
}
\DeclareOption{uci}{
\renewcommand{\ucl@univ}{UCI}
\renewcommand{\ucl@campus}{Irvine}
\renewcommand{\ucl@school}{Henri Samueli School of Engineering}
\DeclareOption{eecs}{
\renewcommand{\ucl@dept}{Department of Electrical Engineering and Computer Science}
\renewcommand{\ucl@deptphone}{949-824-4821}
\renewcommand{\ucl@deptfax}{}
\renewcommand{\ucl@depturl}{http://www.eng.uci.edu/}
\renewcommand{\ucl@univstreet}{325 Engineering Tower}
\renewcommand{\ucl@univtown}{Irvine, California 92697-2625}
}
}
\DeclareOption{nofrom}{
\renewcommand{\ucl@fromaddr}{none}
}
\DeclareOption{shortfrom}{
\renewcommand{\ucl@fromaddr}{short}
}
\DeclareOption{fullfrom}{
\renewcommand{\ucl@fromaddr}{full}
}
\DeclareOption{datefrom}{
\renewcommand{\ucl@fromaddr}{date}
}
\DeclareOption{noaddrfooter}{
\setboolean{ucl@firstfooter}{false}
\setboolean{ucl@otherfooter}{false}
}
\DeclareOption{addrfooterall}{
\setboolean{ucl@firstfooter}{true}
\setboolean{ucl@otherfooter}{true}
}
\DeclareOption{addrfooter}{
\setboolean{ucl@firstfooter}{false}
\setboolean{ucl@otherfooter}{true}
}
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{letter}}
\ProcessOptions
\LoadClass{letter}
\RequirePackage{fullpage}
\renewcommand{\telephone}[1]{\renewcommand{\ucl@telephone}{#1}}
\newcommand{\@sixrm}{\fontfamily{ptm}\fontsize{6}{8}\selectfont}
\newcommand{\@svnrm}{\fontfamily{ptm}\fontsize{7}{9}\selectfont}
\newcommand{\@egtrm}{\fontfamily{ptm}\fontsize{8}{10}\selectfont}
\newcommand{\@twlrm}{\fontfamily{ptm}\fontsize{12}{14}\selectfont}
\newcommand{\@ctrdot}{\hspace*{1.4pt}$\cdot$\hspace*{1.4pt}}
% Build the UC letterhead
\newsavebox{\@ucletterhead}
\sbox{\@ucletterhead}{\parbox[b]{7in}{
\begin{tabular*}{7in}{@{}l@{\extracolsep\fill}r@{}}
\@twlrm\selectfont UNIVERSITY OF CALIFORNIA, {\MakeUppercase \ucl@campus} &
\end{tabular*}\\
\begin{tabular*}{7in}{@{}l@{}c@{}r@{}}
\parbox{4.60in}{\rule{4.55in}{0.25pt} \\
\@svnrm BERKELEY\@ctrdot DAVIS\@ctrdot IRVINE\@ctrdot
LOS ANGELES\@ctrdot MERCED\@ctrdot RIVERSIDE\@ctrdot
SAN DIEGO\@ctrdot SAN FRANCISCO\hspace\fill \\
\rule[3pt]{4.55in}{0.25pt}} &
\parbox{0.75in}{\resizebox{0.75in}{!}{\includegraphics{ucsealnew}}}
\parbox{1.6in}{\rule{1.6in}{0.25pt} \\
\rule{0mm}{4pt}\hspace\fill
\@svnrm SANTA BARBARA\@ctrdot SANTA CRUZ\hspace*{1pt} \\
\rule[3pt]{1.6in}{0.25pt}}
\end{tabular*}
\vspace*{24pt}
\begin{minipage}{7in}
\@egtrm\MakeUppercase
\ucl@dept
\ifthenelse{\equal{\ucl@deptphone}{}}{}{\hspace\fill\ucl@deptphone} \\
\ifthenelse{\equal{\ucl@univstreet\ucl@deptfax}{}}{}{
\@egtrm\MakeUppercase \ucl@univstreet
\ifthenelse{\equal{\ucl@deptfax}{}}{}{ \hspace\fill FAX~\ucl@deptfax}
\\
}
\@egtrm\MakeUppercase \ucl@univtown \\
\end{minipage}
}
}
\newcommand{\@ucaddress}{
\begin{minipage}[t]{2.2in}
\ifthenelse{\equal{\ucl@fromaddr}{full}}{
% \ifthenelse{\equal{\ucl@dept}{}}{}{\ucl@dept\\}
\ucl@school \\
University of California \\
\ifthenelse{\equal{\ucl@univstreet}{}}{}{3115B Etcheverry Hall\\}
\ucl@univtown \\
}
{}
\ifthenelse{\equal{\ucl@fromaddr}{date}}{}{
\ifthenelse{\equal{\ucl@telephone}{}}{}{{\sc Phone:} \ucl@telephone\\}
\ifthenelse{\equal{\ucl@fax}{}}{}{{\sc Fax:} \ucl@fax\\}
\ifthenelse{\equal{\ucl@email}{}}{}{{\sc Email:} \ucl@email\\}
}
\@date
\end{minipage}
}
% Dot with spacing around it
\newcommand{\@spcdot}{\hspace{7pt}$\cdot$\hspace{7pt}}
% The argument is for a page number, in case you want to print the
% page number at the bottom of the page
\newcommand{\@addrfoot}[1]{
% return address in 9 point font
\begin{tabular}{c}
\fontfamily{ptm}\fontsize{8}{10}\selectfont
\sc \ucl@dept\@spcdot\ucl@univstreet\@spcdot\ucl@univtown \\
\fontfamily{ptm}\fontsize{8}{10}\selectfont
\sc Phone: \ucl@deptphone{\@spcdot}Fax: \ucl@deptfax\@spcdot\ucl@depturl
\end{tabular}
}
\newcommand{\pagetitle}[1]{\renewcommand{\ucl@pagetitle}{#1}}
\setlength{\topmargin}{-0.5in}
\setlength{\footskip}{0.5in}
\setlength{\textwidth}{7in}
\setlength{\oddsidemargin}{-0.25in}
\setlength{\evensidemargin}{-0.25in}
\newlength{\@ucaddrht}
\renewcommand{\ps@firstpage}
{
\setlength{\headheight}{0.9in}
\setlength{\headsep}{0.10in}
\setlength{\textheight}{8.5in}
\renewcommand{\@oddhead}{\centerline{\parbox{7in}{\usebox{\@ucletterhead}}}}
\renewcommand{\@evenhead}{}
% Use a blank for the page number - no number on the first page of the letter
\renewcommand{\@oddfoot}{\ifthenelse{\boolean{ucl@firstfooter}}{\@addrfoot{~}}{}}
\renewcommand{\@evenfoot}{\@oddfoot}
}
\renewcommand{\ps@headings}{
\setlength{\headheight}{0.25in}
\setlength{\headsep}{0.25in}
\setlength{\textheight}{9in}
% Right justify the page number
\renewcommand{\@oddhead}{\hspace*{\fill}\ucl@pagetitle\hspace*{\fill}\thepage}
\renewcommand{\@evenhead}{\@oddhead}
% Pass the page number to the footer, which doesn't do anything currently
\renewcommand{\@oddfoot}{\ifthenelse{\boolean{ucl@otherfooter}}{\@addrfoot{\thepage}}{}}
\renewcommand{\@evenfoot}{\@oddfoot}
}
\pagestyle{headings}
\renewcommand{\opening}[1]{
\thispagestyle{firstpage}
\vspace*{0.25in}
\ifthenelse{\equal{\ucl@fromaddr}{none}}{}{
\noindent\rule{4.25in}{0mm}
\@ucaddress
}
\par\noindent\toname \\ \toaddress
\vspace{1ex}
\noindent #1
}