summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/context/third/letter/doc/correspondence-letter-layout.tex
blob: e71a1a3d807402fd2f914492b48b8d66d17145b3 (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
\startcomponent correspondence-letter-examples

\environment correspondence-environment

\chapter{Layout}

The components for the letter can be divided in to groups, the first are letter layers, you can position them on the page wherever you want and it is also possible to put one layer bevor or behind another layer.

The underliying machanism behind letter layers are \CONTEXT's normal layer mechanism in combination with localframed environments, this is a very powerful combination and you could create complicated layouts with them.

The second group of components for the layout are letter sections, they are not as powerfule as letter layers and you have only a limited number of elements to control their layout.

\setup[setupletterstyle:layout]

\setup[setupletterstyle:option]

\start

\setupletter
  [alternative=none]

\setupletterstyle
  [option]
  [marking=off,
   backaddress=yes]

\setupletterstyle
  [backaddress]
  [bottomframe=off]

\setupletterstyle
  [head,foot,address,backaddress,reference]
  [background=color,
   backgroundcolor=darkgray,
   backgroundoffset=-1.5pt]

\startletter
\dontleavehmode
\stopletter

\stop

\section{Letter layers}

Layer are used to position elements one page independant of the page layout.
They are used for the header and footer, address block\footnote{The block styles
use a different structure and use a letter section for the address block.} etc.

The complete list of all available layers is:

\startitemize[packed,columns,three]
\item head
\item letternext
\item lettermain
\item foot
\item address
\item reference
\item location
\item nexthead
\item lefthead
\item righthead
\item nextfoot
\item leftfoot
\item rightfoot
\item topmark
\item botmark
\item cutmark
\item endmark
\item usermark
\item backaddress
\stopitemize

\starttyping
\setlayer[...]{\framed{...}}
\stoptyping

The position and layout of the layers can be changed with the \type {\setupletterstyle} command.

\starttyping
\setupframed[...][..,..=..,..]
\stoptyping

\setup[setupletterlayer:frame]

\starttyping
\setuplayer[...][..,..=..,..]
\stoptyping

\setup[setupletterlayer:layer]

\starttyping
\getparameters[...][..,..=..,..]
\stoptyping

\setup[setupletterlayer:option]

\subsubject{State value}

\starttabulate
\HL
\NC start     \NC show layer on the first page                  \NC\NR
\NC stop      \NC disable layer                                 \NC\NR
\NC first     \NC see \mono{start}                              \NC\NR
\NC next      \NC show layer on the second and following pages  \NC\NR
\NC left      \NC show layer on left pages                      \NC\NR
\NC right     \NC show layer on right pages                     \NC\NR
\NC leftpage  \NC see \mono{left}                               \NC\NR
\NC rightpage \NC see \mono{right}                              \NC\NR
\NC page      \NC use global pagenumbering for left/right pages \NC\NR
\NC subpage   \NC use local pagenumbering for left/right pages  \NC\NR
\HL
\stoptabulate

\start

\definecolor[fakerulecolor][darkgray]

\setupletterstyle
  [reference]
  [alternative=none]

\setupletterstyle
  [enclosure,copy,postscript]
  [location=left,width=0pt,before=\nowhitespace,after=\nowhitespace]

\setuplabeltext
  [letter:enclosure=,
   letter:copy=,
   letter:postscript=]

\setupletter
  [title={\blackrule[width=\hsize,height=\lineheight,color=darkgray]},
   subject={\blackrule[width=\hsize,height=\lineheight,color=darkgray]},
   opening={\blackrule[width=\hsize,height=\lineheight,color=darkgray]},
   closing={\blackrule[width=.33\hsize,height=4\lineheight,color=darkgray]},
   appendices={\blackrule[width=.33\hsize,height=3\lineheight,color=darkgray]}]

\setlettervalue{title}     {\fakewords  {5} {10}}
\setlettervalue{subject}   {\fakewords  {5} {10}}
\setlettervalue{opening}   {\fakewords  {3}  {5}}
\setlettervalue{content}   {\fakewords{100}{150}}
\setlettervalue{closing}   {\fakewords  {2}  {4}}
\setlettervalue{enclosure} {\fakewords  {3}  {6}}
\setlettervalue{copy}      {\fakewords  {3}  {6}}
\setlettervalue{postscript}{\fakewords  {3}  {6}}

\startletter
\fakewords{100}{150}
\stopletter

\stop

\section{Letter sections}

\startitemize[packed,columns,three]
\item letterhead\footnote[section:blockstyle]{Only used for the blockstyle layouts.}
\item dateline\note[section:blockstyle]
\item referenceline\note[section:blockstyle]
\item specialnotation\note[section:blockstyle]
\item insideaddress\note[section:blockstyle]
\item title
\item subject
\item opening
\item content
\item closing
\item appendices
\stopitemize

You can change the layout of a letter section with the \type {\setupletterstyle}
command, the syntax is:

\setup[setuplettersection]

\start

\definecolor[fakerulecolor][darkgray]

\setupletterstyle
  [reference]
  [alternative=none]

\startletter
\fakewords{100}{150}
\stopletter

\stop

\section{Letter descriptions}

\setup[setupletterdescription]

\stopcomponent