-
Notifications
You must be signed in to change notification settings - Fork 0
/
pages.tex
163 lines (135 loc) · 5.09 KB
/
pages.tex
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
\usemodule[tugboat]
\def\HTML{\acro{HTML}}
\setvariables
[tugboat]
[type=article,
columns=yes,
grid=no]
% \setvariables
% [tugboat]
% [year=\tubyear,
% volume=\tubvol,
% number=\tubnum,
% page=\tubpage]
\setvariables
[tugboat]
[ title={\CONTEXT\ basics for users: Setting paper sizes},
author={Aditya Mahajan},
address={},
email={adityam (at) ieee dot org},
]
% \setuppapersize[letter][letter]
\starttext
\StartArticle
\StartAbstract
\StopAbstract
\section {Introduction}
Separation of content and presentation is the biggest selling point of markup
based document preparation systems. \TEX\ advocates will tell you to concentrate
on your content, and let the style writers worry about layout. This is good
advice. But occasionally you need to worry about layout. And changing layout can
be intimidating. The most visually obvious parts of a layout is paper size,
margins, and fonts. If you get these three things right, you are almost half way
through with the layout. In this article, I will explain how to set up the paper
size and margins|<|the page layout|>| in \CONTEXT.
\section {Layout --- the basics}
In \CONTEXT, page layout is set using \type{\setuplayout}. This macro can be can
be intimidating to a new user because it has a lot of options. In this section I
will explain the options that are commonly used.
Page layout can be divided into two parts, horizontal and vertical. The
horizontal layout has three main options. These are, from left to right,
\type{backspace}, \type{width}, \type{cutspace}. The options \type{backspace}
and \type{cutspace} set the left and right margins,\footnote{By margin, I mean
the space between the edge of the paper and the edge of the text area.
\type{\setuplayout} has options called \type{leftmargin}, \type{rightmargin},
and \type{margin} which set a slightly different part of the layout.} while
\type{width} sets the main text width. All three of these options can take a
value of any valid \TEX\ dimension. In addition, the width can also take the
value of \type{fit} and \type{middle}. Lets look at some examples to understand
these options.
Suppose we want a layout with left and right margins of 1in. This can be
set using
\starttyping
\setuplayout
[backspace=1in,
width=middle]
\stoptyping
\noindentation
The option \type{width=middle} tells \CONTEXT\ to use same value for
\type{backspace} and \type{cutspace}. We could have also used
\starttyping
\setuplayout
[backspace=1in,
width=fit,
cutspace=1in]
\stoptyping
\noindentation
The option \type{width=fit} tells \CONTEXT\ to figure out the value of the
\type{width} from the paper width and the values of \type{backspace} and
\type{cutspace}. This form is useful when the left and right margins have
different values.
Like the horizontal layout, the vertical layout also has three main options.
There are, from top to bottom, \type{topspace}, \type{height},
\type{bottomspace}. The options \type{topspace} and \type{bottomspace} set the
top and bottom margins,\footnote{Again, by margin, I mean the space between the
edge of the paper and the edge of the text area.} while \type{height} sets the
main text height. Like their horizontal counterparts, all three of these options
can take a value of any valid \TEX\ dimension. In addition, the height can also
take the value of \type{fit} and \type{middle}. Lets look at some examples to
understand these options.
Suppose we want a layout with top and bottom margins of 1in. This can be
set using
\starttyping
\setuplayout
[topspace=1in,
height=middle]
\stoptyping
\noindentation
The option \type{height=middle} tells \CONTEXT\ to use same value for
\type{topspace} and \type{bottomspace}. We could have also used
\starttyping
\setuplayout
[topspace=1in,
heigth=fit,
bottomspace=1in]
\stoptyping
\noindentation
The option \type{height=fit} tells \CONTEXT\ to figure out the value of the
\type{height} from the paper height and the values of \type{topspace} and
\type{bottomspace}. This form is useful when the top and bottom margins has
different values.
Thus, to get a 1in margin on all sides, we can type
\starttyping
\setuplayout
[topspace=1in,
backspace=1in,
width=1in,
height=in]
\stoplayout
\stoptyping
\section {Double sided layout}
Books have a double sided layout, which means that odd and even pages have
mirrored layout (reflected about the center of the {\em spread}). A
double sided layout can be set up using
\starttyping
\setuppagenumbering[alternative=doublesided]
\stoptyping
\noindentation
If you set up a double sided layout and, for some reason, want to revert to a
single sided layout, you can type
\starttyping
\setuppagenumbering[alternative=singlesided]
\stoptyping
\section {Layout --- the details}
\section {References}
{
\vskip-10pt
\rightskip = 0pt plus4em \hyphenpenalty=10000
\hfuzz=5pt
\startbibliography[inbetween={\blank[4pt]}]
\item[manual] Hans Hagen, \quotation{\em \CONTEXT\ the manual},\crlf
\mono{http://www.pragma-ade.com/general/\crlf manuals/cont-eni.pdf}
\stopbibliography
}
\StopArticle
\stoptext