summaryrefslogtreecommitdiff
path: root/macros/latex209/contrib/misc/windlet.doc
blob: dc77cd1dddec467876deb38aa6b321d89f0f720b (plain)
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
\iffalse
% This is windlet.doc.  Print it using doc.sty and an appropriate
% driver file.
% Copyright D.Love, SERC Daresbury Laboratory, 1990
% Distributable and usuable under conditions of the GNU copyleft, but
% please mark any changes and list them here.
\fi
\def\filedate{26/7/90}
\def\fileversion{1.1}
% \title{A {\sf letter} Sub-style for Use with Window
% Envelopes\footnote{File version \fileversion, dated \filedate.}}
% \author{David Love\\[1ex]{\it SERC Daresbury
% Laboratory, Warrington WA4 4AD, UK}\\[1ex]
% ({\tt d.love@daresbury.ac.uk})}
% \date{}
%
% \maketitle
%
% \begin{abstract}
% \noindent This is a sub-style for use with {\sf letter} that can be
% used with certain types of envelope with windows so that the address
% will show through the window.
% \end{abstract}
%
% \noindent
% It is convenient, rather than use a sticky address label for a one-
% or few-off letter, to use envelopes with transparent windows.  We
% then need to make sure that the {\sf letter} style is suitably
% altered so print the \verb+\toaddress+ in the correct place for this
% window.  Of course, the values of the positioning will depend on the
% stationery you use.  This version is intended for use with A4 paper
% i.e., using {\tt a4.sty},
% and $8.62''\times3.34''$ envelopes as used in my establishment, at
% least.  This will probably be
% suitable also for other European countries.  If not, the dimensions
% should be readily changeable for your stationery, according to the
% following diagrams.
% \par \medskip
% \setlength{\unitlength}{6mm}
% \begin{picture}(8.25,6.69)(0,5)
% \put(0,5){\line(0,1){6.69}} \put(0,11.69){\line(1,0){8.25}}
% \put(8.25,11.69){\line(0,-1){6.69}} 
% \put(.85,10.2){\vector(-1,0){.85}}\put(0,10.2){\vector(1,0){.85}}
% \put(.2,10.5){\tt\small $\backslash$lettersideskip}
% \put(.85,8.4){\framebox(3.35,1.5){\parbox{3\unitlength}{\raggedright
% \tt\small $\backslash$toaddress region}}}
% \put(4.0,9.9){\vector(0,1){1.79}}\put(4.0,11.69){\vector(0,-1){1.79}}
% \put(4.0,10.7){\tt\small ~$\backslash$lettertopskip}
% \put(.5,7.75){\vector(-1,0){.5}} \put(.5,7.75){~first fold}
% \put(4.0,7.75){\vector(0,1){.65}}\put(4.0,8.4){\vector(0,-1){.65}}
% \put(4.0,7.75){\tt\small ~$\backslash$letterfoldskip}
% \put(4.4,8.4){\vector(0,1){1.5}} \put(4.4,9.9){\vector(0,-1){1.5}}
% \put(4.4,9){~\tt\small $\backslash$letteraddressheight}
% \put(3,6){{\large letter}}
% \end{picture}
% \hfill
% \begin{picture}(8.6,4.35)(0,0)
% \put(0,0){\framebox(8.6,4.35){}}
% \put(.65,.85){\framebox(3.65,1.55){window}}
% \put(4.5,.85){\vector(0,1){1.55}} \put(4.5,2.4){\vector(0,-1){1.55}}
% \put(4.5,1.3){~$1.55''$}
% \put(.65,.9){\vector(-1,0){.65}}\put(0,.9){\vector(1,0){.65}}
% \put(.3,.2){$0.65''$}
% \put(.65,4.35){\vector(0,-1){1.9}}\put(.65,2.45){\vector(0,1){1.9}}
% \put(.65,3.2){~$1.9''$}
% \put(5,3.5){{\large envelope}}
% \end{picture}
% \par\medskip
% Here are the default values of the lengths,
% \DescribeMacro{\lettertopskip}\DescribeMacro{\lettersidepskip}%
% \DescribeMacro{\letteraddressheight}\DescribeMacro{\letterfoldskip}%
% appropriate for my stationery. 
%    \begin{macrocode}
\newlength{\lettertopskip} \setlength{\lettertopskip}{1.8in}
\newlength{\lettersideskip} \setlength{\lettersideskip}{0.8in}
\newlength{\letteraddressheight} 
\setlength{\letteraddressheight}{1.5in}
\newlength{\letterfoldskip} \setlength{\letterfoldskip}{0.65in}
%    \end{macrocode}
%
% We only need major surgery on \verb+\opening+,\DescribeMacro{\opening}
% which positions the
% addresses.  The difficulty is positioning boxes in the right
% absolute place on the paper.
%    \begin{macrocode}
\def\opening#1{
%    \end{macrocode}
% The {\sf firstpage} style is defined below.
%    \begin{macrocode}
  \thispagestyle{firstpage}
