]> projects.mako.cc - mit-stationery-latex/blob - mitletter3.cls
2c068ec56ff909cd78681f0b765bfc80779894cf
[mit-stationery-latex] / mitletter3.cls
1 \NeedsTeXFormat{LaTeX2e}
2 \ProvidesClass{mitletter3}
3 \DeclareOption*{\PassOptionsToClass{\CurrentOption}{letter}}
4 \ProcessOptions
5 \LoadClass{letter}
6 \usepackage[dvips]{graphics}
7 \usepackage[businessenvelope]{envlab}
8
9 \raggedright
10
11 \setlength{\topmargin}{-.80in}
12 \setlength{\oddsidemargin}{-.25in}
13 \setlength{\evensidemargin}{-.25in}
14 \setlength{\textwidth}{7in}
15 \setlength{\textheight}{8in}
16 \setlength{\headsep}{1in}
17 \setlength{\footskip}{1.125in}
18
19 \DeclareFixedFont{\boldfont}{OT1}{cmss}{bx}{n}{8}
20 \DeclareFixedFont{\regularfont}{OT1}{cmss}{m}{n}{8}
21  \DeclareFixedFont{\italicfont}{OT1}{cmr}{m}{it}{10}
22
23 \renewcommand*{\opening}[1]{\ifx\@empty\fromaddress
24   \thispagestyle{firstpage}%
25     {\raggedleft\@date\par}%
26   \else  % home address
27     \thispagestyle{empty}%
28     {\raggedleft\begin{tabular}{l@{}}\ignorespaces
29       \fromaddress \\*[2\parskip]%
30       \@date \end{tabular}\par}%
31   \fi
32   \vspace{2\parskip}%
33   {\raggedright \toname \\ \toaddress \par}%
34   \vspace{2\parskip}%
35   #1\par\nobreak}
36 \renewcommand{\ps@headings}{% 
37   \let\@oddfoot\@empty\let\@evenfoot\@empty
38       \def\@oddhead{\slshape\headtoname{} \ignorespaces\toname
39                     \@date
40                     \hfil \pagename{} \thepage}%
41       \let\@evenhead\@oddhead}
42 \renewcommand*{\opening}[1]{\ifx\@empty\fromaddress
43   \thispagestyle{firstpage}%
44     \@date\\%
45   \else  % home address
46     \thispagestyle{empty}%
47     {\raggedleft\begin{tabular}{l@{}}\ignorespaces
48       \fromaddress \\*[2\parskip]%
49       \@date \end{tabular}\par}%
50   \fi
51   \vspace{2\parskip}%
52   {\raggedright \toname \\ \toaddress \par}%
53   \vspace{2\parskip}%
54   #1\par\nobreak}
55 \renewcommand*{\signature}[1]{\def\fromsig{\italicfont #1}}
56 \newcommand{\officename}{Office Name}
57 \newcommand{\associateofficename}{Associate office name (optional)}
58 \newcommand{\roomnumber}{X00-000}
59 \newcommand{\phonenum}{617.000.0000}
60 \newcommand{\faxnum}{617.000.0000}
61 \newcommand{\website}{web.mit.edu/abcdefghijk}
62 \newcommand{\email}{user@mit.edu}
63 \newcommand{\person}{Your name}
64 \newcommand{\ID}{Your title}
65 \newsavebox{\OfficeStuff}
66 \newsavebox{\MITlogo}
67 \newsavebox{\contactinfo}
68 \newsavebox{\phonestuff}
69
70
71 \sbox{\OfficeStuff}
72      {\parbox[t]{7.41cm}{\setlength{\baselineskip}{9.2pt}\boldfont \officename\\\associateofficename}}
73
74 \sbox{\MITlogo}
75      {\parbox[t]{2.19cm}
76        {\raisebox{-7mm}{\scalebox{.3}{\includegraphics{mitlogo.eps}}}}}
77 \sbox{\contactinfo}
78      {\parbox[t]{7.37cm}
79        {\setlength{\baselineskip}{9.2pt}\boldfont{Massachusetts Institute of Technology}\\
80          \regularfont{77 Massachusetts Avenue, \roomnumber\\
81            Cambridge, Massachusetts 02139-4307}}}
82 \sbox{\phonestuff}
83      {\parbox[t]{7.37cm}{\setlength{\baselineskip}{9.2pt}\regularfont{Phone\hspace{2mm}\phonenum\\Fax\hspace{5.5mm}\faxnum\\Email\hspace{2mm} \email\\\website}}}
84 \newsavebox{\nameandtitle}
85 \sbox{\nameandtitle}
86      {\parbox[t]{3in}{\setlength{\baselineskip}{9.2pt}\boldfont{\person }\\\regularfont{\ID }}}
87 \newsavebox{\header}
88 \setlength{\arrayrulewidth}{2pt}
89 \sbox{\header}
90      {\parbox[t]{\textwidth}
91        {\begin{tabular*}{\textwidth}{lll@{\extracolsep{\fill}}}
92          \usebox{\OfficeStuff} & \raisebox{.05in}{\usebox{\MITlogo}} & \usebox{\contactinfo} \\
93          &&\\
94          \hline\\
95          \usebox{\nameandtitle}&&\usebox{\phonestuff}
96      \end{tabular*}}}
97
98 \newsavebox{\footer}
99
100 \sbox{\footer}
101      {\parbox[t]{\textwidth}{\rule{\textwidth}{3mm}}}
102 \newsavebox{\envpic}
103 \sbox{\envpic}
104      {\parbox[t]{.75in}
105        {\scalebox{.33}{\includegraphics{mitlogo.eps}}}}
106 \newsavebox{\envtop}
107 \sbox{\envtop}
108      {\parbox[t]{2.5in}
109        {\setlength{\baselineskip}{9.2pt}\boldfont{\officename\\\associateofficename}}}
110
111 \newsavebox{\envbottom}
112 \sbox{\envbottom}
113      {\parbox[b]{2.5in}
114        {\setlength{\baselineskip}{9.2pt}\boldfont{Massachusetts Institute of Technology}\\\regularfont{77 Massachusetts Avenue, Building \roomnumber}\\\regularfont{Cambridge, MA 02139-4307}}}
115
116 \newsavebox{\envelope}
117 \sbox{\envelope}
118      {\parbox[t]{3.25in}
119        {\hspace{.75in}\raisebox{.125in}{\usebox{\envtop}}\\\rule{3.25in}{2pt}\\\\\usebox{\envpic}\usebox{\envbottom}}}
120
121 \renewcommand{\returnaddress}{\protect\usebox{\envelope}}
122
123
124
125
126 %make sure the header goes on the first page
127 \renewcommand{\ps@firstpage}
128              {\setlength{\headheight}{70pt}\setlength{\headsep}{25pt}%
129                \renewcommand{\@oddhead}{\usebox{\header}}%
130                \renewcommand{\@evenhead}{}\renewcommand{\@evenfoot}{}\renewcommand{\@oddfoot}{\usebox{\footer}}}
131
132 \providecommand{\@evenhead}{}\providecommand{\@oddhead}{}
133 \providecommand{\@evenfoot}{}\providecommand{\@oddfoot}{}
134
135 \pagestyle{headings}

Benjamin Mako Hill || Want to submit a patch?