summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/context/third/letter/doc/correspondence-letter-beginner.tex
blob: d4f8f27a9d188caebb0b8cfa30e820ac2b735db5 (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
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
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
\startcomponent correspondence-letter-beginner

\environment correspondence-environment

\chapter{Beginners guide}

%This chapter will help you to write your own letter without studying first the complete manual, only the most important information are given to get a result with the default styles.

The most important in the module for the users is the interface to write the letter text and to set the values for one or more letters.

You will learn how to write a letter with the module step by step, beginning with just a few lines of text, following with opening and closing sentences and at the end after you know how to set every kind of information you will finally learn how to change the position of the reference line and how to change the texts for the labels and to customise their style and color.

\startbuffer[interface:text]
\startletter
\input knuth\par
\stopletter
\stopbuffer

\start

\setupletter[alternative=none]

\getbuffer[interface:text]

\stop

\section{Pure text}

To understand how a letter is written let's study the code for the example letter on the left page.

\starttyping
\usemodule[letter]

\starttext

\startletter
Thus, I came to the conclusion ...
\stopletter

\stoptext
\stoptyping

As you could see from the first line the letter module has to be loaded before it could used because it is none of the functions \CONTEXT\ provides by default, to make the examples in the following sections a little bit shorter I will no longer add \type {\usemodule}, \type {\starttext} and \type {\stoptext} but you shouldn't forgot to add all of them in your files.

The content for your letter is written between the letter environment, it doesn't matter if you use blank lines before and after the letter text.

If you take a closer look at the result on the left side you could see the paragraphs are separated by blank lines, this could be changed with the \type {\setupletterstyle} command but let us keep this for later.

You're not restricted to only one letter in file, it is possible to write as many as you like in a file and you could use this to write serial letters but a easier method to do this is described later in the manual.

\startbuffer[interface:opening]

\setupletter
  [opening={Dear Reader,},
   closing={Greetings from the Author}]

\getbuffer[interface:text]

\stopbuffer

\start

\setupletter[alternative=none]

\getbuffer[interface:opening]

\stop

\section{Opening and closing}\index{opening}\index{closing}

You saw in the last example how to write a simple text but shouldn't it be possible to give a few opening and also closing words for the letter, because the reader should know for whom the content is.

To achieve this the module provides the two variables {\em opening} and {\em closing}. To feed them with text you could either use the optional argument for \type {\startletter} as done in the current or you could set them before the content of the letter with the two commands \type {\setupletter} and \type {\setlettervalue}.

Let us begin with first alternative and set them as argument with \type {\startletter}:

\starttyping
\startletter
  [opening={Dear Reader,},
   closing={Greetings from the Author}]
Thus, I came to the conclusion ...
\stopletter
\stoptyping

If you don't like this method you could set the two value before the letter environment with the \type {\setupletter} command, the text in your file should now look like:

\starttyping
\setupletter
  [opening={Dear Reader,},
   closing={Greetings from the Author}]

\startletter
Thus, I came to the conclusion ...
\stopletter
\stoptyping

\startframedtext[width=\textwidth,framecolor=red,align=flushleft,corner=00]\index{\tex{setlettervalue}}
The definition of the \type{\setuplettervalue} has changed in the module version from 2009.07.03,
only braces are allowed to set values, brackets are optional and used to set the labeltext for
the value in the current mainlanguage, the setup for both variants is:

\starttyping
\setlettervalue{key}{value}
\setlettervalue{key}[labeltext]{value}
\stoptyping
\stopframedtext

If you are more interested in a KOMA-Script like solution to set with every command only one value their is as last alternative the \type {\setlettervalue} command, it comes in two different versions where the keyword is either written in braces or in bracket but the content itself is written between braces.

The first version with braces for two values has the following look.

\starttyping
\setlettervalue{opening}{Dear Reader,}
\setlettervalue{closing}{Greetings from the Author}
\stoptyping

The nearly no difference to the second version and both give the same result and you could the one which you prefer.

\starttyping
\setlettervalue[opening]{Dear Reader,}
\setlettervalue[closing]{Greetings from the Author}
\stoptyping

The values itself had to be given before the letter environment because values in the letter text are ignored and will never be shown in the output.

You have also to be careful with the content for the values because commas are interpreted as end of the value if you write it as argument for \type {\startletter} or with \type {\setupletter} and the text has to be protected with braces in this case but you don't need them is their is no comma in you text.

This could not happen if you set the values with the \type {\setlettervalue} command because the content is delimited by the braces and commas are just normal text.

\page[left]

\startbuffer[interface:subject]

\setupletter
  [subject={Step by step guide to write a letter}]

\getbuffer[interface:opening]

\stopbuffer

\start

\setupletter[alternative=none]

\getbuffer[interface:subject]

\stop

\section{Subject}\index{subject}

After you read how to write the text and set values for the opening and closing we mention now how we could write a subject.

Instead of integrating this point in the last section I wrote a new to let you understand the system. Before I will tell more let's take a look at the code.

\starttyping
\startletter
  [opening={Dear Reader,},
   subject={Step by step guide to write a letter},
   closing={Greetings from the Author}]
Thus, I came to the conclusion ...
\stopletter
\stoptyping

The text for the subject is written as argument for {\em subject} as argument for \type {\startletter}, as you already guess you could have set it also with \type {\setupletter} or \type {\setlettervalue} and this is also possible and true for the values in the following sections.

Besides the {\em subject} you have also the option to set a {\em title} for the letter, the is no big difference between them but the title is normally written before the subject and has and use a slightly bigger size or is emphasized in another way.

\startbuffer[interface:address]

\setupletter
  [toname={Mike Wilson},
   toaddress={Linden street 12\\78569 TeX City}]

\getbuffer[interface:subject]

\stopbuffer

\start

\setupletterstyle[whitespace=line]

\getbuffer[interface:address]

\stop

\section{Address}\flushatnextpar{\index{toname}\index{toaddress}}

Letter are normally meant to be send by post and to prevent you from writing the address by hand on the envelope you could buy envelopes with windows. To use these envelopes the address has to be written on the letter and to do this you have to set the {\em name} and the {\em address} for the addressee with the two values {\em toname} and {\em toaddress}.

The input for the example on the left page looks like:

\starttyping
\setupletter
  [toname={Mike Wilson},
   toaddress={Linden street 12\\78569 TeX City}]

\startletter
  [opening={Dear Reader,},
   subject={Step by step guide to write a letter},
   closing={Greetings from the Author}]
Thus, I came to the conclusion ...
\stopletter
\stoptyping

The author prefer to set the values for the addressee not with \type {\startletter} but with \type {\setupletter} but this is just a matter of style and you could select what fits best to your own working style.

\startbuffer[interface:sender]

\setupletter
  [fromname={The Author},
   fromaddress={Hidden Street 2\\57895 Mystery town}]

\getbuffer[interface:address]

\stopbuffer

\start

\getbuffer[interface:sender]

\stop

\section{Sender}\index{fromname}\index{fromaddress}

It is not often enough to have just the addressee information on the letter, you're looking also for way to put the {\em name} and {\em address} for the sender into the header.

If you have wondered why the author hasn't just used {\em name} and {\em address} as keys for the addressee values you will now find the solution. To make the system consistent to set the values for addressee and the sender both needed key names to prevent confusions which value should use the the simpler and which one a more verbose one both got e prefix to the key to differentiate them, so got addressee information the prefix {\em to} and sender information the prefix {\em from}.%\footnote{The real answer is the author took the names for the new user interface from KOMA-Script and this is where most of the commands have their name from.}

The additional input for the example on the left page to the one from the previous examples is:

\starttyping
\setupletter
  [fromname={The Author},
   fromaddress={Hidden Street 2\\57895 Mystery town}]
\stoptyping

The manual will describe in a later section how to write a own header with a personal look and feel but this is outside of the user interface and requires knowledge about the layout.

\startbuffer[interface:reference]

\setupletter
  [name={Ben Johnson},
   phone={4922-89564},
   fax={4922-89564}]

\setupletter
  [list={name,phone,fax,date}]

\getbuffer[interface:sender]

\stopbuffer

\start

\getbuffer[interface:reference]

\stop

\section{Reference line}

If you're in a company or a organisation you need sometimes a few extra information on your letter. The reference line or block is the right place where you can place these information.

Our old example from the last section was now extended by a reference line between the information from our addressee and the subject line, the information for the four fields were set with the following code.

\starttyping
\setupletter
  [name={Ben Johnson},
   phone={4922-89564},
   fax={4922-89564},
   date=\currentdate]

\setupletter
  [list={name,phone,fax,date}]
\stoptyping

The first \type {\setupletter} set the content for the four fields {\em name}, {\em phone}, {\em fax} and {\em date}. Although the values are set none of them will appear in the output but we have to declare the fields for the reference line first, this is done in the second \type {\setupletter} command with the key {\em list}, the entries will appear in the in the same order as you write them in the list, if one or more of the keys in the list have no values they will still appear in the output but no content is shown.

If you change the content for the {\em list} key in your file the module will show by default the date of the current date at the right side of the reference line, this will normally always happen and you could say the result in the examples of the two preceding sections.

\startbuffer[interface:signature]

\setupletter
  [signature={Arthur Thor}]

\getbuffer[interface:reference]

\stopbuffer

\start

\getbuffer[interface:signature]

\stop

\section{Signature}\index{signature}

You know now ho to set the letter text, the opening and closing lines, the values for the addressee and the sender and also how define your own values for the reference line.

Most of the things need for a letter are already told but a few fields at the end of the letter remains untold, the first line you will add to our example letter is the signature. It is set with the {\em signature} in se same way as the other values in the former examples. What the author did in the left example was:

\starttyping
\setupletter
  [signature={Arthur Thor}]
\stoptyping

There is some space between the closing and the signature to give you the possibility to sign the letter also by hand after you have printed the letter.

You're not limited to simple text for the signature, it is also possible to use a graphic if you won't sign the letter by hand after you printed it, such a solution would have been for the author the next code.

\starttyping
\setupletter
  [signature={\externalfigure[autograph][height=2\lineheight]}]
\stoptyping

How to adjust the space between the closing line and the signature for this way will be shown in the letter style section.

\start

\setupletter
  [name={Ben Johnson},
   phone={4922-89564},
   fax={4922-89564}]

\setupletter
  [list={name,phone,fax,date}]

\setupletter
  [fromname={The Author},
   fromaddress={Hidden Street 2\\57895 Mystery town}]

\setupletter
  [toname={Mike Wilson},
   toaddress={Linden street 12\\78569 TeX City}]

\startletter
  [opening={Dear Reader,},
   subject={Step by step guide to write a letter},
   closing={Greetings from the Author},
   signature={Arthur Thor}]

\input knuth\par

\ps{Postscript}

\stopletter

\stop

\section{Postscript}\index{postscript}\index{\tex{ps}}

\starttyping
\startletter

...

\ps{...}

\stopletter
\stoptyping

\start

\setupletter
  [name={Ben Johnson},
   phone={4922-89564},
   fax={4922-89564}]

\setupletter
  [list={name,phone,fax,date}]

\setupletter
  [fromname={The Author},
   fromaddress={Hidden Street 2\\57895 Mystery town}]

\setupletter
  [toname={Mike Wilson},
   toaddress={Linden street 12\\78569 TeX City}]

\startletter
  [opening={Dear Reader,},
   subject={Step by step guide to write a letter},
   closing={Greetings from the Author},
   signature={Arthur Thor}]

\input knuth\par

\ps{Postscript}

\encl{Appendices}

\stopletter

\stop

\section{Enclosure}\index{enclosure}\index{\tex{encl}}

\starttyping
\startletter

...

\ps{...}
\encl{...}

\stopletter
\stoptyping

\start

\setupletter
  [name={Ben Johnson},
   phone={4922-89564},
   fax={4922-89564}]

\setupletter
  [list={name,phone,fax,date}]

\setupletter
  [fromname={The Author},
   fromaddress={Hidden Street 2\\57895 Mystery town}]

\setupletter
  [toname={Mike Wilson},
   toaddress={Linden street 12\\78569 TeX City}]

\startletter
  [opening={Dear Reader,},
   subject={Step by step guide to write a letter},
   closing={Greetings from the Author},
   signature={Arthur Thor}]

\input knuth\par

\ps{Postscript}

\encl{Appendices}

\cc{List of recipients}

\stopletter

\stop

\section{Copy}\index{copy}\index{\tex{cc}}

\starttyping
\startletter

...

\ps{...}
\encl{...}
\cc{...}

\stopletter
\stoptyping

\stopcomponent