typo-mar.mkiv /size: 18 Kb    last modification: 2020-07-01 14:35
1
% macros=mkvi
2 3
%D \module
4
%D [ file=typo-mar,
5
%D version=2010.02.15, % was experimental code
6
%D title=\CONTEXT\ Typesetting Macros,
7
%D subtitle=Margindata,
8
%D author=Hans Hagen,
9
%D date=\currentdate,
10
%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
11
%C
12
%C This module is part of the \CONTEXT\ macro||package and is
13
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
14
%C details.
15 16
% maybe dontleavehmode when scope is local
17 18
% todo: tags
19
% todo: force inline with option (saves pos)
20
% todo: margintitle (also less position then)
21 22
\writestatus
{
loading
}{
ConTeXt
Typesetting
Macros
/
Margindata
}
23 24
\unprotect
25 26
%D This module has been on the agenda for a while. Actually, it is
27
%D one of the things that I really need myself, for instance when
28
%D rendering rather unpredictable (educational) tests encoded in
29
%D XML. This module permits anchoring for instance item numbers and
30
%D also overload them when they have subnumbers. In the future it
31
%D might replace the current maginal note mechanism (that then
32
%D will be just an instance).
33
%D
34
%D In spite of what might be expected, the more advanced \LUA\ based
35
%D variant is upto twice as fast on simple entries. Also, we no longer
36
%D need an extra pass to get inner and outer alignments in sync with
37
%D the pagebuilder.
38 39
\registerctxluafile
{
typo
-
mar
}{}
40 41
%definesystemattribute[margindata] % only at the lua end
42 43
%D In \MKII\ we have three categories and their historically meaning
44
%D is as follows:
45
%D
46
%D marginlines: These are flushed relative to the start of a line and
47
%D need to be invoked there.
48
%D
49
%D marginwords: These can be issued in the text flow and will migrate
50
%D sidewards; in spite of the name, it can be a paragraph of text as
51
%D well, but normally it's words.
52
%D
53
%D margintexts: These can be set beforehand and are flushed at the
54
%D next paragraph of text (of header).
55
%D
56
%D In \MKIV\ we have further integrated the mechanism and we now have:
57
%D
58
%D margindata: This can be anything that needs to go into the margin.
59
%D It can be anchored in the text or given beforehand in which case
60
%D it gets flushed at the first occasion.
61
%D
62
%D margintext: This runs on top of margindata and the only difference
63
%D is that it uses the framed mechanism for packaging.
64
%D
65
%D Stacking is done differently as is inner and outer alignment (in
66
%D most cases more efficient). The functionality is mostly the same
67
%D as in \MKII, but there are a few additions, like names entries,
68
%D where later ones overload preceding not yet flushed ones. Data can
69
%D get catagorized and is then treated as a group (e.g. when stacking
70
%D is needed).
71
%D
72
%D The amount of \TEX\ code is less than in \MKII\ because we do all
73
%D trickery in at the \LUA\ end. At the end of this file we define
74
%D several commands, like \type {\inleftmargin} and \type {\inleft}.
75
%D You can configure them individually or as a group. There is an
76
%D inheritance model in place.
77
%D
78
%D The following notes will be stacked:
79
%D
80
%D \starttyping
81
%D \ininner[line=2]{IM A}
82
%D \ininner[stack=yes]{IM B}
83
%D \ininner[stack=yes]{IM C}
84
%D \stoptyping
85
%D
86
%D The distance between them is determined by \type {dy}:
87
%D
88
%D \starttyping
89
%D \ininner[stack=yes,dy=2ex][frame=on] {IM A}
90
%D \ininner[stack=yes,dy=2ex][frame=on] {IM B}
91
%D \stoptyping
92
%D
93
%D There are several methods of vertical alignment.
94
%D
95
%D \starttyping
96
%D \inmargin [method=first] [frame=on] {first\\second} \input ward \par
97
%D \inmargin [method=first] [frame=on,offset=3pt] {first\\second} \input ward \par
98
%D \inmargin [method=first,voffset=-3pt][frame=on,offset=3pt,rulethickness=3pt] {first\\second} \input ward \par
99
%D \inmargin [method=first,voffset=-6pt][frame=on,offset=3pt,rulethickness=3pt] {first\\second} \input ward \par
100
%D \stoptyping
101
%D
102
%D You sometimes need to combine \type {voffset} with \type {offset}. The first
103
%D argument concerns the data, the second the framed. Not sharing the setup is
104
%D on purpose: location, offset, alignment and other parameters might clash.
105 106
\installcorenamespace
{
margindata
}
107
\installcorenamespace
{
marginframed
}
108 109
\installcommandhandler
\??margindata
{
margindata
}
\??margindata
110
\installframedcommandhandler
\??marginframed
{
marginframed
}
\??marginframed
111 112
\setupmargindata
113
[
\c!location
=
\v!left
,
114
% \c!align=,
115
% \c!method=,
116
\c!style
=
\v!bold
,
117
\c!color
=
,
% maybe \maintextcolor
118
% \c!name=,
119
% \c!category=,
120
\c!threshold
=
.
2
5
\exheight
,
121
\c!margin
=
\v!normal
,
122
\c!scope
=
\v!global
,
123
\c!width
=
,
124
% \c!stack=,
125
% \c!stackname=,
126
% \c!option=, % \v!paragraph (follow shape)
127
\c!line
=
0
,
128
\c!anchor
=
\v!text
,
129
\c!bottomspace
=
\strutdepth
,
% slack used for keeptogether
130
\c!dy
=
\zeropoint
,
131
\c!distance
=
\zeropoint
,
132
\c!hoffset
=
\zeropoint
,
133
\c!voffset
=
\zeropoint
]
134 135
\setupmarginframed
% so, align should be set with the data command
136
[
\c!strut
=
\v!yes
,
% so by default we scale the strut to the font !
137
\c!offset
=
\v!overlay
,
138
\c!fr!analyze
=
\v!yes
,
139
\c!frame
=
\v!off
,
140
\c!width
=
\margindataparameter
\c!width
,
141
\c!align
=
\margindataparameter
\c!align
]
142 143
\appendtoks
144
\setuevalue
\currentmargindata
{
\margindata
[
\currentmargindata
]
}
%
145
\to
\everydefinemargindata
146 147
\newconditional
\inhibitmargindata
% This one is used at the Lua end!
148
\newtoks
\everymargindatacontent
% Later on we will set this one.
149 150
\appendtoks
151
\settrue
\inhibitmargindata
152
\to
\everyforgetall
153 154
\appendtoks
155
\forgetall
156
\tf
157
\resetallattributes
% \deactivatecolor % needed, but maybe we should switch to maintextcolor: \onlyinheritmaintextcolor
158
\pickupattributes
159
\to
\everymargindatacontent
160 161
% trialtypesetting: no need for margin stuff while trialing as
162
% is has no dimensions
163 164
\definesystemconstant
{
margintext
}
165 166
\newcount
\nofmargintexts
167 168
\definepagestate
[
\s!margintext
]
169 170
\unexpanded
\def
\typo_margins_data_synchronize
171
{
\doforcedtrackpagestate
\s!margintext
\nofmargintexts
% includes increment
172
\docheckpagestate
\s!margintext
\nofmargintexts
173
%\doifelserightpagestate\s!margintext\nofmargintexts\relax\relax
174
\realpageno
\realpagestateno
175
\swapmargins
}
176 177
\unexpanded
\def
\margindata
178
{
\iftrialtypesetting
179
\expandafter
\typo_margins_data_nop
180
\else
181
\expandafter
\typo_margins_data_yes
182
\fi
}
183 184
\def
\typo_margins_data_nop
[#
name
]
%
185
{
\dodoubleempty
\typo_margins_data_nop_indeed
}
186 187
\def
\typo_margins_data_yes
[#
name
]
%
188
{
\setfalse
\inhibitmargindata
% flushing afterwards
189
\begingroup
190
%\settrue\inhibitmargindata % no flushing in here
191
\def
\currentmargindata
{
#
name
}
%
192
\let
\currentmarginframed
\currentmargindata
193
\dodoubleempty
\typo_margins_data_yes_indeed
}
194 195
\unexpanded
\def
\typo_margins_data_nop_indeed
[#
dataparameters
][#
textparameters
]#
content
%
196
{}
197 198
% todo: naturalhbox
199 200
% when name is set we overload
201 202
\let
\margindatahbox
\naturalhbox
% \hbox
203 204
\newcount
\c_typo_margins_n
205 206
\ifdefined
\dotagmarginanchor
\else
\let
\dotagmarginanchor
\gobbleoneargument
\fi
207
\ifdefined
\dotagmargintext
\else
\let
\dotagmargintext
\gobbleoneargument
\fi
208 209
\unexpanded
\def
\typo_margins_data_yes_indeed
[#
dataparameters
][#
textparameters
]#
content
%
210
{
\iffirstargument
211
\setupcurrentmargindata
[#
dataparameters
]
%
212
\fi
213
\doifelsenothing
{
#
content
}
\donefalse\donetrue
214
\global\advance
\c_typo_margins_n
\plusone
215
\ifdone
216
\edef
\currentmarginreference
{
\margindataparameter
\c!reference
}
%
217
\ifx
\currentmarginreference
\empty
\else
218
\strc_references_set_page_only_destination_box_attribute
\currentmarginreference
\currentmarginreference
219
\fi
220
\edef
\currentmargindatastrut
{
\margindataparameter
\c!strut
}
%
221
\dostarttaggedchained
\t!margintext
\currentmargindata
\??margindata
222
\dotagmargintext
\c_typo_margins_n
223
\ifcsname
\currentmarginframedhash
\s!parent
\endcsname
224
\setbox
\nextbox
\margindatahbox
\currentmarginreference
\bgroup
225
\the
\everymargindatacontent
226
\usemargindatastyleandcolor
\c!style\c!color
227
\setupcurrentmarginframed
[
\c!location
=
\v!normal
,
#
textparameters
]
%
228
\typo_margins_data_synchronize
229
\inheritedmarginframedframed
\bgroup
230
\ifx
\currentmargindatastrut
\empty
\else
231
\synchronizestrut
\currentmargindatastrut
232
\fi
233
\begstrut
234
\strc_references_flush_destination_nodes
235
\margindataparameter
\c!command
{
#
content
}
%
236
\endstrut
237
\egroup
238
\egroup
239
\edef
\currentmarginfirstheight
{
\number\dimexpr
\framedfirstheight
}
%
240
\else
241
\edef
\currentmargindatawidth
{
\margindataparameter
\c!width
}
%
242
\ifx
\currentmargindatawidth
\empty
243
\setbox
\nextbox
\margindatahbox
\currentmarginreference
\bgroup
244
\typo_margins_data_synchronize
245
\the
\everymargindatacontent
246
\usemargindatastyleandcolor
\c!style\c!color
247
\ifx
\currentmargindatastrut
\empty
\else
248
\synchronizestrut
\currentmargindatastrut
249
\fi
250
\begstrut
251
\strc_references_flush_destination_nodes
252
\margindataparameter
\c!command
{
#
content
}
%
253
\endstrut
254
\egroup
255
\let
\currentmarginfirstheight
\empty
256
\else
257
\setbox
\nextbox
\margindatahbox
\currentmarginreference
\bgroup
258
\typo_margins_data_synchronize
259
\dosetraggedcommand
{
\margindataparameter
\c!align
}
%
260
\vtop
\bgroup
261
\the
\everymargindatacontent
262
\usemargindatastyleandcolor
\c!style\c!color
263
\hsize
\currentmargindatawidth
264
\raggedcommand
265
\ifx
\currentmargindatastrut
\empty
\else
266
\synchronizestrut
\currentmargindatastrut
267
\fi
268
\begstrut
269
\strc_references_flush_destination_nodes
270
\margindataparameter
\c!command
{
#
content
}
%
271
\endstrut
272
\egroup
273
\egroup
274
\edef
\currentmarginfirstheight
{
true
}
%
275
\fi
276
\fi
277
\dostoptagged
278
\fi
279
\ifdone
280
\edef
\p_anchor
{
\margindataparameter
\c!anchor
}
%
281
\anch_positions_initialize
% we use positions at the lua end
282
\dostarttagged
\t!marginanchor
\empty
283
\dotagmarginanchor
\c_typo_margins_n
284
\clf_savemargindata
285
location
{
\margindataparameter
\c!location
}
%
286
method
{
\margindataparameter
\c!method
}
%
287
category
{
\margindataparameter
\c!category
}
%
288
name
{
\margindataparameter
\c!name
}
%
289
scope
{
\margindataparameter
\c!scope
}
%
290
option
{
\margindataparameter
\c!option
}
%
291
number
\nextbox
292
margin
{
\margindataparameter
\c!margin
}
% local normal margin edge
293
distance
\dimexpr
\margindataparameter
\c!distance
\relax
294
hoffset
\dimexpr
\margindataparameter
\c!hoffset
\relax
295
voffset
\dimexpr
\margindataparameter
\c!voffset
\relax
296
dy
\dimexpr
\margindataparameter
\c!dy
\relax
297
bottomspace
\dimexpr
\margindataparameter
\c!bottomspace
\relax
298
\ifx
\currentmarginfirstheight
\empty
\else
299
baseline
{
\currentmarginfirstheight
}
%
300
\fi
301
threshold
\dimexpr
\margindataparameter
\c!threshold
\relax
% overlap related, will change
302
\ifhmode
303
inline
true
%
304
\fi
305
anchor
{
\p_anchor
\ifx
\p_anchor
\v!region
:
0
\fi
}
% kind of a hack to force column anchoring (for now)
306
%
307
% we're not in forgetall
308
%
309
% \ifzeropt\leftskip \else
310
% leftskip \dimexpr\leftskip\relax
311
% \fi
312
% \ifzeropt\leftskip \else
313
% rightskip \dimexpr\rightskip\relax
314
% \fi
315
align
{
\margindataparameter
\c!align
}
%
316
line
\numexpr
\margindataparameter
\c!line
\relax
317
stackname
{
\margindataparameter
\c!stackname
}
%
318
stack
{
\margindataparameter
\c!stack
}
%
319
index
\c_typo_margins_n
320
\relax
321
\dostoptagged
322
\else
323
\clf_savemargindata
324
location
{
\margindataparameter
\c!location
}
%
325
method
{
\margindataparameter
\c!method
}
%
326
category
{
\margindataparameter
\c!category
}
%
327
name
{
\margindataparameter
\c!name
}
%
328
scope
{
\margindataparameter
\c!scope
}
%
329
number
\nextbox
330
\relax
331
\fi
332
\endgroup
}
333 334
%D Downward compatible hack:
335 336
\unexpanded
\def
\spaceorpar
337
{
\endgraf
\ifhmode
\space
\fi
}
338 339
\appendtoks
340
\let
\\
\spaceorpar
341
\to
\everymargindatacontent
342 343
%D Another one:
344 345
% \installcorenamespace{oppositemargin}
346
%
347
% \letvalue{\??oppositemargin\v!left }\v!right
348
% \letvalue{\??oppositemargin\v!right }\v!left
349
% \letvalue{\??oppositemargin\v!inner }\v!outer
350
% \letvalue{\??oppositemargin\v!outer }\v!inner
351
% \letvalue{\??oppositemargin\v!normal}\v!normal
352
%
353
% \def\oppositemargin#1%
354
% {\csname\??oppositemargin\ifcsname\??oppositemargin#1\endcsname#1\else\v!normal\fi\endcsname}
355 356
%D Definitions:
357 358
% common to lines and text
359 360
\setupmargindata
[
\v!left
]
[
\c!method
=
\v!first
,
\c!location
=
\v!left
,
\c!margin
=
\v!margin
,
\c!align
=
\v!flushright
,
\s!parent
=
\??margindata
]
% we could autoparent when no define yet
361
\setupmargindata
[
\v!right
]
[
\c!method
=
\v!first
,
\c!location
=
\v!right
,
\c!margin
=
\v!margin
,
\c!align
=
\v!flushleft
,
\s!parent
=
\??margindata
]
362
\setupmargindata
[
\v!outer
]
[
\c!method
=
\v!first
,
\c!location
=
\v!outer
,
\c!margin
=
\v!margin
,
\c!align
=
\v!inner
,
\s!parent
=
\??margindata
]
363
\setupmargindata
[
\v!inner
]
[
\c!method
=
\v!first
,
\c!location
=
\v!inner
,
\c!margin
=
\v!margin
,
\c!align
=
\v!outer
,
\s!parent
=
\??margindata
]
364 365
% lines
366 367
\definemargindata
[
\v!inleftmargin
]
[
\v!left
]
[
\c!margin
=
\v!margin
,
\c!width
=
\leftmarginwidth
,
\c!style
=
,
\c!color
=]
368
\definemargindata
[
\v!inrightmargin
]
[
\v!right
]
[
\c!margin
=
\v!margin
,
\c!width
=
\rightmarginwidth
,
\c!style
=
,
\c!color
=]
369
\definemargindata
[
\v!inoutermargin
]
[
\v!outer
]
[
\c!margin
=
\v!margin
,
\c!width
=
\outermarginwidth
,
\c!style
=
,
\c!color
=]
370
\definemargindata
[
\v!ininnermargin
]
[
\v!inner
]
[
\c!margin
=
\v!margin
,
\c!width
=
\innermarginwidth
,
\c!style
=
,
\c!color
=]
371 372
\definemargindata
[
\v!inleftedge
]
[
\v!left
]
[
\c!margin
=
\v!edge
,
\c!width
=
\leftedgewidth
,
\c!style
=
,
\c!color
=
,
\c!category
=
\v!edge
]
373
\definemargindata
[
\v!inrightedge
]
[
\v!right
]
[
\c!margin
=
\v!edge
,
\c!width
=
\rightedgewidth
,
\c!style
=
,
\c!color
=
,
\c!category
=
\v!edge
]
374
\definemargindata
[
\v!inouteredge
]
[
\v!outer
]
[
\c!margin
=
\v!edge
,
\c!width
=
\outeredgewidth
,
\c!style
=
,
\c!color
=
,
\c!category
=
\v!edge
]
375
\definemargindata
[
\v!ininneredge
]
[
\v!inner
]
[
\c!margin
=
\v!edge
,
\c!width
=
\inneredgewidth
,
\c!style
=
,
\c!color
=
,
\c!category
=
\v!edge
]
376 377
\definemargindata
[
\v!atleftmargin
]
[
\v!left
]
[
\c!margin
=
\v!normal
,
\c!width
=
\leftmarginwidth
,
\c!style
=
,
\c!color
=]
378
\definemargindata
[
\v!atrightmargin
]
[
\v!right
]
[
\c!margin
=
\v!normal
,
\c!width
=
\rightmarginwidth
,
\c!style
=
,
\c!color
=]
379 380
% text: \v!added
381 382
\definemargindata
[
\v!inleft
]
[
\v!left
]
[
\c!margin
=
\v!margin
,
\c!width
=
\leftmarginwidth
,
\c!align
=
\v!flushright
]
383
\definemargindata
[
\v!inright
]
[
\v!right
]
[
\c!margin
=
\v!margin
,
\c!width
=
\rightmarginwidth
,
\c!align
=
\v!flushleft
]
384
\definemargindata
[
\v!inouter
]
[
\v!outer
]
[
\c!margin
=
\v!margin
,
\c!width
=
\outermarginwidth
,
\c!align
=
\v!inner
]
385
\definemargindata
[
\v!ininner
]
[
\v!inner
]
[
\c!margin
=
\v!margin
,
\c!width
=
\innermarginwidth
,
\c!align
=
\v!outer
]
386 387
% no longer auto auto-other
388 389
\definemargindata
[
\v!inmargin
]
[
\v!left
]
[
\c!margin
=
\v!margin
,
\c!width
=
\leftmarginwidth
,
\c!align
=
\v!flushright
]
390
\definemargindata
[
\v!inother
]
[
\v!right
]
[
\c!margin
=
\v!margin
,
\c!width
=
\rightmarginwidth
,
\c!align
=
\v!flushleft
]
391 392
\definemargindata
[
\v!margintext
]
[
\v!left
]
[
\c!margin
=
\v!margin
,
\c!width
=
\leftmarginwidth
,
\c!align
=
\v!flushright
,
\c!stack
=
\v!yes
]
393 394
\setupmarginframed
[
\v!left
]
[
\c!method
=
\v!first
,
\c!align
=
\v!flushright
,
\s!parent
=
\??marginframed
]
% we could autoparent when no define yet
395
\setupmarginframed
[
\v!right
]
[
\c!method
=
\v!first
,
\c!align
=
\v!flushleft
,
\s!parent
=
\??marginframed
]
396
\setupmarginframed
[
\v!outer
]
[
\c!method
=
\v!first
,
\c!align
=
\v!inner
,
\s!parent
=
\??marginframed
]
397
\setupmarginframed
[
\v!inner
]
[
\c!method
=
\v!first
,
\c!align
=
\v!outer
,
\s!parent
=
\??marginframed
]
398 399
\definemarginframed
[
\v!inleft
]
[
\v!left
]
400
\definemarginframed
[
\v!inright
]
[
\v!right
]
401
\definemarginframed
[
\v!inouter
]
[
\v!outer
]
402
\definemarginframed
[
\v!ininner
]
[
\v!inner
]
403
\definemarginframed
[
\v!inmargin
]
[
\v!inleft
]
404
\definemarginframed
[
\v!inother
]
[
\v!inright
]
405 406
\let
\marginword
\margintext
407
\let
\margintitle
\margintext
408
\let
\inothermargin
\inother
% for old times sake
409 410
%definemargindata [inouterextra] [\v!outer] [\c!margin=\v!edge,\c!location=\v!outer,\c!width=\outeredgewidth,\c!align=\v!outer,\c!category=\v!edge]
411
%definemargindata [ininnerextra] [\v!inner] [\c!margin=\v!edge,\c!location=\v!inner,\c!width=\inneredgewidth,\c!align=\v!inner,\c!category=\v!edge]
412
%
413
%definemarginframed [inouterextra] [\v!outer]
414
%definemarginframed [ininnerextra] [\v!inner]
415 416
%D As we have more control we are not backward compatible although in
417
%D practice it won't hurt that much. So, from now on use:
418
%D
419
%D \starttyping
420
%D \definemargindata
421
%D \setupmargindata
422
%D \definemarginframed
423
%D \setupmarginframed
424
%D \stoptyping
425 426
% The following sort of works okay but is to be avoided:
427 428
\let
\definemarginline
\definemargindata
429 430
\unexpanded
\def
\defineinmargin
431
{
\doquadrupleempty
\typo_inmargin_define
}
432 433
\def
\typo_inmargin_define
[#
name
][#
location
][#
align
][#
settings
]
% not completely compatible
434
{
\definemargindata
[#
name
][
\c!location
=#
location
,
\c!align
=#
align
,
#
settings
]
%
435
\definemarginframed
[#
name
][#
location
][
\c!align
=#
align
,
#
settings
]
}
436 437
\let
\setupinmargin
\setupmargindata
% only partial (no framed)
438 439
% begin of experimental code (will move)
440
%
441
% \dosetanchor{x}test \dostarthanchoring{x}\llap{crap}\dostophanchoring{x}test test test
442
% test \dostarthanchoring{text}\llap{crap}\dostophanchoring{text}test test test
443 444
% \def\dosetanchor #1{\dontleavehmode\latelua{anchors.set("#1")}}
445
% \def\doresetanchor #1{\dontleavehmode\latelua{anchors.reset("#1")}}
446
% \def\doresetanchornow #1{\directlua{anchors.reset("#1")}}
447
% \def\dostartanchoring #1{\dontleavehmode\latelua{anchors.startmove("#1")}}
448
% \def\dostopanchoring #1{\dontleavehmode\latelua{anchors.stopmove("#1")}}
449
% \def\dostarthanchoring#1{\dontleavehmode\latelua{anchors.startmove("#1","h")}}
450
% \def\dostartvanchoring#1{\dontleavehmode\latelua{anchors.startmove("#1","v")}}
451
% \let\dostophanchoring \dostopanchoring
452
% \let\dostopvanchoring \dostopanchoring
453 454
%D Here because in strc-ren we are too early:
455 456
% % \definemargindata
457
% % [margintext:chapter]
458
% % [margintext:section]
459
% %
460
% % \defineheadalternative
461
% % [margintext:chapter]
462
% % [margintext]
463
% % [margintext=margintext:chapter]
464
% %
465
% % \setuphead
466
% % [chapter]
467
% % [alternative=margintext:chapter]
468
%
469
% \setuphead
470
% [chapter]
471
% [alternative=margintext]
472 473
\definemargindata
474
[
\v!margintext
:
\v!section
]
475
[
\v!left
]
476
[
\c!margin
=
\v!margin
,
477
\c!width
=
\leftmarginwidth
,
478
\c!align
=
\v!flushright
]
479 480
\defineheadalternative
481
[
\v!margintext
]
482
[
\c!alternative
=
\v!somewhere
,
483
\c!margintext
=
\v!margintext
:
\v!section
,
484
\c!renderingsetup
=
\??headrenderings
:
\v!margintext
]
485 486
\startsetups
[
\??headrenderings
:
\v!margintext
]
487
\executeifdefined
{
\headalternativeparameter
\c!margintext
}
\margintext
{
488
\ifconditional
\headshownumber
489
\headnumbercontent
490
\hskip
\headnumberdistance
491
\fi
492
\headtextcontent
493
}
494
\stopsetups
495 496
\protect
\endinput
497