1
2
3
4
5
6
7
8
9
10
11
12
13
14\writestatus{loading}{ConTeXt Structure Macros Section Rendering}
15
16\unprotect
17
18\newbox \b_strc_rendering_head
19\newdimension\d_strc_rendering_local_leftoffset
20\newdimension\d_strc_rendering_local_rightoffset
21
22
23
24
25
26
27
28
29
30\protected\def\strc_rendering_initialize_style_and_color
31 {\ifconditional\headisdisplay
32 \expandafter\strc_rendering_initialize_style_and_color_display
33 \else
34 \expandafter\strc_rendering_initialize_style_and_color_inline
35 \fi}
36
37\protected\def\strc_rendering_initialize_style_and_color_display#1#2
38 {\dontconvertfont
39 \edef\p_strc_rendering_interlinespace{\headparameter\c!interlinespace}
40 \ifempty\p_strc_rendering_interlinespace
41
42 \fontattributeisset\conditionalfalse
43 \interlinespaceisset\conditionalfalse
44 \useheadstyleandcolor\c!style\c!color\relax
45 \ifconditional\fontattributeisset \ifconditional\interlinespaceisset \else
46 \setupinterlinespace
47 \fi \fi
48 \fontattributeisset\conditionalfalse
49 \useheadstyleandcolor#1#2\relax
50 \ifconditional\fontattributeisset \ifconditional\interlinespaceisset \else
51 \setupinterlinespace
52 \fi \fi
53 \else
54
55 \fontattributeisset\conditionalfalse
56 \useheadstyleandcolor\c!style\c!color\relax
57 \ifconditional\fontattributeisset
58 \dosetupcheckedinterlinespace\p_strc_rendering_interlinespace
59 \fi
60 \fontattributeisset\conditionalfalse
61 \useheadstyleandcolor#1#2\relax
62 \ifconditional\fontattributeisset
63 \dosetupcheckedinterlinespace\p_strc_rendering_interlinespace
64 \fi
65 \fi}
66
67\protected\def\strc_rendering_initialize_style_and_color_inline#1#2
68 {\dontconvertfont
69 \fontattributeisset\conditionalfalse
70 \useheadstyleandcolor\c!style\c!color\relax
71 \ifconditional\fontattributeisset
72 \updateraggedskips
73 \fi
74 \fontattributeisset\conditionalfalse
75 \useheadstyleandcolor#1#2\relax
76 \ifconditional\fontattributeisset
77 \updateraggedskips
78 \fi}
79
80\let\currentstructurereferenceattribute\attributeunsetvalue
81
82\permanent\def\headreferenceattributes
83 {\iflocation
84
85 attr \destinationattribute \currentstructureattribute
86 attr \referenceattribute \currentstructurereferenceattribute
87
88 \fi}
89
90\permanent\def\setinlineheadreferenceattributes
91 {\ifconditional\headisdisplay\orelse\iflocation
92 \c_attr_destination\currentstructureattribute
93 \c_attr_reference \currentstructurereferenceattribute
94
95 \fi}
96
97\permanent\protected\def\docheckheadreference
98 {\edef\currentheadinteraction{\headparameter\c!interaction}
99 \ifx\currentheadinteraction\v!list
100
101 \strc_references_get_simple_reference{*\the\locationcount}
102 \let\currentstructurereferenceattribute\currentreferenceattribute
103 \orelse\ifx\currentheadinteraction\v!reference
104
105 \edef\currentheadbackreference{\structurevariable\c!backreference}
106 \ifempty\currentheadbackreference \else
107 \strc_references_get_simple_reference\currentheadbackreference
108 \let\currentstructurereferenceattribute\currentreferenceattribute
109 \fi
110 \else
111
112 \fi}
113
114
115
116
117\protected\def\strc_rendering_place_head_text
118 {\strc_rendering_start_placement
119 \setheadmarking
120 \strc_sectioning_reset_head_number_content
121 \ifconditional\c_strc_sectioning_empty
122 \setbox\b_strc_rendering_head\hpack \headreferenceattributes to \zeropoint\bgroup
123\strc_rendering_initialize_interaction
124 \strut
125 \egroup
126 \else
127 \docheckheadreference
128 \setbox\b_strc_rendering_head\hbox \headreferenceattributes\bgroup
129\strc_rendering_initialize_interaction
130 \spac_grids_set_local_snapping{\headparameter\c!internalgrid}
131 \strc_sectioning_reset_head_number_content
132 \useheadstyleparameter\c!style
133 \setinlineheadreferenceattributes
134 \strc_rendering_inject_text
135 \egroup
136 \fi
137 \strc_rendering_stop_placement}
138
139\protected\def\strc_rendering_place_head_number_and_text
140 {\strc_rendering_start_placement
141 \setheadmarking
142 \iftext\getheadnumber
143 \strc_sectioning_set_head_number_content
144 \else
145 \strc_sectioning_reset_head_number_content
146 \fi
147 \ifconditional\c_strc_sectioning_empty
148 \setbox\b_strc_rendering_head\hpack \headreferenceattributes to \zeropoint\bgroup
149\strc_rendering_initialize_interaction
150 \strut
151 \egroup
152 \else
153 \docheckheadreference
154 \setbox\b_strc_rendering_head\hbox \headreferenceattributes\bgroup
155\strc_rendering_initialize_interaction
156 \spac_grids_set_local_snapping{\headparameter\c!internalgrid}
157 \useheadstyleparameter\c!style
158 \setinlineheadreferenceattributes
159 \strc_rendering_inject_number_and_text
160 \egroup
161 \fi
162 \strc_rendering_stop_placement}
163
164\protected\def\strc_rendering_place_head_empty
165 {\hpack\headreferenceattributes{\getheadsyncs}}
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181\permanent\protected\def\headhbox{\hbox\headreferenceattributes}
182\permanent\protected\def\headvbox{\vbox\headreferenceattributes}
183
184\permanent\protected\def\startlocalheadsetup{\bgroup\strc_rendering_initialize_spacing}
185\permanent\protected\def\stoplocalheadsetup {\egroup}
186
187\aliased\let\headsetupspacing\relax
188\aliased\let\localheadsetup \relax
189
190\permanent\protected\def\strc_rendering_initialize_spacing
191 {\forgetall
192 \edef\p_align{\headparameter\c!align}
193 \ifempty\p_align \else
194 \setupalign[\p_align]
195 \fi
196 \edef\p_tolerance{\headparameter\c!tolerance}
197 \ifempty\p_tolerance \else
198 \setuptolerance[\p_tolerance]
199 \fi
200 \edef\p_strut{\headparameter\c!strut}
201 \ifx\p_strut\v!no
202 \setnostrut
203 \fi
204 \enforced\let\\\strc_rendering_shortcut_backslash}
205
206\protected\def\strc_rendering_shortcut_backslash
207 {\crlf
208 \strut
209 \ignorespaces}
210
211
212
213\def\strc_rendering_start_placement
214 {\headparameter\c!beforehead
215 \bgroup
216 \setsystemmode\currenthead
217 \strc_rendering_initialize_alternatives
218 \strc_rendering_initialize_dimensions
219 \strc_rendering_initialize_line_state
220 \reseteverypar
221 \noindent
222 \bgroup
223 \synctexpushline
224 \edef\p_aligntitle{\headparameter\c!aligntitle}
225 \ifx\p_aligntitle\v!yes
226 \strc_rendering_initialize_hsize_local
227 \orelse\ifx\p_aligntitle\v!float
228 \strc_rendering_initialize_hsize_local
229 \else
230 \strc_rendering_initialize_hsize_global
231 \fi
232 \inhibitmargindata\conditionalfalse
233 \dontcomplain
234 \postponenotes
235
236
237 \enforced\let\localheadsetup \strc_rendering_initialize_spacing
238 \enforced\let\headsetupspacing\strc_rendering_initialize_spacing}
239
240\def\strc_rendering_initialize_interaction
241 {\resetinteractionstyleandcolor}
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261\newdimension\d_strc_rendering_hang_height
262\newinteger \n_strc_rendering_hang_lines
263\newdimension\d_strc_rendering_local_height
264\newdimension\d_strc_rendering_local_depth
265\newdimension\d_strc_rendering_local_lineheight
266
267\def\strc_rendering_initialize_line_state
268 {\global\d_strc_rendering_local_height\strutht
269 \global\d_strc_rendering_local_depth\strutdp
270 \global\d_strc_rendering_local_lineheight\lineheight}
271
272\def\strc_rendering_check_hang
273 {\begingroup
274 \openlineheight\d_strc_rendering_local_lineheight
275 \d_strc_rendering_hang_height\htdp\b_strc_rendering_head
276 \getnoflines\d_strc_rendering_hang_height
277 \normalexpanded{\endgroup\n_strc_rendering_hang_lines\tointeger{\noflines\plusone}\relax}
278 \setbox\b_strc_rendering_head\hpack{\lower\n_strc_rendering_hang_lines\d_strc_rendering_hang_height\box\b_strc_rendering_head}
279 \d_strc_rendering_hang_height{\htdp\b_strc_rendering_head\d_strc_rendering_local_height\strutdp}
280 \ht\b_strc_rendering_head\strutht
281 \dp\b_strc_rendering_head\strutdp
282 \d_strc_rendering_local_depth\strutdp}
283
284\installcorenamespace{headplacementcheckhang}
285
286\defcsname\??headplacementcheckhang\v!line\endcsname
287 {\strc_rendering_check_hang
288 \n_strc_rendering_hang_lines\zerocount}
289
290\defcsname\??headplacementcheckhang\v!broad\endcsname
291 {\strc_rendering_check_hang
292 \getnoflines\d_strc_rendering_hang_height}
293
294\defcsname\??headplacementcheckhang\v!fit\endcsname
295 {\strc_rendering_check_hang
296 \getrawnoflines\d_strc_rendering_hang_height}
297
298\defcsname\??headplacementcheckhang\v!none\endcsname
299 {\n_strc_rendering_hang_lines\zerocount}
300
301\defcsname\??headplacementcheckhang\endcsname
302 {\n_strc_rendering_hang_lines\zerocount}
303
304\defcsname\??headplacementcheckhang\s!unknown\endcsname
305 {\strc_rendering_check_hang
306 \n_strc_rendering_hang_lines{(\headparameter\c!hang)\plusone}}
307
308\def\strc_rendering_initialize_line_hang
309 {\ifconditional\headisdisplay
310 \expandnamespaceparameter\??headplacementcheckhang\headparameter\c!hang\s!unknown
311 \relax
312 \else
313 \n_strc_rendering_hang_lines \zerocount
314 \d_strc_rendering_hang_height\zeropoint
315 \fi}
316
317\def\strc_rendering_initialize_hsize_local
318 {\global\d_strc_rendering_local_leftoffset \leftskip
319 \global\d_strc_rendering_local_rightoffset\rightskip
320
321
322
323
324
325
326 \scratchwidth\availablehsize
327 \forgetall
328 \hsize\scratchwidth}
329
330\def\strc_rendering_initialize_hsize_global
331 {\global\d_strc_rendering_local_leftoffset \zeropoint
332 \global\d_strc_rendering_local_rightoffset\zeropoint
333 \forgetall}
334
335
336
337
338
339
340
341\def\strc_sectioning_stay_on_this_line
342 {\directcheckedvspacing{\v!line,\v!samepage}
343 \directcheckedvspacing\v!disable}
344
345\def\strc_rendering_stop_placement
346 {\n_strc_rendering_hang_lines\zerocount
347 \ifconditional\headisdisplay
348 \strc_rendering_initialize_line_hang
349
350 \setbox\b_strc_rendering_head\hbox
351
352 {\hskip\glueexpr\d_strc_rendering_local_leftoffset(\headparameter\c!margin)\relax
353 \box\b_strc_rendering_head
354 \getheadsyncs
355 }
356 \ifgridsnapping
357 \applygridmethod
358 {\headparameter\c!grid}
359 {\ifconditional\headisdisplay
360 \strc_rendering_initialize_style_and_color_display\c!textstyle\c!textcolor
361 \fi}
362 {\box\b_strc_rendering_head}
363 \else
364 \box\b_strc_rendering_head
365 \fi
366 \flushnotes
367 \endgraf
368 \ifvmode
369 \ifnum\n_strc_rendering_hang_lines>\zerocount
370 \dorecurse\n_strc_rendering_hang_lines{\nointerlineskip\dosomebreak\nobreak\strut\endgraf}
371 \fi
372 \nointerlineskip
373 \dosomebreak\nobreak
374 \fi
375
376 \else
377
378
379 \strut
380 \flushnotes
381 \unhbox\b_strc_rendering_head
382 \getheadsyncs
383 \ifconditional\headissomewhere
384 \strc_sectioning_stay_on_this_line
385 \else
386
387 \hskip\headtextdistance\relax
388 \strc_sectioning_inject_continuous_signal
389 \fi
390 \fi
391 \ifconditional\headisdisplay
392 \ifvmode
393 \ifgridsnapping
394 \prevdepth\strutdp
395 \else
396 \prevdepth\d_strc_rendering_local_depth
397 \fi
398 \fi
399 \fi
400 \synctexpopline
401 \egroup
402 \egroup
403 \ifconditional\headisdisplay
404 \useindentnextparameter\headparameter
405 \orelse\ifconditional\headissomewhere
406 \ignoreparskip
407 \noindentation
408 \else
409 \ignoreparskip
410 \doindentation
411 \fi
412
413 \headparameter\c!afterhead}
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439\installcorenamespace{headplacementalternative}
440\installcorenamespace{headrenderings}
441\installcorenamespace{headalternative}
442
443\installcommandhandler \??headalternative {headalternative} \??headalternative
444
445\setupheadalternative
446 [
447
448 \c!alternative=\v!vertical,
449 \c!renderingsetup=\??headrenderings:\currentheadalternative]
450
451\let\currentheadalternative \v!normal
452\let\currentheadrenderingalternative\v!vertical
453
454\lettonothing\currentheadrenderingsetup
455
456\permanent\tolerant\protected\def\defineheadplacement[#1]#*[#2]
457 {\doifelsenextbgroup
458 {\strc_rendering_define_placement_yes[#1][#2]}
459 {\strc_rendering_define_placement_nop[#1][#2]}}
460
461\def\strc_rendering_define_placement_yes[#1][#2]
462 {\defineheadalternative[#1][\c!alternative=#2,\c!renderingsetup=\??headrenderings:\v!command]
463 \protected\defcsname\??headplacementalternative#1\endcsname##1##2}
464
465\def\strc_rendering_define_placement_nop[#1][#2]
466 {\defineheadalternative[#1][\c!alternative=#2,\c!renderingsetup=\??headrenderings:\v!command]
467 \protected\defcsname\??headplacementalternative#1\endcsname}
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483\lettonothing\headnumbercontent
484\lettonothing\headtextcontent
485
486\newdimension\headwidth
487\newdimension\headtextwidth
488\newgluespec \headtextdistance
489\newdimension\headnumberdistance
490\newdimension\headnumberwidth
491
492
493
494
495\protected\def\strc_rendering_initialize_alternatives
496 {\edef\currentheadalternative{\headparameter\c!alternative}
497 \ifcsname\currentheadalternativehash\s!parent\endcsname \else
498 \let\currentheadalternative\v!normal
499 \fi
500 \edef\currentheadrenderingsetup{\headalternativeparameter\c!renderingsetup}
501 \edef\currentheadrenderingalternative{\headalternativeparameter\c!alternative}
502 \ifempty\currentheadrenderingalternative
503 \let\currentheadrenderingalternative\v!vertical
504 \fi
505 \ifx\currentheadrenderingalternative\v!horizontal
506 \global\headisdisplay\conditionalfalse
507 \global\headissomewhere\conditionalfalse
508 \orelse\ifx\currentheadrenderingalternative\v!somewhere
509 \global\headisdisplay\conditionalfalse
510 \global\headissomewhere\conditionaltrue
511 \else
512 \global\headisdisplay\conditionaltrue
513 \global\headissomewhere\conditionalfalse
514 \fi}
515
516\protected\def\strc_rendering_initialize_dimensions
517 {\headwidth {\headparameter\c!width }
518 \headnumberwidth {\headparameter\c!numberwidth }
519 \headnumberdistance{\headparameter\c!distance }
520 \headtextdistance \glueexpr\headparameter\c!textdistance\relax
521 \headtextwidth {\headparameter\c!textwidth }}
522
523\permanent\protected\def\headtextcontent
524 {\begingroup
525 \strc_rendering_initialize_style_and_color\c!textstyle\c!textcolor
526 \headparameter\c!commandbefore\relax
527 \ifcsname\currentheadhash\c!deeptextcommand\endcsname
528
529 \expandafter\let\expandafter\deepstructuretitlecommand\lastnamedcs
530 \fi
531 \ifconditional\headisdisplay
532
533 \headparameter\c!textcommand{\setstrut\begstrut\getheadtitle\endstrut}
534 \global\d_strc_rendering_local_height\strutht
535 \global\d_strc_rendering_local_depth\strutdp
536 \global\d_strc_rendering_local_lineheight\lineheight
537 \headparameter\c!commandafter\relax
538 \endgraf
539 \else
540 \headparameter\c!textcommand{\getheadtitle}
541 \headparameter\c!commandafter\relax
542 \fi
543 \endgroup}
544
545\permanent\protected\def\headnumbercontent
546 {\begingroup
547 \strc_rendering_initialize_style_and_color\c!numberstyle\c!numbercolor
548 \ifcsname\currentheadhash\c!deepnumbercommand\endcsname
549
550 \expandafter\let\expandafter\deepstructurenumbercommand\lastnamedcs
551 \fi
552 \ifconditional\headisdisplay
553
554 \headparameter\c!numbercommand{\setstrut\begstrut\getheadnumber\endstrut}
555 \else
556 \headparameter\c!numbercommand{\getheadnumber}
557 \fi
558 \endgroup}
559
560\permanent\protected\def\fakedheadnumber{\vphantom{0}}
561
562
563
564
565\permanent\protected\def\fakeheadnumbercontent
566 {\ifcstok{\headparameter\c!hidenumber}\v!yes\else
567 \hbox to \zeropoint{\let\getheadnumber\fakedheadnumber\headnumbercontent}
568 \fi}
569
570\permanent\protected\def\strc_rendering_inject_number_and_text
571 {\edef\p_command{\headparameter\c!command}
572 \ifempty\p_command
573 \directsetup\currentheadrenderingsetup
574 \else
575 \p_command\headnumbercontent\headtextcontent
576 \fi}
577
578\protected\def\strc_rendering_inject_text
579 {\edef\p_command{\headparameter\c!command}
580 \ifempty\p_command
581 \directsetup\currentheadrenderingsetup
582 \else
583 \p_command\empty\headtextcontent
584 \fi}
585
586\startsetups[\??headrenderings:\v!command]
587 \csname\??headplacementalternative\currentheadalternative\endcsname \headnumbercontent \headtextcontent
588\stopsetups
589
590
591
592
593
594
595\defineheadalternative
596 [\v!paragraph]
597 [\c!alternative=\v!vertical,
598 \c!renderingsetup=\??headrenderings:\v!paragraph]
599
600\startsetups[\??headrenderings:\v!paragraph]
601 \vbox {
602 \headsetupspacing
603 \begstrut
604 \ifconditional\headshownumber
605 \headnumbercontent
606 \hskip\headnumberdistance
607 \fi
608 \headtextcontent
609 }
610\stopsetups
611
612
613
614
615
616
617
618
619\defineheadalternative
620 [\v!normal]
621 [\c!alternative=\v!vertical,
622 \c!renderingsetup=\??headrenderings:\v!normal]
623
624\startsetups[\??headrenderings:\v!normal]
625 \vbox {
626 \headsetupspacing
627 \ifconditional\headshownumber
628 \ifzeropt\headwidth \else
629 \ifzeropt\headnumberwidth
630 \ifzeropt\headtextwidth \else
631 \headnumberwidth{\headwidth\headtextwidth}
632 \fi
633 \else
634 \ifzeropt\headtextwidth
635 \headtextwidth{\headwidth\headnumberwidth}
636 \fi
637 \fi
638 \hsize\headwidth
639 \fi
640 \ifzeropt\headnumberwidth \else
641 \headnumberdistance\zeropoint
642 \fi
643 \setbox\scratchbox\hbox \ifzeropt\headnumberwidth\else to \headnumberwidth\fi{\headnumbercontent}
644 \scratchdimen{\wd\scratchbox\headnumberdistance}
645 \ifzeropt\headtextwidth \else
646 \hsize{\scratchdimen\headtextwidth}
647 \fi
648 \hangindent\scratchdimen
649 \hangafter \plusone
650 \noindent
651 \box\scratchbox
652 \hskip\headnumberdistance
653 \else
654 \ifzeropt\headtextwidth
655 \ifzeropt\headwidth \else
656 \hsize\headwidth
657 \fi
658 \else
659 \hsize\headtextwidth
660 \fi
661 \noindent
662 \fakeheadnumbercontent
663 \fi
664 \headtextcontent
665 }
666\stopsetups
667
668\defineheadalternative
669 [\v!inmargin]
670 [\c!alternative=\v!vertical,
671 \c!renderingsetup=\??headrenderings:\v!inmargin]
672
673\startsetups[\??headrenderings:\v!inmargin]
674 \vbox {
675 \headsetupspacing
676 \dontleavehmode
677 \begstrut
678 \ifconditional\headshownumber
679 \ifempty {\headparameter\c!location}
680
681 \llap {
682 \signalrightpage
683 \hbox {
684 \hfill
685 \headnumbercontent
686 \doifelserightpage{
687 \scratchdistance\leftmargindistance
688 } {
689 \scratchdistance\rightmargindistance
690 }
691
692 \hskip\glueexpr\d_strc_rendering_local_leftoffset\scratchdistance\relax
693 }
694 }
695 \else
696
697 \margindata [\headparameter\c!location] {
698 \headnumbercontent
699 }
700 \fi
701 \else
702 \fakeheadnumbercontent
703 \fi
704 \headtextcontent
705 }
706\stopsetups
707
708\defineheadalternative
709 [\v!margin]
710 [\v!inmargin]
711
712
713
714
715
716
717
718\defineheadalternative
719 [\v!reverse]
720 [\c!alternative=\v!vertical,
721 \c!renderingsetup=\??headrenderings:\v!reverse]
722
723\startsetups[\??headrenderings:\v!reverse]
724 \vbox {
725 \headsetupspacing
726 \noindent
727 \begstrut
728 \headisdisplay\conditionalfalse
729 \headtextcontent
730 \ifconditional\headshownumber
731 \kern\headnumberdistance
732 \headnumbercontent
733 \else
734 \fakeheadnumbercontent
735 \fi
736 \endstrut
737 }
738\stopsetups
739
740\defineheadalternative
741 [\v!middle]
742 [\c!alternative=\v!vertical,
743 \c!renderingsetup=\??headrenderings:\v!middle]
744
745\startsetups[\??headrenderings:\v!middle]
746 \vbox {
747 \headsetupspacing
748 \veryraggedcenter
749 \enforced\let\\\endgraf
750 \enforced\let\crlf\endgraf
751 \ifconditional\headshownumber
752 \strut
753 \headnumbercontent
754 \par
755 \else
756 \fakeheadnumbercontent
757 \fi
758 \begstrut
759 \headtextcontent
760 \endstrut
761 }
762\stopsetups
763
764\defineheadalternative
765 [\v!text]
766 [\c!alternative=\v!horizontal,
767 \c!renderingsetup=\??headrenderings:\v!text]
768
769\startsetups[\??headrenderings:\v!text]
770 \begingroup
771 \headsetupspacing
772 \ifconditional\headshownumber
773 \headnumbercontent
774 \kern\headnumberdistance
775 \fi
776 \begstrut
777 \headtextcontent
778 \endstrut
779 \endgroup
780\stopsetups
781
782
783
784\defineheadalternative
785 [\v!bottom]
786 [\c!alternative=\v!vertical,
787 \c!renderingsetup=\??headrenderings:\v!bottom]
788
789\startsetups[\??headrenderings:\v!bottom]
790 \ifconditional\headshownumber
791 \setbox\scratchboxone\hbox {
792 \headnumbercontent
793 }
794 \setbox\scratchboxtwo\vbox {
795 \headsetupspacing
796 \advanceby\hsize\wd\scratchboxone\relax
797 \headtextcontent
798 }
799 \hpack {
800 \box\scratchboxone
801 \hskip\headnumberdistance
802 \box\scratchboxtwo
803 }
804 \else
805 \vbox {
806 \headsetupspacing
807 \noindent
808 \headtextcontent
809 }
810 \fi
811\stopsetups
812
813\defineheadalternative
814 [\v!top]
815 [\c!alternative=\v!vertical,
816 \c!renderingsetup=\??headrenderings:\v!top]
817
818\startsetups[\??headrenderings:\v!top]
819 \ifconditional\headshownumber
820 \setbox\scratchboxone\hbox {
821 \headnumbercontent
822 }
823 \setbox\scratchboxtwo\vtop {
824 \headsetupspacing
825 \advanceby\hsize\wd\scratchboxone\relax
826 \headtextcontent
827 }
828 \hpack {
829 \box\scratchboxone
830 \hskip\headnumberdistance
831 \box\scratchboxtwo
832 }
833 \else
834 \vtop{
835 \headsetupspacing
836 \noindent
837 \headtextcontent
838 }
839 \fi
840\stopsetups
841
842
843
844
845
846
847\protect \endinput
848 |