ma-cb-en-layout.tex /size: 7175 b    last modification: 2020-07-01 14:35
1\startcomponent ma-cb-en-layout
2
3\enablemode[**en-us]
4
5\project ma-cb
6
7\startchapter[title=Page layout]
8
9\index{layout}
10\index{page design}
11
12\Command{\tex{setuplayout}}
13\Command{\tex{adaptlayout}}
14\Command{\tex{showlayout}}
15\Command{\tex{showframe}}   % VZ 2006-11-15
16\Command{\tex{showsetups}}
17\Command{\tex{showmakeup}}
18\Command{\tex{startlocal}}
19
20\startsection[title=Introduction]
21
22The {\em Layouts in \CONTEXT} manual by Willy Egger contains the necessary
23background information on page layout and design. Below you will find only the
24basic information necessary for defining rather simple layouts for paper and
25screen documents.
26
27For more information (examples and usage) on the \type{\setuplayout} command
28please refer to the
29\goto {\CONTEXTWIKI} [ url(http://wiki.contextgarden.net/Layout) ].
30
31\stopsection
32
33\startsection[title=Designing the pagelayout]
34
35To be able to design a page layout you have to familiarize yourself with the
36pagemodel of \CONTEXT. \in{Figure}[fig:pageareas] shows the areas on a page
37that you can use in your design.
38
39\placefigure
40  [here]
41  [fig:pageareas]
42  {The page areas.}
43  {\externalfigure[fig-page-areas-en.pdf][width=.75\hsize]}
44
45The orange bodytext area contains the running text. The top, bottom, and edge
46area are useful for buttons in screen documents.
47
48Please keep in mind that in \CONTEXT\ you are defining|/|designing a
49right-hand page. Only after you have setup
50\type{\setuppagenumbering[alternative=doublesided]} the left page
51is available (mirrored right page).
52
53\starthiding
54  % AFO: this is the file minibook-en.tex in graphics map
55  \setuppapersize[A10][A10]
56  \setuplayout[cutspace=2mm,backspace=6mm,width=15mm]
57  \setupbodyfont[6pt]
58  \setuppagenumbering[state=stop]
59  \setupbackgrounds[text][text][background=color,backgroundcolor=orange]
60  \setupbackgrounds[header,text,footer][leftmargin][background=color,backgroundcolor=lightgreen]
61  \setupbackgrounds[header,text,footer][leftmargin,text,rightmargin][frame=on]
62  \setupfootertexts[margin][\midaligned{l}][\midaligned{r}][\midaligned{r}][\midaligned{l}]
63  \starttext
64  \midaligned{design page} \page
65  \setuppagenumbering[alternative={singlesided}]
66  \inmargin{\midaligned{m}}\midaligned{left page}  \page
67  \inmargin{\midaligned{m}}\midaligned{right page} \page
68  \setuppagenumbering[alternative={singlesided,doublesided}]
69  \inmargin{\midaligned{m}}\midaligned{left page}  \page
70  \inmargin{\midaligned{m}}\midaligned{right page} \page
71  \setuppagenumbering[alternative={doublesided}]
72  \inmargin{\midaligned{m}}\midaligned{left page}  \page
73  \inmargin{\midaligned{m}}\midaligned{right page}
74  \stoptext
75\stophiding
76
77\placefigure
78  [here]
79  [fig:sidedness]
80  {Page alternatives.}
81  {\startcombination[3*1]
82    {\externalfigure[minibook-en.pdf][type=pdf,page=2,width=2.4cm]\externalfigure[minibook-en.pdf][type=pdf,page=3,width=2.4cm]}{singlesided}
83    {\externalfigure[minibook-en.pdf][type=pdf,page=4,width=2.4cm]\externalfigure[minibook-en.pdf][type=pdf,page=5,width=2.4cm]}{single-double}
84    {\externalfigure[minibook-en.pdf][type=pdf,page=6,width=2.4cm]\externalfigure[minibook-en.pdf][type=pdf,page=7,width=2.4cm]}{doublesided}
85   \stopcombination}
86
87Note in \in{figure}[fig:sidedness] that:
88
89\startitemize[packed]
90\item the margintext (\type{\inmargin{m}}) is always in the left margin
91\item the footertext in the margin (\type{\setupfootertexts[margin][l][r][r][l]}) adapts automatically
92\item the page is completely mirrored when \type{alternative=doublesided}
93\stopitemize
94
95When designing a page ask yourself a few questions:
96
97\startitemize[packed]
98\item do I want margin texts or margin figures
99\item will I use the margin for the section numbering
100\item do I have footer and/or header texts
101\item do I want a double sided layout (right--left page mirrored)
102\item do I use ornaments (like tabs) on the page
103\item do I have navigational buttons (screen documents)
104\stopitemize
105
106\stopsection
107
108\startsection[title=Defining the papersize / screensize]
109
110Before you can set up your page layout you have to have an idea about the paper
111dimensions. The cutmarks connected by the dashed lines in \in{figure}[fig:pageareas]
112indicate the papersize. In \CONTEXT\ you set up your papersize with:
113
114\shortsetup{\tex{setuppapersize}}
115
116Most common predefined papersizes in \CONTEXT\ are A0..A10 and B1..B10 for paper
117and S3..S8 for screen documents.
118
119Mostly you will use the default setup:
120
121\startbuffer
122\setuppapersize
123  [A4][A4]
124\stopbuffer
125
126\typebuffer
127
128But you can also define your own paper size for specific products:
129
130\startbuffer
131\definelayout
132  [postcard]
133  [width=15cm,
134   height=10cm]
135\stopbuffer
136
137\typebuffer
138
139\stopsection
140
141\startsection[title=Defining the page layout]
142
143The page layout is defined by:
144
145\shortsetup{setuplayout}
146
147This command is typed in the set up area of your input file.
148
149\placefigure
150  [here]
151  [fig:pageparameters]
152  {The page parameters.}
153  {\externalfigure[fig-page-parameters-en.pdf][width=.8\hsize]}
154
155The layout of this manual was set with:
156
157\startbuffer
158\setuplayout
159  [backspace=3cm,
160   margin=2cm,
161   margindistance=.5cm,
162   width=15cm,
163   topspace=2cm,
164   header=2cm,
165   footer=2cm,
166   height=25.7cm]
167\stopbuffer
168
169\typebuffer
170
171If you want to look at your page layout you can type the command
172\type{\showframe} and process one page or the whole file. The areas are shown in
173a number of frames.
174
175The command \type{\showsetups} shows the values of the parameters. A combination
176of both commands is \type{\showlayout}.
177
178The values of the layout parameters are available as commands. This enables you
179to work more accurately when defining measures of columns, figures and tables. A
180few of these parameters are explained in \in{table}[tab:fewparameters].
181
182\placetable
183  [here,force]
184  [tab:fewparameters]
185  {A few parameters as commands.}
186\starttable[|l|l|]
187\HL
188\NC \bf Commands         \NC \bf Meaning               \NC\SR
189\HL
190\NC \type{\makeupwidth}  \NC width of the typing area  \NC\FR
191\NC \type{\makeupheight} \NC height of the typing area \NC\MR
192\NC \type{\textwidth}    \NC width of the text area    \NC\MR
193\NC \type{\textheight}   \NC height of the text area   \NC\LR
194\HL
195\stoptable
196
197If you want to define the width of a column or the height of a figure you can do
198it relative to the \type{\makeupwidth} or \type{\makeupheight}. Changes in this
199width or height will alter columns and figures proportionally.
200
201\startbuffer
202\placefigure
203  [here]
204  [fig:stepgable]
205  {A stepgable.}
206  {\externalfigure[ma-cb-19][width=.6\textwidth]}
207\stopbuffer
208
209\typebuffer
210
211After processing this would become:
212
213\getbuffer
214
215The other available values are (shown with \type{\showsetups}):
216
217\startcolumns
218\switchtobodyfont[8pt]
219\showsetups
220\stopcolumns
221
222The parameter values have a global effect and are default throughout the
223document. Nevertheless you might want to make slight changes in the page design
224for a number of pages.
225
226\startbuffer
227\adaptlayout[21,38][height=+.5cm]
228\stopbuffer
229
230\typebuffer
231
232In this case page 21 and 38 have a height of .5~cm + \type{textheight}.
233
234It is advisable not to use these local changes too often. It is always better to
235alter the text than to change the page layout.
236
237\stopsection
238
239\stopchapter
240
241\stopcomponent
242