]> projects.mako.cc - mit-stationery-latex/blob - mitletter2.cls
9df255a16456baf1d7c167e2cf50747bee6b903e
[mit-stationery-latex] / mitletter2.cls
1 \NeedsTeXFormat{LaTeX2e}
2 \ProvidesClass{mitletter2}
3
4 \DeclareOption*{\PassOptionsToClass{\CurrentOption}{letter}}
5 \ProcessOptions
6 \LoadClass{letter}
7 \usepackage[dvips]{graphics}
8 \usepackage[businessenvelope]{envlab}
9
10 \raggedright
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.625in}
18
19
20
21 \DeclareFixedFont{\boldfont}{OT1}{cmss}{bx}{n}{8}
22 \DeclareFixedFont{\regularfont}{OT1}{cmr}{m}{n}{8}
23 \DeclareFixedFont{\italicfont}{OT1}{cmr}{m}{it}{10}
24 \DeclareFixedFont{\IDfont}{OT1}{cmr}{m}{it}{8}
25
26
27 \newcommand{\officename}{Your Office Name}
28 \newcommand{\roomnumber}{X00-000}
29 \newcommand{\phonenum}{617.000.0000}
30 \newcommand{\faxnum}{617.000.0000}
31 \newcommand{\website}{web.mit.edu/abcdefghijk}
32 \newcommand{\email}{user@mit.edu}
33 \newcommand{\person}{Your name}
34 \newcommand{\ID}{Your title}
35
36 \renewcommand*{\opening}[1]{\ifx\@empty\fromaddress
37   \thispagestyle{firstpage}%
38     {\raggedleft\@date\par}%
39   \else  % home address
40     \thispagestyle{empty}%
41     {\raggedleft\begin{tabular}{l@{}}\ignorespaces
42       \fromaddress \\*[2\parskip]%
43       \@date \end{tabular}\par}%
44   \fi
45   \vspace{2\parskip}%
46   {\raggedright \toname \\ \toaddress \par}%
47   \vspace{2\parskip}%
48   #1\marginpar[\hfill test]\par\nobreak}
49 \renewcommand{\ps@headings}{% 
50   \let\@oddfoot\@empty\let\@evenfoot\@empty
51       \def\@oddhead{\slshape\headtoname{} \ignorespaces\toname
52                     \@date
53                     \hfil \pagename{} \thepage}%
54       \let\@evenhead\@oddhead}
55 \renewcommand*{\opening}[1]{\ifx\@empty\fromaddress
56   \thispagestyle{firstpage}%
57     \@date\\%
58   \else  % home address
59     \thispagestyle{empty}%
60     {\raggedleft\begin{tabular}{l@{}}\ignorespaces
61       \fromaddress \\*[2\parskip]%
62       \@date \end{tabular}\par}%
63   \fi
64   \vspace{2\parskip}%
65   {\raggedright \toname \\ \toaddress \par}%
66   \vspace{2\parskip}%
67   #1\par\nobreak}
68 \renewcommand*{\signature}[1]{\def\fromsig{\italicfont #1}}
69
70
71 \newsavebox{\MassInstTech}
72 \newsavebox{\place}
73 \newsavebox{\mainaddress}
74 \newsavebox{\contactinfo}
75
76 \sbox{\MassInstTech}
77      {\parbox[b]{160mm}
78        {\setlength{\baselineskip}{9.2pt}\begin{center}\scalebox{.4}{\includegraphics*{mitlogo.eps}}\\[9.2pt]\boldfont{Massachusetts Institute of Technology}\\\vspace{9.2pt}\regularfont{\person}\\\IDfont{\ID}\end{center}}}
79
80 \sbox{\place}
81      {\parbox[t]{7.29cm}
82        {\setlength{\baselineskip}{9.2pt}{\boldfont Office name} \\ {\regularfont Building X00-000}}}
83
84 \sbox{\contactinfo}
85      {\parbox[t]{3.59cm}
86        {\setlength{\baselineskip}{9.2pt}\regularfont{Phone\hspace{4mm}    \phonenum\\
87            Fax\hspace{7.5mm}      \faxnum\\
88            Email \hspace{3.6mm} \email\\
89            \website}}}
90
91 \sbox{\mainaddress}
92      {\parbox[t]{4.13cm}
93        {\setlength{\baselineskip}{9.2pt}\regularfont{77 Massachusetts Avenue\\
94            Cambridge, Massachusetts\\
95            02139-4307}}}
96            
97
98 \newsavebox{\footer}
99 %put it all together
100 \sbox{\footer}
101      {\raisebox{1cm}{\parbox[t]{16.51cm}
102        {\hspace{.25in}\usebox{\place} \usebox{\mainaddress} \usebox{\contactinfo}}}}
103
104 \newsavebox{\envelope}
105 \sbox{\envelope}
106      {\parbox[t]{6cm}{\setlength{\baselineskip}{9.2pt}\boldfont{\officename}\\\\\\\hspace*{.5in}\scalebox{.25}{\includegraphics*{mitlogo.eps}}\\\\\boldfont{Massachusetts Institute of Technology}\\\regularfont{77 Massachusetts Avenue, Building \roomnumber}\\\regularfont{Cambridge, MA 02139-4307}}}
107
108 \renewcommand{\returnaddress}{\protect\usebox{\envelope}}
109
110 %make sure the header goes on the first page
111 \renewcommand{\ps@firstpage}
112              {\setlength{\headheight}{3cm}\setlength{\headsep}{1cm}%
113                \renewcommand{\@oddhead}{\usebox{\MassInstTech}}%
114                \renewcommand{\@oddfoot}{\raisebox{55pt}[0pt]{\usebox{\footer}}}}
115
116 \providecommand{\@evenhead}{}\providecommand{\@oddhead}{}
117 \providecommand{\@evenfoot}{}\providecommand{\@oddfoot}{}
118
119 \pagestyle{headings}

Benjamin Mako Hill || Want to submit a patch?