%    \end{macrocode}
% To get to the bottom of the address area, we have to move down by
% \verb+\lettertopskip+ from the top of the paper.  However, we have
% to take into account the conventional $1''$ border,
% \verb+\topmargin+, \verb+\headheight+, \verb+\headsep+ and
% \verb+\baselineskip+ in doing so.
%    \begin{macrocode}
  \vspace*{\lettertopskip}
  \vspace*{-\topmargin} \vspace*{-\headheight} \vspace*{-\headsep}
  \vspace*{-1in} \vspace*{-\baselineskip}
%    \end{macrocode}
% Now that we're in the right place vertically, we're ready to typeset 
% the addressee details.
% To get to the left-hand side of the address area, we have to
% subtract the $1''$ and \verb+\oddsidemargin+ from
% \verb+lettersideskip+, which will probably mean the address sticks
% into the margin.  The addressee's and sender's addresses go in boxes
% at the left and right of the page, aligned at their top.  This is
% not the same as in the original, where the sender's address pushed
% the addressee'd down the page.  This all goes into an \verb+\hbox+
% positioned appropriately relative to the left margin.  Since the
% window is bigger than the address area, we don't need to add extra
% space around it.
%    \begin{macrocode}
  \hbox{% 
    \hspace*{\lettersideskip}\hspace*{-\oddsidemargin}\hspace*{-1in}%
%    \end{macrocode}
% The first thing we do, though, is to put a mark at the left to tell
% us where to fold the paper.  This may get lost, depending on how
% close to the edge of the paper the printer can go, so might need
% adjusting for your circumstances.  The size of the rule is rather
% arbitrary. 
%    \begin{macrocode}
    \vbox to 0pt{\vspace*{\letterfoldskip}\hbox to 0pt{%
      \hspace*{-\lettersideskip}%
      \hspace*{.2in}% to get to imageable area
      \rule{.2in}{.2pt}\hss}\vss
    }%
%    \end{macrocode}
% Unlike the original, we check for a possible
% empty argument to \verb+\begin{letter}+, which would cause an
% error (although there's not much point in using this sub-style if
% you don't have the address in there!).  We add \verb+\vfill+ to
% centre the address in the window vertically.  (It had better not be
% too long.)
%    \begin{macrocode}
    \ifx\@empty\toaddress
      \vbox to \letteraddressheight {\vfill \raggedright \toname \vfill}
    \else
      \vbox to \letteraddressheight 
        {\vfill \raggedright \toname \\ \toaddress \vfill}
    \fi
%    \end{macrocode}
% The sender's address is set the same way as in the original, but in
% a different place.
%    \begin{macrocode}
    \ifx\@empty\fromaddress
      \relax
    \else
      \vbox to \letteraddressheight {
        \vfill
        \begin{tabular}[b]{l}
          \ignorespaces\fromaddress
        \end{tabular} 
        \vfill
      }
    \fi 
  } % (hbox)
%    \end{macrocode}
% The date always comes out in the same place.
%    \begin{macrocode}
  \par \smallskip
  {\raggedleft \@date \par}
  \bigskip #1 \par \nobreak
} % (\def\opening)
%    \end{macrocode}
% The original value of \verb+\@texttop+\DescribeMacro{\@texttop}
% included \verb+fil+ to centre
% a short letter on the page; we don't want this.
%    \begin{macrocode}
\let\@texttop=\relax
%    \end{macrocode}
%
% The \verb+\pagestyle+\DescribeEnv{firstpage}
% for the first page may be chosen appropriately
% for your institution.  This is done by defining \verb+\ps@headings+
% appropriately.  {\tt letter.sty} does this to put the telephone
% number in the right place for the SRI letterhead, which isn't much
% use for most of us.  In the absence of a better idea, we'll make the
% style {\sf empty}.  If you want special action for this, you'll
% have to change this definition or include it in a later sub-style.
%    \begin{macrocode}
\let\ps@firstpage=\ps@empty
%    \end{macrocode}