ma-cb-en-pages.tex /size: 6214 b    last modification: 2020-07-01 14:35
1\startcomponent ma-cb-en-pages
2
3\enablemode[**en-us]
4
5\project ma-cb
6
7\startchapter[title=Page breaking and page numbering]
8
9\index{page breaking}
10\index{page numbering}
11
12\Command{\tex{page}}
13\Command{\tex{setuppagenumbering}}
14\Command{\tex{setupuserpagenumber}}
15
16\startsection[title=Page break]
17
18A page can be enforced or blocked by:
19
20\shortsetup{page}
21
22The options can be stated within the brackets. The options and their meaning are
23presented in \in{table}[tab:page options].
24
25\placetable
26  []
27  [tab:page options]
28  {Page options.}
29\starttable[|l|l|]
30\HL
31\NC \bf Option \NC \bf Meaning \NC\SR
32\HL
33\NC \type{yes}           \NC enforce a page \NC\FR
34\NC \type{makeup}        \NC enforce a page without filling \NC\MR
35\NC \type{no}            \NC no page \NC\MR
36\NC \type{preference}    \NC prefer a new page here \NC\MR
37\NC \type{bigpreference} \NC great preference for a new page here \NC\MR
38\NC \type{left}          \NC next page is a left handside page \NC\MR
39\NC \type{right}         \NC next page is a right handside page \NC\MR
40\NC \type{disable}       \NC following commands have no effect \NC\MR
41\NC \type{last}          \NC add pages till even number is reached \NC\MR
42\NC \type{quadruple}     \NC add pages till a multiple of four is reached  \NC\MR
43\NC \type{even}          \NC next page is even \NC\MR
44\NC \type{odd}           \NC next page in odd  \NC\MR
45\NC \type{blank}         \NC no page number  \NC\MR
46\NC \type{empty}         \NC insert an empty page \NC\MR
47\NC \type{reset}         \NC following commands do have effect \NC\MR
48\NC \type{start}         \NC from now on page commands have effect \NC\MR
49\NC \type{stop}          \NC from now on page commands have no effect \NC\LR
50\HL
51\stoptable
52
53\stopsection
54
55\startsection[title=Page numbering]
56
57Numbering pages is done automatically by \CONTEXT. However, numbering the pages
58the way you want it may take some effort.
59
60A rather simple \type{\start ... \stoptext} document will be numbered from
61$1 .. n$ (where $n$ is the last page). If you want your document to number
62its pages alphabetical you can type:
63
64\startbuffer
65\setupuserpagenumber
66    [numberconversion=character]
67\stopbuffer
68
69\typebuffer
70
71in the setup area of your file.
72
73You can enforce a page number with:
74
75\starttyping
76\setupuserpagenumber[number=25]
77\stoptyping
78
79\shortsetup{setupuserpagenumber}
80
81The options of the \type{\setupuserpagenumber} command are given in
82\in{table}[tab:user page number options].
83
84\placetable
85  []
86  [tab:user page number options]
87  {Page numbering: numbering options.}
88\starttable[|l|l|]
89\HL
90\NC \bf Option \NC \bf Meaning \NC\SR
91\HL
92\NC \type{way}                 \NC how to number the document \NC\FR
93\NC \type{prefix}              \NC use pagenumber prefix \NC\MR
94\NC \type{prefixset}           \NC use defined prefixset \NC\MR
95\NC \type{prefixseparatorset}  \NC use defined separator \NC\MR
96\NC \type{state}               \NC start -- stop page numbering \NC\MR
97\NC \type{number}              \NC define page number \NC\MR
98\NC \type{numberconversion}    \NC convert page number \NC\MR
99\NC \type{numberconversionset} \NC used defined conversion set \NC\LR
100\HL
101\stoptable
102
103The \type{prefixset}, \type{prefixseparatorset} and the \type{numberconversionset}
104options are defined with the \type{\defineprefixset}, \type{\defineseparatorset}
105and \type{\defineconversionset} respectively.
106
107This manual uses the \CONTEXT\ standard document section blocks: frontpart,
108bodymatter and appendices. These section blocks are numbered with roman
109characters, numeral digits and characters respectively.
110
111\startbuffer
112\defineconversionset
113  [frontpart:pagenumber][][romannumerals]
114
115\defineconversionset
116  [bodypart:pagenumber] [][numbers]
117
118\defineconversionset
119  [appendix:pagenumber] [][Characters]
120\stopbuffer
121
122\typebuffer
123
124At the start of each section block the number is reset to i, 1 and A respectively.
125
126The same effect would have been obntained with:
127
128\startbuffer
129\startsectionblockenvironment[frontpart]
130  \setupuserpagenumber[numberconversion=romannumerals]
131\stopsectionblockenvironment
132\stopbuffer
133
134\typebuffer
135
136Page numbering and the location of the page numbers can be set up with:
137
138\shortsetup{setuppagenumbering}
139
140The options of this command are shown in \in{table}[tab:page numbering options]:
141
142\placetable
143  []
144  [tab:page numbering options]
145  {Page numbering: layout options.}
146\starttable[|l|l|]
147\HL
148\NC \bf Option \NC \bf Meaning \NC\SR
149\HL
150\NC \type{alternative}     \NC page layout: single or double sided \NC\MR
151\NC \type{location}        \NC location of page number on page \NC\MR
152\NC \type{width}           \NC width of pagen umber \NC\MR
153\NC \type{left}            \NC text left of page number \NC\MR
154\NC \type{right}           \NC text right of page number \NC\MR
155\NC \type{page}            \NC \unknown \NC\MR
156\NC \type{state}           \NC start -- stop page numbering  \NC\MR
157\NC \type{command}         \NC invoke command \NC\MR
158\NC \type{style}           \NC set character style \NC\MR
159\NC \type{color}           \NC set color \NC\LR
160\HL
161\stoptable
162
163Note that this is also the command that indicates that your document is single or
164double sided which has an effect on the left-right page layout.
165
166\startbuffer
167\setuppagenumbering
168  [alternative=doublesided]
169\stopbuffer
170
171\typebuffer
172
173In this manual page numbering is set up with:
174
175\starttyping
176\setuppagenumbering
177  [location={footer,middle},
178   command=\NummerCommando]
179\stoptyping
180
181The \type{\NummerCommando} uses \METAPOST\ to draw a unique random image around
182each page number.
183
184You can recal a page number with \type{\userpagenumber}. If you set up your headertext
185with:
186
187\startbuffer
188  \setupheadertexts
189    [Page \userpagenumber\ of \lastuserpagenumber]
190\stopbuffer
191
192\typebuffer
193
194You would get a header with the actual page number and the total of pages (in that
195section block).
196
197The actual page number and the real page number may differ since there may be pages
198or sections that in your document that are not numbered. If you feel the need to
199display the real page number there is the command \type{\realpagenumber}.
200
201Please refer to the \goto {\CONTEXTWIKI} [
202url(http://wiki.contextgarden.net/Command/setupuserpagenumber) ] for more
203details.
204
205\stopchapter
206
207\stopcomponent
208
209