-
Notifications
You must be signed in to change notification settings - Fork 1
/
uw-cs-letterhead.cls
86 lines (68 loc) · 2.06 KB
/
uw-cs-letterhead.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
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% customization via package options
%
\RequirePackage{kvoptions}
\SetupKeyvalOptions{prefix=uw@}
\DeclareBoolOption{preprinted}
\DeclareStringOption{username}
\DeclareStringOption[2-1204]{extension}
\DeclareDefaultOption{%
\PassOptionsToClass{\CurrentOption}{letter}%
}
\ProcessKeyvalOptions*
\LoadClass{letter}
\RequirePackage{etoolbox}
\RequirePackage{fancyhdr}
\RequirePackage[margin=1in]{geometry}
\RequirePackage{graphicx}
\RequirePackage{hyperref}
\RequirePackage{midtilde}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% footer
%
\newcommand{\uw@mailto}[1]{\href{mailto:#[email protected]}{#[email protected]}}
\newcommand{\uw@footer}[0]{
\begin{minipage}[b]{\textwidth}
\centering
\sffamily
%
\fontsize{11}{13}\selectfont
\textbf{%
\ifcsempty{fromname}{}{\fromname, }%
Department of Computer Sciences}
\fontsize{10}{12}\selectfont
%
University of Wisconsin--Madison \quad
1210 W. Dayton Street \quad
Madison, Wisconsin 53706
\href{tel:+1-(608)-26\uw@extension}{608/26\uw@extension} \quad
Fax: \href{fax:+1-(608)-262-9777}{608/262-9777} \quad
E-mail: \uw@mailto{\ifcsempty{uw@username}{chair}{\uw@username}} \quad
\ifcsempty{uw@username}{%
\href{http://www.cs.wisc.edu/}{www.cs.wisc.edu}}{%
\href{http://pages.cs.wisc.edu/~\uw@username/}{pages.cs.wisc.edu/\midtilde\uw@username}}
\end{minipage}}
\fancypagestyle{firstpage}{%
\renewcommand{\headrulewidth}{0pt}
\setlength{\footskip}{50pt}
\fancyhf{}
\notbool{uw@preprinted}{\fancyfoot[C]{\uw@footer}}{}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% top logo
%
\newsavebox{\@uwlogo}
\savebox{\@uwlogo}{\includegraphics[height=1.65in]{uw-logo}}
\apptocmd{\letter}{%
\vspace*{-1.15in}
\begin{center}%
\ifbool{uw@preprinted}{%
\newlength{\@uwlogoheight}
\settoheight{\@uwlogoheight}{\usebox{\@uwlogo}}
\rule{0pt}{\@uwlogoheight}
}{%
\usebox{\@uwlogo}%
}
\end{center}}{}{}