1
2
3
4
5
6
7
8
9
10
11
12
13
14\writestatus
{
loading
}{
ConTeXt
Structure
Macros
Itemgroups
}
15
16\registerctxluafile
{
strc
itm
}{}
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
164
165
166
167
168
169
170
171
172
173\unprotect
174
175\newconditional
\c_strc_itemgroups_sub
176\newconditional
\c_strc_itemgroups_head
177\newconditional
\c_strc_itemgroups_intro
178\newconditional
\c_strc_itemgroups_randomize
179\newconditional
\c_strc_itemgroups_horizontal
180\newconditional
\c_strc_itemgroups_collecting
181\newconditional
\c_strc_itemgroups_auto_intro
182\newconditional
\c_strc_itemgroups_pack
183\newconditional
\c_strc_itemgroups_paragraph
184\newconditional
\c_strc_itemgroups_text
185\newconditional
\c_strc_itemgroups_text_saved
186\newconditional
\c_strc_itemgroups_first
187\newconditional
\c_strc_itemgroups_before
188\newconditional
\c_strc_itemgroups_after
189\newconditional
\c_strc_itemgroups_nowhite
190\newconditional
\c_strc_itemgroups_joined
191\newconditional
\c_strc_itemgroups_reverse
192\newconditional
\c_strc_itemgroups_continue
193\newconditional
\c_strc_itemgroups_fitting
194\newconditional
\c_strc_itemgroups_indented_first
195\newconditional
\c_strc_itemgroups_inline
196\newconditional
\c_strc_itemgroups_columns
197\newconditional
\c_strc_itemgroups_concat
198\newconditional
\c_strc_itemgroups_txt
199\newconditional
\c_strc_itemgroups_extra
200\newconditional
\c_strc_itemgroups_repeat
201\newconditional
\c_strc_itemgroups_inline_head
202
203
204
205
206
207\newconstant
\c_strc_itemgroups_spacing_mode
\c_strc_itemgroups_spacing_mode
\plustwo
208\newconditional
\c_strc_itemgroups_optimize
\settrue
\c_strc_itemgroups_optimize
209\newconditional
\c_strc_itemgroups_auto_concat
\settrue
\c_strc_itemgroups_auto_concat
210
211\newsignal
\d_strc_itemgroups_signal
212
213\newbox
\b_strc_itemgroups
214
215\newdimen
\d_strc_itemgroups_list_width
216\newdimen
\d_strc_itemgroups_asked_width
217
218\newdimen
\d_strc_itemgroups_max_width
219\newcount
\c_strc_itemgroups_max_items
220
221\newcount
\c_strc_itemgroups_n_of_items
222\newcount
\c_strc_itemgroups_nesting
223\newcount
\c_strc_itemgroups_column_depth
224
225\def
\v_strc_itemgroups_counter
{
itemgroup
:
\currentparentitemgroup
}
226\let
\m_strc_itemgroups_repeat_start
\empty
227\def
\v_strc_itemgroups_unknown_symbol
{
?
}
228\let
\m_strc_itemgroups_indenting
\empty
229\let
\m_strc_itemgroups_destination
\empty
230
231\let
\currentitemlevel
\!!zerocount
232\def
\currentnofitems
{
\the
\c_strc_itemgroups_max_items
}
233\def
\currentitemnumber
{
\strc_counters_raw_sub
\v_strc_itemgroups_counter
\currentitemlevel
}
234
235\newtoks
\itemgroupcommands
236
237\def
\currentitemgroupsymbol
{
n
}
238\let
\currentitemgroupconversionset
\empty
239\let
\currentitemgroupsegments
\empty
240
241\def
\strc_itemgroups_register_status
242 {
\clf_registeritemgroup
{
\currentparentitemgroup
}
\c_strc_itemgroups_nesting
\c_strc_itemgroups_n_of_items
\dimexpr
\itemgroupparameter
\c!maxwidth
\relax
}
243
244\def
\strc_itemgroups_check_n_of_items
245 {
\clf_analyzeitemgroup
{
\currentparentitemgroup
}
\c_strc_itemgroups_nesting
\relax
246 \edef
\currentnofitems
{
\the
\c_strc_itemgroups_max_items
}}
247
248
249
250\def
\strc_itemgroups_insert_reference
251 {
\iftrialtypesetting
\else
\ifx
\currentitemreference
\empty
\else
252 \strc_itemgroups_insert_reference_indeed
253 \fi
\fi
}
254
255\def
\strc_itemgroups_insert_extra_reference
256 {
\iftrialtypesetting
\else
\ifx
\currentitemreference
\empty
\else
257 \normalexpanded
{
\textreference
[
\currentitemreference
]
{
\strc_itemgroups_extra_symbol
}}
258 \fi
\fi
}
259
260\def
\strc_itemgroups_insert_reference_indeed
261 {
262 \setnextinternalreference
263
264 \strc_references_start_destination_nodes
265
266 \clf_setdestinationattribute
267 {
268 metadata
{
269 kind
{
item
}
270 \ifx
\currentreferencecoding
\s!xml
271 xmlroot
{
\xmldocument
}
272 \fi
273 catcodes
\catcodetable
274 }
275 references
{
276 internal
\locationcount
277
278 view
{
\interactionparameter
\c!focus
}
279 prefix
{
\referenceprefix
}
280 reference
{
\currentitemreference
}
281 }
282 prefixdata
{
283 prefix
{
\namedcounterparameter
\v_strc_itemgroups_counter
\c!prefix
}
284 separatorset
{
\namedcounterparameter
\v_strc_itemgroups_counter
\c!prefixseparatorset
}
285 conversion
{
\namedcounterparameter
\v_strc_itemgroups_counter
\c!prefixconversion
}
286 conversionset
{
\namedcounterparameter
\v_strc_itemgroups_counter
\c!prefixconversionset
}
287 set
{
\namedcounterparameter
\v_strc_itemgroups_counter
\c!prefixset
}
288 segments
{
\namedcounterparameter
\v_strc_itemgroups_counter
\c!prefixsegments
}
289
290 connector
{
\namedcounterparameter
\v_strc_itemgroups_counter
\c!prefixconnector
}
291 }
292 numberdata
{
293 numbers
{
\v_strc_itemgroups_counter
}
294 separatorset
{
\namedcounterparameter
\v_strc_itemgroups_counter
\c!numberseparatorset
}
295
296
297
298 conversionset
{
fixed
:
:
\currentitemgroupconversionset
}
299
300
301
302 segments
{
\namedcounterparameter
\v_strc_itemgroups_counter
\c!numbersegments
}
303 }
304 }
305 \relax
306 \strc_references_stop_destination_nodes
307 \xdef
\currentdestinationattribute
{
\number
\lastdestinationattribute
}
308
309 \ifnum
\lastdestinationattribute
>
\zerocount
310 \dontleavehmode
\hbox
attr
\destinationattribute
\lastdestinationattribute
\bgroup
311 \strc_references_flush_destination_nodes
312 \egroup
313 \fi
}
314
315
316
317\installcorenamespace
{
itemgroup
}
318\installcorenamespace
{
itemgroupoption
}
319\installcorenamespace
{
itemgroupsetting
}
320\installcorenamespace
{
itemgroupkeyword
}
321\installcorenamespace
{
itemgroupalign
}
322\installcorenamespace
{
itemgrouplocal
}
323\installcorenamespace
{
itemgroupglobal
}
324\installcorenamespace
{
itemgroupdistance
}
325\installcorenamespace
{
itemgroupstack
}
326\installcorenamespace
{
itemgroupfirst
}
327\installcorenamespace
{
itemgroupstart
}
328
329\installcommandhandler
\??itemgroup
{
itemgroup
}
\??itemgroup
330
331\let
\setupitemgroups
\setupitemgroup
332
333\appendtoks
334 \setuevalue
{
\e!start
\currentitemgroup
}{
\startitemgroup
[
\currentitemgroup
]
}
335 \setuevalue
{
\e!stop
\currentitemgroup
}{
\stopitemgroup
}
336 \setuevalue
{
\e!setup
\currentitemgroup
\e!endsetup
}{
\setupitemgroup
[
\currentitemgroup
]
}
337 \let
\currentparentitemgroup
\currentitemgroup
338 \definecounter
[
\v_strc_itemgroups_counter
]
339
340
341\to
\everydefineitemgroup
342
343
344
345\def
\strc_itemgroups_store_continue_state
#
options
#
settings
346 {
\setxvalue
{
\??itemgroupoption
\currentitemgroup
}{
\strc_itemgroups_process_options
{
#
options
}}
347 \setgvalue
{
\??itemgroupsetting
\currentitemgroup
}{
\setupcurrentitemgroup
[#
settings
]
}}
348
349\def
\strc_itemgroups_fetch_continue_state
350 {
\csname
\??itemgroupoption
\currentitemgroup
\endcsname
351 \csname
\??itemgroupsetting
\currentitemgroup
\endcsname
}
352
353\def
\strc_itemgroups_reset_continue_state
354 {
\expandafter
\glet
\csname
\??itemgroupoption
\currentitemgroup
\endcsname\relax
355 \expandafter
\glet
\csname
\??itemgroupsetting
\currentitemgroup
\endcsname\relax
}
356
357
358
359
360\definevspacing
[
\v!item
@
0
]
[
penalty
:
0
]
361\definevspacing
[
\v!item
@
1
0
0
0
0
]
[
penalty
:
1
0
0
0
0
]
362\definevspacing
[
\v!item
@
5
]
[
penalty
:
5
]
363\definevspacing
[
\v!item
@
5
]
[
penalty
:
5
]
364\definevspacing
[
\v!item
@
5
0
0
]
[
penalty
:
5
0
0
]
365
366\def
\strc_itemgroups_insert_break_when_needed
#
break
367 {
\ifconditional
\c_strc_itemgroups_optimize
368 \ifconditional
\c_strc_itemgroups_text
\else
369 #
break
\relax
370 \fi
371 \fi
}
372
373\def
\strc_itemgroups_insert_breakallow
{
\strc_itemgroups_insert_break_when_needed
\strc_itemgroups_insert_breakallow_indeed
}
374\def
\strc_itemgroups_insert_breakno
{
\strc_itemgroups_insert_break_when_needed
\strc_itemgroups_insert_breakno_indeed
}
375\def
\strc_itemgroups_insert_break
{
\strc_itemgroups_insert_break_when_needed
\strc_itemgroups_insert_break_indeed
}
376\def
\strc_itemgroups_insert_nobreak
{
\strc_itemgroups_insert_break_when_needed
\strc_itemgroups_insert_nobreak_indeed
}
377
378\def
\strc_itemgroups_insert_breakallow_indeed
{
\vspacing
[
\v!item
@
0
]
}
379\def
\strc_itemgroups_insert_breakno_indeed
{
\vspacing
[
\v!item
@
1
0
0
0
0
]
}
380\def
\strc_itemgroups_insert_break_indeed
{
\flushnotes
381 \vspacing
[
\v!item
@
5
]
}
382\def
\strc_itemgroups_insert_nobreak_indeed
{
\flushnotes
383 \ifinsidecolumns
384 \vspacing
[
\v!item
@
5
]
385 \else
386 \vspacing
[
\v!item
@
5
0
0
]
387 \fi
}
388
389\unexpanded
\def
\strc_itemgroups_process_options
#
options
390 {
\processcommacommand
[#
options
]
\strc_itemgroups_process_option
}
391
392
393
394
395
396
397\def
\strc_itemgroups_process_option
#
option
398 {
\edef
\itemgroupconstantvalue
{
#
option
}
399 \ifx
\itemgroupconstantvalue
\empty
\else
400 \splitatasterisk
\itemgroupconstantvalue
\itemgroupfirst
\itemgroupsecond
401 \ifx
\itemgroupsecond
\empty
402 \let
\itemgroupsecond
\itemgroupfirst
403 \let
\itemgroupfirst
\!!plusone
404 \fi
405 \ifcsname
\??itemgroupkeyword
\itemgroupsecond
\endcsname
406 \lastnamedcs
407 \else
408 \strc_itemgroups_set_symbol
\itemgroupconstantvalue
409 \fi
410 \fi
}
411
412\def
\strc_itemgroups_process_set_option_pack
413 {
\ifcase
\c_strc_itemgroups_nesting
\else
414 \settrue
\c_strc_itemgroups_pack
415 \fi
}
416
417\def
\strc_itemgroups_process_set_option_unpack
418 {
\ifcase
\c_strc_itemgroups_nesting
\else
419 \setfalse
\c_strc_itemgroups_pack
420 \fi
}
421
422\setvalue
{
\??itemgroupkeyword
\!!zerocount
}{}
423\setvalue
{
\??itemgroupkeyword\v!packed
}{
\strc_itemgroups_process_set_option_pack
}
424\setvalue
{
\??itemgroupkeyword\v!unpacked
}{
\strc_itemgroups_process_set_option_unpack
}
425\setvalue
{
\??itemgroupkeyword\v!intro
}{
\settrue
\c_strc_itemgroups_intro
}
426\setvalue
{
\??itemgroupkeyword\v!autointro
}{
\settrue
\c_strc_itemgroups_auto_intro
}
427\setvalue
{
\??itemgroupkeyword\v!broad
}{
\ifx
\itemgroupfirst
\empty
428 \let
\itemgroupfirst
\!!plusone
429 \fi
430 \letitemgroupparameter
\c!factor
\itemgroupfirst
}
431\setvalue
{
\??itemgroupkeyword\v!text
}{
\settrue
\c_strc_itemgroups_text
432 \settrue
\c_strc_itemgroups_inline
433 \settrue
\c_strc_itemgroups_joined
434 \strc_itemgroups_process_set_option_pack
}
435\setvalue
{
\??itemgroupkeyword\v!before
}{
\settrue
\c_strc_itemgroups_before
}
436\setvalue
{
\??itemgroupkeyword\v!after
}{
\settrue
\c_strc_itemgroups_after
}
437\setvalue
{
\??itemgroupkeyword\v!nowhite
}{
\settrue
\c_strc_itemgroups_nowhite
}
438\setvalue
{
\??itemgroupkeyword\v!margin
}{
\setitemgroupparameter
\c!width
{
2
em
}}
439\setvalue
{
\??itemgroupkeyword\v!inmargin
}{
\setitemgroupparameter
\c!width
{
2
em
}}
440\setvalue
{
\??itemgroupkeyword\v!atmargin
}{
\ifnum
\c_strc_itemgroups_nesting
>
\plusone
441 \setitemgroupparameter
\c!width
{
0
em
}
442 \fi
}
443\setvalue
{
\??itemgroupkeyword\v!intext
}{
\settrue
\c_strc_itemgroups_inline
}
444\setvalue
{
\??itemgroupkeyword\v!headintext
}{
\settrue
\c_strc_itemgroups_inline_head
}
445\setvalue
{
\??itemgroupkeyword\v!loose
}{
\setfalse
\c_strc_itemgroups_optimize
}
446\setvalue
{
\??itemgroupkeyword\v!fit
}{
\settrue
\c_strc_itemgroups_fitting
}
447\setvalue
{
\??itemgroupkeyword\v!nofit
}{
\setfalse
\c_strc_itemgroups_fitting
}
448\setvalue
{
\??itemgroupkeyword\v!paragraph
}{
\settrue
\c_strc_itemgroups_paragraph
449 \strc_itemgroups_process_set_option_pack
}
450\setvalue
{
\??itemgroupkeyword\v!joinedup
}{
\settrue
\c_strc_itemgroups_joined
451 \strc_itemgroups_process_set_option_pack
}
452\setvalue
{
\??itemgroupkeyword\v!notjoinedup
}{
\setfalse
\c_strc_itemgroups_joined
}
453\setvalue
{
\??itemgroupkeyword\v!serried
}{
\edef
\itemgroupfirst
{
\ifx
\itemgroupfirst
\empty
1
\else
\itemgroupfirst
\fi
}
454 \letitemgroupparameter
\c!factor
\itemgroupfirst
}
455\setvalue
{
\??itemgroupkeyword\v!stopper
}{
\letitemgroupparameter
\c!placestopper\v!yes
}
456\setvalue
{
\??itemgroupkeyword\v!nostopper
}{
\letitemgroupparameter
\c!placestopper\v!no
}
457\setvalue
{
\??itemgroupkeyword\v!repeat
}{
\settrue
\c_strc_itemgroups_repeat
}
458\setvalue
{
\??itemgroupkeyword\v!norepeat
}{
\setfalse
\c_strc_itemgroups_repeat
}
459\setvalue
{
\??itemgroupkeyword\v!reverse
}{
\settrue
\c_strc_itemgroups_reverse
}
460\setvalue
{
\??itemgroupkeyword\v!columns
}{
\settrue
\c_strc_itemgroups_columns
}
461\setvalue
{
\??itemgroupkeyword\v!one
}{
\letitemgroupparameter
\c!n
\plusone
}
462\setvalue
{
\??itemgroupkeyword\v!two
}{
\letitemgroupparameter
\c!n
\plustwo
}
463\setvalue
{
\??itemgroupkeyword\v!three
}{
\letitemgroupparameter
\c!n
\plusthree
}
464\setvalue
{
\??itemgroupkeyword\v!four
}{
\letitemgroupparameter
\c!n
\plusfour
}
465\setvalue
{
\??itemgroupkeyword\v!five
}{
\letitemgroupparameter
\c!n
\plusfive
}
466\setvalue
{
\??itemgroupkeyword\v!six
}{
\letitemgroupparameter
\c!n
\plussix
}
467\setvalue
{
\??itemgroupkeyword\v!seven
}{
\letitemgroupparameter
\c!n
\plusseven
}
468\setvalue
{
\??itemgroupkeyword\v!eight
}{
\letitemgroupparameter
\c!n
\pluseight
}
469\setvalue
{
\??itemgroupkeyword\v!nine
}{
\letitemgroupparameter
\c!n
\plusnine
}
470\setvalue
{
\??itemgroupkeyword\v!standard
}{
\setitemgroupparameter
\c!width
{
1
.
5
\emwidth
}
471 \setitemgroupparameter
\c!distance
{
.
5
\emwidth
}
472
473 \letitemgroupparameter
\c!factor
{
\zerocount
}
474 \setitemgroupparameter
\c!packcriterium
{
\zerocount
}
475 \letitemgroupparameter
\c!inner
\empty
476 \letitemgroupparameter
\c!beforehead
\empty
477 \letitemgroupparameter
\c!afterhead
\blank
478 \letitemgroupparameter
\c!before
\blank
479 \letitemgroupparameter
\c!inbetween
\blank
480 \letitemgroupparameter
\c!after
\blank
}
481
482\def
\strc_itemgroups_initialize_local
483 {
\setfalse
\c_strc_itemgroups_inline
484 \setfalse
\c_strc_itemgroups_concat
485 \setfalse
\c_strc_itemgroups_txt
486
487 \setfalse
\c_strc_itemgroups_reverse
488 \setfalse
\c_strc_itemgroups_intro
489 \setfalse
\c_strc_itemgroups_auto_intro
490 \setfalse
\c_strc_itemgroups_before
491 \setfalse
\c_strc_itemgroups_after
492 \setfalse
\c_strc_itemgroups_nowhite
493 \setfalse
\c_strc_itemgroups_randomize
494 \setfalse
\c_strc_itemgroups_horizontal
495 \setfalse
\c_strc_itemgroups_collecting
496 \setfalse
\c_strc_itemgroups_intro
497 \setfalse
\c_strc_itemgroups_continue
498
499 \setfalse
\c_strc_itemgroups_head
500 \setfalse
\c_strc_itemgroups_sub
501 \setfalse
\c_strc_itemgroups_symbol
502 \setfalse
\c_strc_itemgroups_columns
503
504 \let
\m_strc_itemgroups_destination
\empty
505 \let
\strc_itemgroups_used_symbol
\empty
506 \let
\strc_itemgroups_margin_symbol
\empty
507 \let
\strc_itemgroups_extra_symbol
\empty
508
509 \global
\letitemgroupparameter
\c!maxwidth
\!!zeropoint
510 }
511
512\setvalue
{
\??itemgroupfirst\v!intro
}{
\settrue
\c_strc_itemgroups_intro
}
513\setvalue
{
\??itemgroupfirst\v!continue
}{
\settrue
\c_strc_itemgroups_continue
}
514\setvalue
{
\??itemgroupfirst\v!random
}{
\settrue
\c_strc_itemgroups_randomize
515 \settrue
\c_strc_itemgroups_collecting
}
516\setvalue
{
\??itemgroupkeyword\v!horizontal
}{
\settrue
\c_strc_itemgroups_horizontal
517 \settrue
\c_strc_itemgroups_collecting
518 \settrue
\c_strc_itemgroups_inline
519 \settrue
\c_strc_itemgroups_joined
520 \strc_itemgroups_process_set_option_pack
}
521
522\def
\strc_itemgroups_preset_stage_one
#
options
523 {
\processcommacommand
[#
options
]
\strc_itemgroups_preset_stage_one_indeed
}
524
525
526
527
528
529
530\def
\strc_itemgroups_preset_stage_one_indeed
#
option
531 {
\ifcsname
\??itemgroupfirst
#
option
\endcsname
532 \lastnamedcs
533 \fi
}
534
535\ifdefined
\dotagsetitemgroup
\else
\let
\dotagsetitemgroup
\relax
\fi
536\ifdefined
\dotagsetitem
\else
\let
\dotagsetitem
\gobbleoneargument
\fi
537
538\def
\strc_itemgroups_tag_start_group
539 {
\dostarttaggedchained
\t!itemgroup
\currentparentitemgroup
\??itemgroup
540 \dotagsetitemgroup
}
541
542\def
\strc_itemgroups_tag_stop_group
543 {
\dostoptagged
}
544
545\def
\strc_itemgroups_before_command
546 {
\ifconditional
\c_strc_itemgroups_nowhite
547 \ifconditional
\c_strc_itemgroups_before
548 \ifcase
\c_strc_itemgroups_nesting
\or
\itemgroupparameter
\c!before
\fi
549 \else
550 \nowhitespace
551 \fi
552 \else
\ifconditional
\c_strc_itemgroups_joined
553
554 \else
555 \itemgroupparameter
\c!before
556 \fi\fi
}
557
558\def
\strc_itemgroups_after_command
559 {
\ifconditional
\c_strc_itemgroups_nowhite
560 \ifconditional
\c_strc_itemgroups_after
561 \ifcase
\c_strc_itemgroups_nesting
\or
\itemgroupparameter
\c!after
\fi
562 \else
563 \nowhitespace
564 \fi
565 \else
\ifconditional
\c_strc_itemgroups_joined
566
567 \else
568 \itemgroupparameter
\c!after
569 \fi\fi
}
570
571\def
\strc_itemgroups_between_command
572 {
\ifconditional
\c_strc_itemgroups_nowhite
573 \nowhitespace
574 \else
\ifconditional
\c_strc_itemgroups_joined
575
576 \else
577 \itemgroupparameter
\c!inbetween
578 \fi\fi
}
579
580\def
\strc_itemgroups_before_head_command
581 {
\ifconditional
\c_strc_itemgroups_nowhite
582 \nowhitespace
583 \else
\ifconditional
\c_strc_itemgroups_joined
584
585 \else
586 \itemgroupparameter
\c!beforehead
587 \fi\fi
}
588
589\def
\strc_itemgroups_after_head_command
590 {
\ifconditional
\c_strc_itemgroups_nowhite
591 \nowhitespace
592 \else
\ifconditional
\c_strc_itemgroups_joined
593
594 \else
595 \itemgroupparameter
\c!afterhead
596 \fi\fi
}
597
598
599
600\let
\strc_itemgroups_normal_setup
\setupitemgroup
601
602\unexpanded
\def
\setupitemgroup
603 {
\doquadrupleempty
\strc_itemgroups_setup
}
604
605\def
\strc_itemgroups_setup
[#
category
][#
levels
][#
options
][#
settings
]
606 {
\edef
\strc_itemgroups_setup_what
{
#
levels
}
607 \iffourthargument
608 \ifx
\strc_itemgroups_setup_what
\v!each
609 \strc_itemgroups_setup_each
{
#
category
}{
#
options
}
610 \strc_itemgroups_setup_each
{
#
category
}{
#
settings
}
611 \else
612 \strc_itemgroups_setup_list
{
#
levels
}{
#
category
}{
#
options
}
613 \strc_itemgroups_setup_list
{
#
levels
}{
#
category
}{
#
settings
}
614 \fi
615 \else
\ifthirdargument
616 \ifx
\strc_itemgroups_setup_what
\v!each
617 \strc_itemgroups_setup_each
{
#
category
}{
#
options
}
618 \else
619 \strc_itemgroups_setup_list
{
#
levels
}{
#
category
}{
#
options
}
620 \fi
621 \else
\ifsecondargument
622 \strc_itemgroups_setup_each
{
#
category
}{
#
levels
}
623 \else
624 \strc_itemgroups_normal_setup
[#
category
]
625 \fi\fi\fi
}
626
627
628
629
630
631
632
633
634\def
\strc_itemgroups_setup_each
#
category
#
whatever
635 {
\ifcondition
\validassignment
{
#
whatever
}
636 \strc_itemgroups_normal_setup
[#
category
][#
whatever
]
637 \else
638 \strc_itemgroups_normal_setup
[#
category
][
\c!option
=
{
#
whatever
}
]
639 \fi
}
640
641\def
\strc_itemgroups_setup_list_level_a
#
category
#
whatever
#
level
642 {
\strc_itemgroups_normal_setup
[#
category
:
#
level
][#
whatever
]
}
643
644\def
\strc_itemgroups_setup_list_level_b
#
category
#
whatever
#
level
645 {
\strc_itemgroups_normal_setup
[#
category
:
#
level
][
\c!option
=
{
#
whatever
}
]
}
646
647
648
649
650
651
652\def
\strc_itemgroups_setup_list
#
subcategories
#
category
#
whatever
653 {
\ifcondition
\validassignment
{
#
whatever
}
654 \processcommalist
[#
subcategories
]
{
\strc_itemgroups_setup_list_level_a
{
#
category
}{
#
whatever
}}
655 \else
656 \processcommalist
[#
subcategories
]
{
\strc_itemgroups_setup_list_level_b
{
#
category
}{
#
whatever
}}
657 \fi
}
658
659\def
\strc_itemgroups_increment_item_counter
660 {
\ifconditional
\c_strc_itemgroups_sub
\else
661 \ifconditional
\c_strc_itemgroups_symbol
\else
662 \strc_counters_increment_sub
\v_strc_itemgroups_counter
\currentitemlevel
663 \fi
664 \fi
}
665
666\unexpanded
\def
\strc_itemgroups_insert_item_counter
667 {
\ifconditional
\c_strc_itemgroups_repeat
668 \ifcase
\c_strc_itemgroups_nesting
669
670 \or
671 \strc_itemgroups_insert_item_counter_indeed
672 \else
673 \strc_itemgroups_insert_item_counter_indeed
674 \fi
675 \else
676 \strc_itemgroups_insert_item_counter_indeed
677 \fi
}
678
679\def
\strc_itemgroups_insert_item_counter_indeed
680 {
\begingroup
681 \setupcounter
682 [
\v_strc_itemgroups_counter
]
683 [
\c!prefix
=
\itemgroupparameter
\c!prefix
,
684 \c!prefixstopper
=
\itemgroupparameter
\c!prefixstopper
,
685 \c!prefixseparatorset
=
\itemgroupparameter
\c!prefixseparatorset
,
686 \c!prefixconversion
=
\itemgroupparameter
\c!prefixconversion
,
687 \c!prefixconversionset
=
\itemgroupparameter
\c!prefixseparatorset
,
688 \c!prefixset
=
\itemgroupparameter
\c!prefixset
,
689 \c!prefixsegments
=
\itemgroupparameter
\c!prefixsegments
,
690 \c!prefixconnector
=
\itemgroupparameter
\c!prefixconnector
,
691 \c!criterium
=
\itemgroupparameter
\c!criterium
,
692 \c!numberorder
=
\ifconditional
\c_strc_itemgroups_reverse
\v!reverse
\else
\v!normal
\fi
,
693 \c!numberstopper
=
\expdoif
{
\itemgroupparameter
\c!placestopper
}
\v!yes
{
\itemgroupparameter
\c!stopper
}
,
694 \c!numberconversionset
=
\v_strc_itemgroups_counter
,
695 \c!numbersegments
=
\currentitemgroupsegments
]
696
697
698 \normalexpanded
{
\strc_sets_define_conversion_set
[
\v_strc_itemgroups_counter
][
\currentitemgroupconversionset
][
\currentitemgroupsymbol
]
}
699
700 \convertedcounter
[
\v_strc_itemgroups_counter
]
701 \strc_itemgroups_insert_reference
702 \endgroup
}
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734\def
\strc_itemgroups_set_symbol
#
symbol
735 {
\edef
\strc_itemgroups_tmp_symbol
{
#
symbol
}
736 \ifx
\strc_itemgroups_tmp_symbol
\empty
\else
737 \doifelsesymboldefined
\strc_itemgroups_tmp_symbol
738 \strc_itemgroups_set_symbol_symbol
739 {
\doifelseconversiondefined
\strc_itemgroups_tmp_symbol
740 \strc_itemgroups_set_symbol_conversion
741 \donothing
}
742 \fi
}
743
744\def
\strc_itemgroups_set_symbol_symbol
745 {
\let
\currentitemgroupsymbol
\strc_itemgroups_tmp_symbol
746 \strc_itemgroups_store_global_symbol
\currentitemgroupsymbol
747 \strc_itemgroups_store_local_symbol
\v_strc_itemgroups_unknown_symbol
748 \let
\strc_itemgroups_used_symbol
\strc_itemgroups_set_symbol_symbol_item
749 \let
\strc_itemgroups_asked_symbol
\empty
}
750
751\def
\strc_itemgroups_set_symbol_conversion
752 {
\let
\currentitemgroupsymbol
\strc_itemgroups_tmp_symbol
753 \strc_itemgroups_store_global_symbol
\currentitemgroupsymbol
754 \strc_itemgroups_store_local_symbol
\strc_itemgroups_insert_item_counter
755 \let
\strc_itemgroups_used_symbol
\strc_itemgroups_set_symbol_conversion_item
756 \let
\strc_itemgroups_asked_symbol
\empty
}
757
758\def
\strc_itemgroups_set_symbol_symbol_item
759 {
\symbol
[
\currentitemgroupsymbol
]
}
760
761\def
\strc_itemgroups_set_symbol_conversion_item
762 {
\ifconditional
\c_strc_itemgroups_text
763
764 \itemgroupparameter
\c!lefttext
765 \strc_itemgroups_fetch_local_symbol
766 \itemgroupparameter
\c!righttext
767 \else
768 \itemgroupparameter
\c!left
769 \strc_itemgroups_fetch_local_symbol
770 \itemgroupparameter
\c!right
771 \fi
}
772
773\def
\strc_itemgroups_calculate_list_width
#
level
774 {
\let
\savedcurrentitemgroup
\currentitemgroup
775 \edef
\currentitemgroup
{
\currentparentitemgroup
:
\number
#
level
}
776 \ifdim
\d_strc_itemgroups_max_width
>
\zeropoint
777 \d_strc_itemgroups_list_width
\d_strc_itemgroups_max_width
778 \else\ifnum
\itemgroupparameter
\c!factor
>
\zerocount
779 \d_strc_itemgroups_list_width
\itemgroupparameter
\c!step
\relax
780 \ifzeropt
\d_strc_itemgroups_list_width
\d_strc_itemgroups_list_width
=
.
5
em
\fi
781 \multiply
\d_strc_itemgroups_list_width
\itemgroupparameter
\c!factor
782 \advance
\d_strc_itemgroups_list_width
\itemgroupparameter
\c!width
\relax
783 \else
784 \d_strc_itemgroups_list_width
\itemgroupparameter
\c!width
\relax
785 \fi\fi
786 \advance
\d_strc_itemgroups_list_width
\itemgroupparameter
\c!distance
\relax
787 \let
\currentitemgroup
\savedcurrentitemgroup
}
788
789\unexpanded
\def
\startitemgroup
790 {
\dotripleempty
\strc_itemgroups_start
}
791
792\def
\strc_itemgroups_start
[#
category
][#
options
][#
settings
]
793 {
\begingroup
794 \def
\currentitemgroup
{
#
category
}
795 \let
\currentparentitemgroup
\currentitemgroup
796 \global\advance
\c_strc_itemgroups_nesting
\plusone
797 \def
\currentitemlevel
{
\number
\c_strc_itemgroups_nesting
}
798 \normalexpanded
{
\chaintocurrentitemgroup
{
\currentparentitemgroup
:
\currentitemlevel
}}
799 \edef
\currentitemgroup
{
\currentparentitemgroup
:
\currentitemlevel
}
800
801 \ifthirdargument
802 \strc_itemgroups_start_indeed
[#
options
][#
settings
]
803 \else
\ifsecondargument
804 \ifcondition
\validassignment
{
#
options
}
805 \strc_itemgroups_start_indeed
[][#
options
]
806 \else
807 \strc_itemgroups_start_indeed
[#
options
][]
808 \fi
809 \else
810 \strc_itemgroups_start_indeed
[][]
811 \fi\fi
}
812
813\def
\strc_itemgroups_start_indeed
[#
options
][#
settings
]
814 {
\edef
\itemgroupoptions
{
\itemgroupparameter
\c!option
}
815 \edef
\itemgroupextraoptions
{
#
options
}
816 \ifx
\itemgroupoptions
\empty
817 \let
\itemgroupoptions
\itemgroupextraoptions
818 \else\ifx
\itemgroupextraoptions
\empty
819
820 \else
821 \edef
\itemgroupoptions
{
\itemgroupoptions
,
\itemgroupextraoptions
}
822 \fi\fi
823 \begingroup
824 \the
\itemgroupcommands
825 \let
\c_strc_itemgroups_text_saved
\c_strc_itemgroups_text
826 \strc_itemgroups_initialize_local
827 \strc_itemgroups_preset_stage_one
\itemgroupoptions
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842 \iftrialtypesetting
843 \strc_counters_save
\v_strc_itemgroups_counter
844 \fi
845 \c_strc_itemgroups_n_of_items
\zerocount
846 \strc_itemgroups_check_n_of_items
847 \ifx
\itemgroupoptions
\empty
848 \strc_itemgroups_setup_symbol_default
849 \strc_itemgroups_reset_continue_state
850 \setupcurrentitemgroup
[#
settings
]
851 \else
852 \strc_itemgroups_process_options
\itemgroupoptions
853 \setupcurrentitemgroup
[#
settings
]
854 \ifconditional
\c_strc_itemgroups_continue
855 \strc_itemgroups_setup_symbol_continue
856 \strc_itemgroups_fetch_continue_state
857 \else
858 \strc_itemgroups_setup_symbol_asked
859 \strc_itemgroups_store_continue_state
\itemgroupoptions
{
#
settings
}
860 \fi
861 \fi
862
863 \ifhmode
864 \ifconditional
\c_strc_itemgroups_auto_concat
865 \ifdim
\lastskip
=
\d_strc_itemgroups_signal
866 \settrue
\c_strc_itemgroups_concat
867 \fi
868 \fi
869 \ifconditional
\c_strc_itemgroups_text_saved
\else
870 \ifconditional
\c_strc_itemgroups_text
\else
871 \par
872 \fi
873 \fi
874 \fi
875
876 \ifconditional
\c_strc_itemgroups_pack
877 \ifnum
\currentnofitems
>
\itemgroupparameter
\c!packcriterium
\relax\else
878 \setfalse
\c_strc_itemgroups_pack
879 \fi
880 \fi
881
882 \ifnum
\c_strc_itemgroups_nesting
=
\plusone
883 \doadaptleftskip
{
\itemgroupparameter
\c!margin
}
884 \doadaptleftskip
{
\itemgroupparameter
\c!leftmargin
}
885 \doadaptrightskip
{
\itemgroupparameter
\c!rightmargin
}
886 \fi
887
888 \doadaptleftskip
{
\itemgroupparameter
\c!leftmargindistance
}
889 \doadaptrightskip
{
\itemgroupparameter
\c!rightmargindistance
}
890
891 \usealignparameter
\itemgroupparameter
892 \edef
\m_strc_itemgroups_indenting
{
\itemgroupparameter
\c!indenting
}
893 \ifnum
\c_strc_itemgroups_nesting
>
\zerocount
894 \settrue
\c_strc_itemgroups_first
895 \ifconditional
\c_strc_itemgroups_continue
\else
896 \strc_counters_restart_sub
\v_strc_itemgroups_counter
\currentitemlevel
{
\numexpr
\itemgroupparameter
\c!start
\plusone
\relax
}
897 \fi
898 \fi
899 \ifx
\strc_itemgroups_used_symbol
\empty
900 \strc_itemgroups_set_symbol
\strc_itemgroups_asked_symbol
901 \ifx
\strc_itemgroups_used_symbol
\empty
902 \let
\currentitemgroupsymbol
\currentitemlevel
903 \fi
904 \fi
905 \ifconditional
\c_strc_itemgroups_auto_intro
\ifnum
\prevgraf
<
\plusthree
906 \settrue
\c_strc_itemgroups_intro
907 \fi\fi
908 \ifconditional
\c_strc_itemgroups_paragraph
909 \ifnum
\c_strc_itemgroups_nesting
>
\plusone
910 \letitemgroupparameter
\c!inbetween
\empty
911 \fi
912 \fi
913 \ifconditional
\c_strc_itemgroups_pack
914 \letitemgroupparameter
\c!inbetween
\empty
915 \fi
916 \ifconditional
\c_strc_itemgroups_columns
917 \ifinsidecolumns
\else\ifcase
\c_strc_itemgroups_column_depth
918 \global
\c_strc_itemgroups_column_depth
\c_strc_itemgroups_nesting
919 \strc_itemgroups_before_command
920 \strc_itemgroups_tag_start_group
921 \strc_itemgroups_start_columns
922 \fi\fi
923 \fi
924 \ifconditional
\c_strc_itemgroups_fitting
925 \ifdim
\d_strc_itemgroups_max_width
>
\zeropoint
926 \letitemgroupparameter
\c!width
\d_strc_itemgroups_max_width
927 \fi
928 \fi
929 \strc_itemgroups_calculate_list_width
\c_strc_itemgroups_nesting
930 \ifdim
\d_strc_itemgroups_list_width
>
\zeropoint
\relax
931 \ifconditional
\c_strc_itemgroups_inline
\else
932 \advance\leftskip
\d_strc_itemgroups_list_width
\relax
933 \fi
934 \fi
935 \ifx
\m_strc_itemgroups_repeat_start
\empty
936 \let
\currentitemgroupconversionset
\currentitemgroupsymbol
937 \edef
\currentitemgroupsegments
{
\currentitemlevel
}
938 \else
939 \edef
\currentitemgroupconversionset
{
\currentitemgroupconversionset
,
\currentitemgroupsymbol
}
940 \edef
\currentitemgroupsegments
{
\m_strc_itemgroups_repeat_start
:
\currentitemlevel
}
941 \fi
942 \d_strc_itemgroups_asked_width
\itemgroupparameter
\c!width
\relax
943 \startcollectitems
}
944
945\let
\startcollectitems
\relax
946\let
\stopcollectitems
\relax
947
948\letvalue
{
\??itemgroupalign\v!flushleft
}
\relax
949\letvalue
{
\??itemgroupalign\v!right
}
\relax
950\letvalue
{
\??itemgroupalign\v!flushright
}
\hfill
951\letvalue
{
\??itemgroupalign\v!left
}
\hfill
952\letvalue
{
\??itemgroupalign\v!middle
}
\hfil
953\letvalue
{
\??itemgroupalign\v!center
}
\hfil
954
955\def
\strc_itemgroups_left_sym_filler
956 {
\csname
\??itemgroupalign
\itemgroupparameter
\c!symalign
\endcsname
}
957
958
959
960\def
\strc_itemgroups_store_global_symbol
#
symbol
961 {
\letgvalue
{
\??itemgroupglobal
\currentitemlevel
}
#
symbol
}
962
963\def
\strc_itemgroups_store_local_symbol
#
symbol
964 {
\letgvalue
{
\??itemgrouplocal
\currentitemlevel
}
#
symbol
}
965
966\def
\strc_itemgroups_fetch_global_symbol
967 {
\csname
\??itemgroupglobal
\currentitemlevel
\endcsname
}
968
969\def
\strc_itemgroups_fetch_local_symbol
970 {
\csname
\??itemgrouplocal
\currentitemlevel
\endcsname
}
971
972\def
\strc_itemgroups_setup_symbol_default
973 {
\edef
\strc_itemgroups_asked_symbol
{
\itemgroupparameter
\c!symbol
}
974 \strc_itemgroups_store_global_symbol
\empty
}
975
976\def
\strc_itemgroups_setup_symbol_continue
977 {
\ifcsname
\??itemgroupglobal
\currentitemlevel
\endcsname
978 \let
\strc_itemgroups_asked_symbol
\strc_itemgroups_fetch_global_symbol
979 \else
980 \let
\strc_itemgroups_asked_symbol
\currentitemlevel
981 \fi
}
982
983\def
\strc_itemgroups_setup_symbol_asked
984 {
\edef
\strc_itemgroups_asked_symbol
{
\itemgroupparameter
\c!symbol
}}
985
986\ifdefined
\strc_itemgroups_start_columns
987
988
989
990\else
991
992
993
994 \ifdefined
\startcolumns
\else
995 \unexpanded
\def
\startcolumns
[#
settings
]
{}
996 \unexpanded
\def
\stopcolumns
{}
997 \fi
998
999 \def
\strc_itemgroups_start_columns
1000 {
\startcolumns
1001 [
\c!n
=
\itemgroupparameter
\c!n
,
1002 \c!height
=
,
1003 \c!rule
=
\v!off
,
1004 \c!balance
=
\v!yes
,
1005 \c!align
=
\v!no
]
}
1006
1007 \def
\strc_itemgroups_stop_columns
1008 {
\stopcolumns
}
1009
1010\fi
1011
1012\unexpanded
\def
\stopitemgroup
1013 {
\stopcollectitems
1014 \ifconditional
\c_strc_itemgroups_text
1015 \removeunwantedspaces
1016 \space
1017 \ignorespaces
1018 \else
1019 \par
1020 \fi
1021 \strc_itemgroups_register_status
1022 \ifconditional
\c_strc_itemgroups_first
\else
1023 \dostoptagged
1024 \dostoptagged
1025
1026 \fi
1027 \ifnum
\c_strc_itemgroups_column_depth
=
\c_strc_itemgroups_nesting
\relax
1028 \strc_itemgroups_stop_columns
1029 \global
\c_strc_itemgroups_column_depth
\zerocount
1030 \strc_itemgroups_tag_stop_group
1031 \strc_itemgroups_after_command
1032 \dontrechecknextindentation
1033 \else\ifnum
\c_strc_itemgroups_nesting
=
\plusone
1034 \strc_itemgroups_insert_breakallow
1035 \strc_itemgroups_tag_stop_group
1036 \strc_itemgroups_after_command
1037 \useindentnextparameter
\itemgroupparameter
1038 \else
1039
1040 \strc_itemgroups_tag_stop_group
1041 \ifcase
\c_strc_itemgroups_spacing_mode
1042 \strc_itemgroups_after_command
1043 \or
1044 \strc_itemgroups_after_command
1045 \fi
1046 \dontrechecknextindentation
1047 \fi\fi
1048
1049 \iftrialtypesetting
1050 \strc_counters_restore
\v_strc_itemgroups_counter
1051 \fi
1052 \global\advance
\c_strc_itemgroups_nesting
\minusone
1053 \xdef
\currentitemlevel
{
\number
\c_strc_itemgroups_nesting
}
1054
1055 \endgroup
1056 \endgroup
1057
1058
1059
1060
1061
1062 \dorechecknextindentation
}
1063
1064
1065
1066\unexpanded
\def
\startitemgroupitem
1067 {
\dosingleempty
\strc_itemgroups_start_item
}
1068
1069\def
\strc_itemgroups_start_item_first
1070 {
\setfalse
\c_strc_itemgroups_first
1071
1072 \ifcase
\c_strc_itemgroups_nesting
1073
1074 \or
1075 \strc_itemgroups_start_item_first_one
1076 \else
1077 \strc_itemgroups_start_item_first_two
1078 \fi
}
1079
1080\def
\strc_itemgroups_start_item_first_one
1081 {
\ifcase
\c_strc_itemgroups_column_depth
1082 \ifconditional
\c_strc_itemgroups_intro
\strc_itemgroups_insert_breakno
\fi
1083 \strc_itemgroups_before_command
1084 \strc_itemgroups_tag_start_group
1085 \ifconditional
\c_strc_itemgroups_intro
\strc_itemgroups_insert_breakno
\fi
1086 \fi
}
1087
1088\def
\strc_itemgroups_start_item_first_two
1089 {
\ifconditional
\c_strc_itemgroups_paragraph
\else
1090 \edef
\previtemlevel
{
\the\numexpr
\c_strc_itemgroups_nesting
\plusone
}
1091 \ifcase
\c_strc_itemgroups_spacing_mode
1092 \strc_itemgroups_before_command
1093 \or
1094 \doifelsenothing
\strc_itemgroups_before_command
1095 {
\nameditemgroupparameter
{
\currentparentitemgroup
:
\previtemlevel
}
\c!inbetween
}
1096 \strc_itemgroups_before_command
1097 \else
1098 \nameditemgroupparameter
{
\currentparentitemgroup
:
\previtemlevel
}
\c!inbetween
1099 \fi
1100 \strc_itemgroups_tag_start_group
1101 \fi
}
1102
1103\def
\strc_itemgroups_start_item_next
1104 {
\dostoptagged
1105 \dostoptagged
1106 \ifconditional
\c_strc_itemgroups_text
1107 \ifhmode
1108
1109 \strc_itemgroups_set_text_item_distance
1110 \removeunwantedspaces
1111 \hskip
\m_strc_itemgroups_text_distance
\relax
1112 \fi
1113 \else
1114 \strc_itemgroups_between_command
1115 \fi
}
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130\unexpanded
\def
\strc_itemgroups_start_item
[#
reference
]
1131 {
\def
\currentitemreference
{
#
reference
}
1132 \ifconditional
\c_strc_itemgroups_text
1133
1134 \else
1135 \par
1136 \fi
1137 \ifconditional
\c_strc_itemgroups_concat
1138 \strc_itemgroups_insert_breakno
1139 \fi
1140 \strc_itemgroups_increment_item_counter
1141 \ifconditional
\c_strc_itemgroups_first
1142 \strc_itemgroups_start_item_first
1143 \else
1144 \strc_itemgroups_start_item_next
1145 \fi
1146 \ifconditional
\c_strc_itemgroups_concat
1147 \spac_overlay_lines
1148 \setfalse
\c_strc_itemgroups_concat
1149 \fi
1150 \dostarttagged
\t!item
\empty
1151
1152 \dostarttagged
\t!itemtag
\empty
1153 \strc_itemgroups_insert_item
1154 \dostoptagged
1155 \ifconditional
\c_strc_itemgroups_pack
1156 \setupwhitespace
[
\v!none
]
1157 \fi
1158 \itemgroupparameter
\c!inner
1159 \strc_itemgroups_margin_symbol
1160 \let
\strc_itemgroups_margin_symbol
\relax
1161 \dostarttagged
\t!itemcontent
\empty
1162 \begstrut
1163 \nobreak
1164 \seteffectivehsize
1165 \hskip
\d_strc_itemgroups_signal
1166 \itemgroupparameter
\c!command
}
1167
1168\unexpanded
\def
\stopitemgroupitem
1169 {
\ifhmode
1170 \endstrut
1171 \fi
1172 \ifconditional
\c_strc_itemgroups_text
1173
1174 \else
1175 \endgraf
1176 \fi
}
1177\unexpanded
\def
\startitemgrouphead
1178 {
\dosingleempty
\strc_itemgroups_start_head
}
1179
1180\unexpanded
\def
\strc_itemgroups_start_head
[#
reference
]
1181 {
\ifconditional
\c_strc_itemgroups_first
\else
1182 \strc_itemgroups_insert_breakallow
1183 \fi
1184 \ifconditional
\c_strc_itemgroups_pack
\else
1185 \strc_itemgroups_before_head_command
1186 \fi
1187 \ifconditional
\c_strc_itemgroups_first
1188 \ifconditional
\c_strc_itemgroups_intro
\else
1189 \ifcase
\c_strc_itemgroups_nesting
1190 \strc_itemgroups_insert_breakallow
1191 \fi
1192 \fi
1193 \fi
1194 \strc_itemgroups_start_item
[#
reference
]
1195 \pickupgroupedcommand
1196 \strc_itemgroups_start_head_indeed
1197 \strc_itemgroups_stop_head_indeed
1198 \strc_itemgroups_head_body_indeed
}
1199
1200\unexpanded
\def
\stopitemgrouphead
1201 {
\dostoptagged
1202 \stopitemgroupitem
}
1203
1204\unexpanded
\def
\strc_itemgroups_start_head_indeed
1205 {
\settrue
\c_strc_itemgroups_head
1206 \dotagsetitem
\s!head
1207 \dostarttagged
\t!itemhead
\empty
1208 \useitemgroupstyleandcolor
\c!headstyle\c!headcolor
\ignorespaces
}
1209
1210\unexpanded
\def
\strc_itemgroups_stop_head_indeed
1211 {
\removeunwantedspaces
1212 \dostoptagged
1213 \ifconditional
\c_strc_itemgroups_inline_head
1214 \space
1215 \ignorespaces
1216 \else
1217 \ifconditional
\c_strc_itemgroups_text
1218 \space
1219 \ignorespaces
1220 \else
1221 \par
1222 \fi
1223 \strc_itemgroups_insert_breakno
1224 \ifconditional
\c_strc_itemgroups_pack
\else
\strc_itemgroups_after_head_command
\fi
1225 \strc_itemgroups_insert_breakno
1226 \fi
}
1227
1228\unexpanded
\def
\strc_itemgroups_head_body_indeed
1229 {
\dostarttagged
\t!itembody
\empty
1230 \noindentation
1231 \ignorespaces
}
1232
1233
1234
1235\unexpanded
\def
\strc_itemgroups_start_do_item
1236 {
\startitemgroupitem
}
1237
1238\unexpanded
\def
\strc_itemgroups_start_no_item
1239 {
\let
\currentitemreference
\empty
1240 \strc_itemgroups_increment_item_counter
1241
1242 \setbox
\b_strc_itemgroups
\emptyhbox
1243 \strc_itemgroups_check_for_repeated
1244 \ignorespaces
}
1245
1246\unexpanded
\def
\strc_itemgroups_start_button
[#
destination
]
1247 {
\edef
\m_strc_itemgroups_destination
{
#
destination
}
1248 \startitemgroupitem
}
1249
1250\unexpanded
\def
\strc_itemgroups_start_symbol
#
text
1251 {
\def
\strc_itemgroups_extra_symbol
{
#
text
}
1252 \settrue
\c_strc_itemgroups_symbol
1253 \startitemgroupitem
1254 \dotagsetitem
\s!symbol
}
1255
1256\unexpanded
\def
\strc_itemgroups_start_dummy
1257 {
\strc_itemgroups_start_symbol
1258
1259 \begstrut
}
1260
1261\unexpanded
\def
\strc_itemgroups_start_subitem
1262 {
\settrue
\c_strc_itemgroups_sub
1263 \startitemgroupitem
1264 \dotagsetitem
\s!sub
}
1265
1266\unexpanded
\def
\strc_itemgroups_start_edge
#
text
1267 {
\strc_itemgroups_start_symbol
1268 {
\strc_itemgroups_calculate_list_width
\c_strc_itemgroups_nesting
1269 \dostarttagged
\t!ignore
\empty
1270 \hbox
to
\d_strc_itemgroups_list_width
1271 {
#
text
\hskip
\itemgroupparameter
\c!distance
}
1272 \dostoptagged
}}
1273
1274\unexpanded
\def
\strc_itemgroups_start_margin
#
text
1275 {
\def
\strc_itemgroups_margin_symbol
1276 {
\dostarttagged
\t!ignore
\empty
1277 \llap
1278 {
\begingroup
1279 \useitemgroupstyleandcolor
\c!marstyle\c!marcolor
1280 #
text
1281 \endgroup
1282 \hskip\dimexpr\leftskip
\leftmargindistance
\relax
}
1283 \dostoptagged
}
1284 \startitemgroupitem
1285 \dotagsetitem
\s!margin
}
1286
1287\unexpanded
\def
\strc_itemgroups_start_text
#
text
1288 {
\def
\strc_itemgroups_extra_symbol
{
#
text
}
1289 \settrue
\c_strc_itemgroups_symbol
1290 \settrue
\c_strc_itemgroups_txt
1291 \startitemgroupitem
}
1292
1293
1294
1295
1296
1297\unexpanded
\def
\strc_itemgroups_start_items
1298 {
\dosingleempty
\strc_itemgroups_start_items_indeed
}
1299
1300\unexpanded
\def
\strc_itemgroups_start_items_indeed
[#
whatever
]
1301 {
\strc_itemgroups_start_edge
1302 {
\dorecurse
{
0
\itemgroupparameter
\c!items
}{
\strc_itemgroups_used_symbol
\hss
}
1303 \unskip
}}
1304
1305
1306
1307
1308\unexpanded
\def
\startspecialitemgroupitem
[#
name
]
1309 {
\ifcsname
\??itemgroupstart
#
name
\endcsname
1310 \expandafter\lastnamedcs
1311 \else
1312 \expandafter
\strc_itemgroups_start_do_item
1313 \fi
}
1314
1315\unexpanded
\def
\stopspecialitemgroupitem
1316 {
\stopitemgroupitem
}
1317
1318\letvalue
{
\??itemgroupstart\v!item
}
\strc_itemgroups_start_do_item
1319\letvalue
{
\??itemgroupstart\v!sub
}
\strc_itemgroups_start_subitem
1320\letvalue
{
\??itemgroupstart\v!sym
}
\strc_itemgroups_start_symbol
1321\letvalue
{
\??itemgroupstart\v!ran
}
\strc_itemgroups_start_edge
1322\letvalue
{
\??itemgroupstart\v!its
}
\strc_itemgroups_start_items
1323\letvalue
{
\??itemgroupstart\v!mar
}
\strc_itemgroups_start_margin
1324\letvalue
{
\??itemgroupstart\v!txt
}
\strc_itemgroups_start_text
1325
1326\def
\optimizelistitemsbreak
1327 {
\ifcase
\c_strc_itemgroups_column_depth
\ifconditional
\c_strc_itemgroups_optimize
1328 \ifcase
\c_strc_itemgroups_max_items
\else
1329 \ifnum
\c_strc_itemgroups_max_items
=
\plusthree
1330 \ifnum
\c_strc_itemgroups_n_of_items
>
\plusone
1331 \strc_itemgroups_insert_nobreak
1332 \fi
1333 \else\ifnum
\c_strc_itemgroups_max_items
>
\plusthree
1334 \ifnum
\c_strc_itemgroups_n_of_items
=
\plustwo
1335 \ifconditional
\c_strc_itemgroups_intro
1336 \strc_itemgroups_insert_breakno
1337 \else
1338 \strc_itemgroups_insert_nobreak
1339 \fi
1340 \else\ifnum
\c_strc_itemgroups_max_items
=
\c_strc_itemgroups_n_of_items
\relax
1341 \strc_itemgroups_insert_nobreak
1342 \else\ifnum
\c_strc_itemgroups_n_of_items
>
\plustwo
1343 \strc_itemgroups_insert_break
1344 \else
1345 \ifconditional
\c_strc_itemgroups_intro
\else
\strc_itemgroups_insert_break
\fi
1346 \fi\fi\fi
1347 \fi\fi
1348 \fi
1349 \fi\fi
}
1350
1351\def
\strc_itemgroups_handle_text_item
1352 {
\scratchdimen
\wd
\b_strc_itemgroups
1353 \advance
\scratchdimen
\itemgroupparameter
\c!distance
\relax
1354 \ifdim
\scratchdimen
>
\d_strc_itemgroups_list_width
1355 \advance
\scratchdimen
\d_strc_itemgroups_list_width
1356 \else
1357 \scratchdimen
\zeropoint
1358 \fi
1359 \llap
{
\hbox
to
\d_strc_itemgroups_list_width
{
\ifconditional
\c_strc_itemgroups_sub
\llap
{
\enspace
}
\fi\box
\b_strc_itemgroups
\hss
}}
1360 \hskip
\scratchdimen
}
1361
1362\def
\strc_itemgroups_handle_lapped_item_positive
1363 {
\llap
1364 {
\dontcomplain
1365 \hbox
to
\d_strc_itemgroups_list_width
1366 {
\ifconditional
\c_strc_itemgroups_sub
1367 \dostarttagged
\t!ignore
\empty
1368 \llap
{
\enspace
}
1369 \dostoptagged
1370 \fi
1371 \strc_itemgroups_left_sym_filler
1372 \box
\b_strc_itemgroups
1373 \hfil
1374 \hskip
\itemgroupparameter
\c!distance
}}}
1375
1376\def
\strc_itemgroups_handle_lapped_item_negative
1377 {
\llap
1378 {
\ifconditional
\c_strc_itemgroups_sub
1379 \dostarttagged
\t!ignore
\empty
1380 \llap
{
\enspace
}
1381 \dostoptagged
1382 \fi
1383 \box
\b_strc_itemgroups
1384 \hskip
\leftmargindistance
}}
1385
1386\def
\strc_itemgroups_handle_groups_text_item
1387 {
\hbox
1388 {
\ifconditional
\c_strc_itemgroups_sub
1389 \dostarttagged
\t!ignore
\empty
1390 \enspace
1391 \dostoptagged
1392 \fi
1393 \box
\b_strc_itemgroups
1394 \hskip
\interwordspace
}
1395 \nobreak
}
1396
1397\def
\strc_itemgroups_handle_groups_inline_item
1398 {
\hbox
to
\d_strc_itemgroups_list_width
1399 {
\ifconditional
\c_strc_itemgroups_sub
1400 \dostarttagged
\t!ignore
\empty
1401 \llap
{
\enspace
}
1402 \dostoptagged
1403 \fi
1404 \box
\b_strc_itemgroups
1405 \hss
}}
1406
1407\unexpanded
\def
\strc_itemgroups_start_head_sym
#
text
1408 {
\def
\strc_itemgroups_extra_symbol
{
#
text
}
1409 \settrue
\c_strc_itemgroups_symbol
1410 \settrue
\c_strc_itemgroups_head
1411 \strc_itemgroups_start_head
}
1412
1413\def
\strc_itemgroups_make_symbol_box
1414 {
\setbox
\b_strc_itemgroups
\autodirhbox
1415 {
\ifconditional
\c_strc_itemgroups_head
1416 \ifconditional
\c_strc_itemgroups_symbol
1417 \strc_itemgroups_insert_extra_reference
1418 \useitemgroupstyleandcolor
\c!symstyle\c!symcolor
1419 \strc_itemgroups_extra_symbol
1420 \else
1421 \useitemgroupstyleandcolor
\c!headstyle\c!headcolor
1422 \strc_itemgroups_used_symbol
1423 \fi
1424 \else
1425 \ifconditional
\c_strc_itemgroups_symbol
1426 \strc_itemgroups_insert_extra_reference
1427 \useitemgroupstyleandcolor
\c!symstyle\c!symcolor
1428 \strc_itemgroups_extra_symbol
1429 \else
1430 \useitemgroupstyleandcolor
\c!style\c!color
1431 \strc_itemgroups_used_symbol
1432 \fi
1433 \fi
}
1434 \let
\strc_itemgroups_extra_symbol
\empty
1435 \setfalse
\c_strc_itemgroups_symbol
}
1436
1437\def
\strc_itemgroups_make_fitting_box
1438 {
\ifdim
\wd
\b_strc_itemgroups
>
\itemgroupparameter
\c!maxwidth
\relax
1439 \normalexpanded
{
\global
\setitemgroupparameter
{
\c!maxwidth
}{
\the\wd
\b_strc_itemgroups
}}
1440 \fi
1441 \ifdim
\d_strc_itemgroups_max_width
>
\zeropoint
1442 \setbox
\b_strc_itemgroups
\simplealignedbox
1443 {
\dimexpr
\d_strc_itemgroups_max_width
\itemgroupparameter
\c!distance
\relax
}
1444 {
\itemgroupparameter
\c!itemalign
}
1445 {
\box
\b_strc_itemgroups
\hskip
\itemgroupparameter
\c!distance
}
1446 \fi
}
1447
1448\def
\strc_itemgroups_make_aligned_box
1449 {
\doifsomething
{
\itemgroupparameter
\c!itemalign
}
1450 {
\setbox
\b_strc_itemgroups
\simplealignedbox
1451 {
\dimexpr
\d_strc_itemgroups_asked_width
\itemgroupparameter
\c!distance
\relax
}
1452 {
\itemgroupparameter
\c!itemalign
}
1453 {
\box
\b_strc_itemgroups
\hskip
\itemgroupparameter
\c!distance
}}}
1454
1455\def
\strc_itemgroups_make_destination_box
1456 {
\iftrialtypesetting
\else
\ifx
\m_strc_itemgroups_destination
\empty
\else
1457 \setbox
\b_strc_itemgroups
\hbox
{
\directgotobox
{
\box
\b_strc_itemgroups
}
[
\m_strc_itemgroups_destination
]
}
1458 \fi\fi
}
1459
1460\def
\strc_itemgroups_check_indenting
1461 {
\setfalse
\c_strc_itemgroups_indented_first
1462 \ifx
\m_strc_itemgroups_indenting
\empty
\else
1463 \normalexpanded
{
\setupindenting
[
\v!reset
,
\v!yes
,
\m_strc_itemgroups_indenting
]
}
1464 \ifconditional
\c_spac_indentation_indent_first
1465 \doifnot
{
\itemgroupparameter
\c!alignsymbol
}
\v!yes
1466 {
\settrue
\c_strc_itemgroups_indented_first
}
1467 \fi
1468 \fi
}
1469
1470\def
\strc_itemgroups_check_for_repeated
1471 {
\ifconditional
\c_strc_itemgroups_repeat
1472 \ifx
\m_strc_itemgroups_repeat_start
\empty
1473 \edef
\m_strc_itemgroups_repeat_start
{
\currentitemlevel
}
1474 \fi
1475 \else
1476 \let
\m_strc_itemgroups_repeat_start
\empty
1477 \fi
}
1478
1479\def
\strc_itemgroups_insert_item
1480 {
\ifconditional
\c_strc_itemgroups_text
1481
1482 \else
1483 \par
1484 \fi
1485 \advance
\c_strc_itemgroups_n_of_items
\plusone
1486 \optimizelistitemsbreak
1487 \strc_itemgroups_check_indenting
1488 \dontleavehmode
1489 \ifconditional
\c_strc_itemgroups_indented_first
1490 \hskip
\parindent
1491 \fi
1492 \strc_itemgroups_make_symbol_box
1493 \strc_itemgroups_make_destination_box
1494 \ifconditional
\c_strc_itemgroups_fitting
1495 \strc_itemgroups_make_fitting_box
1496 \else\ifdim
\d_strc_itemgroups_asked_width
>
\zeropoint
1497 \strc_itemgroups_make_aligned_box
1498 \fi\fi
1499 \let
\m_strc_itemgroups_destination
\empty
1500 \ht
\b_strc_itemgroups
\strutheight
1501 \dp
\b_strc_itemgroups
\strutdepth
1502 \strc_itemgroups_check_for_repeated
1503 \ifdim
\d_strc_itemgroups_asked_width
<
\zeropoint
\relax
1504 \strc_itemgroups_handle_lapped_item_negative
1505 \else
1506 \ifzeropt
\d_strc_itemgroups_asked_width
1507 \strc_itemgroups_calculate_list_width
\plusone
1508 \else
1509 \strc_itemgroups_calculate_list_width
\c_strc_itemgroups_nesting
1510 \fi
1511 \ifconditional
\c_strc_itemgroups_text
1512 \strc_itemgroups_handle_groups_text_item
1513 \else
\ifconditional
\c_strc_itemgroups_inline
1514 \strc_itemgroups_handle_groups_inline_item
1515 \else
\ifconditional
\c_strc_itemgroups_txt
1516 \strc_itemgroups_handle_text_item
1517 \else
1518 \strc_itemgroups_handle_lapped_item_positive
1519 \fi\fi\fi
1520 \fi
1521 \setfalse
\c_strc_itemgroups_head
1522 \setfalse
\c_strc_itemgroups_sub
1523 \ifconditional
\c_strc_itemgroups_indented_first
1524 \hskip\parindent
1525 \fi
1526 \ignorespaces
}
1527
1528\def
\strc_itemgroups_start_item_nop
1529 {
\let
\currentitemreference
\empty
1530 \strc_itemgroups_increment_item_counter
1531 \advance
\c_strc_itemgroups_n_of_items
\plusone
1532 \setbox
\b_strc_itemgroups
\hbox
1533 {
\useitemgroupstyleandcolor
\c!style\c!color
1534 \strc_itemgroups_used_symbol
}
1535 \strc_itemgroups_check_for_repeated
1536 \ignorespaces
}
1537
1538\setvalue
{
\??itemgroupdistance\v!none
}
1539 {
\let
\m_strc_itemgroups_text_distance
\zeropoint
}
1540
1541\setvalue
{
\??itemgroupdistance\v!space
}
1542 {
\def
\m_strc_itemgroups_text_distance
{
\interwordspace
\!!plus
\interwordstretch
\!!minus
\interwordshrink
}}
1543
1544\setvalue
\??itemgroupdistance
1545 {
\let
\m_strc_itemgroups_text_distance
\zeropoint
}
1546
1547\unexpanded
\def
\strc_itemgroups_set_text_item_distance
1548 {
\edef
\m_strc_itemgroups_text_distance
{
\itemgroupparameter
\c!textdistance
}
1549 \ifx
\m_strc_itemgroups_text_distance
\empty
1550
1551 \else\ifcsname
\??itemgroupdistance
\m_strc_itemgroups_text_distance
\endcsname
1552 \lastnamedcs
1553 \else
1554 \strc_itemgroups_set_text_item_distance_indeed
1555 \fi\fi
}
1556
1557\def
\strc_itemgroups_set_text_item_distance_indeed
1558 {
\assignvalue
1559 \m_strc_itemgroups_text_distance
1560 \m_strc_itemgroups_text_distance
1561 {
.
5
\interwordspace
\!!plus
.
5
\emwidth
}
1562 {
\interwordspace
\!!plus
\emwidth
}
1563 {
\emwidth
\!!plus
\interwordstretch
\!!minus
\interwordshrink
}}
1564
1565
1566
1567
1568
1569\unexpanded
\def
\strc_itemgroups_default_command
1570 {
\ignorespaces
}
1571
1572
1573
1574\unexpanded
\def
\strc_itemgroups_head
#
text
\par
1575 {
\startitemgrouphead
{
#
text
}}
1576
1577
1578
1579\appendtoks
1580 \let
\item
\strc_itemgroups_start_do_item
1581 \let
\sub
\strc_itemgroups_start_subitem
1582 \let
\sym
\strc_itemgroups_start_symbol
1583 \let
\ran
\strc_itemgroups_start_edge
1584 \let
\its
\strc_itemgroups_start_items
1585 \let
\mar
\strc_itemgroups_start_margin
1586 \let
\noitem
\strc_itemgroups_start_no_item
1587 \let
\itm
\strc_itemgroups_start_do_item
1588 \let
\but
\strc_itemgroups_start_button
1589 \let
\nop
\strc_itemgroups_start_dummy
1590 \let
\txt
\strc_itemgroups_start_text
1591 \let
\head
\strc_itemgroups_head
1592 \let
\headsym
\strc_itemgroups_start_head_sym
1593 \let
\startitem
\startitemgroupitem
1594 \let
\stopitem
\stopitemgroupitem
1595 \let
\starthead
\startitemgrouphead
1596 \let
\stophead
\stopitemgrouphead
1597 \let
\startspecialitem
\startspecialitemgroupitem
1598 \let
\stopspecialitem
\stopspecialitemgroupitem
1599\to
\itemgroupcommands
1600
1601\ifx
\currentinterface
\s!english
\else
1602
1603 \def
\next
#
1
#
2
{
\ifcsname
#
1
\endcsname\else\let\csname
#
1
\endcsname
#
2
\fi
}
1604
1605 \etoksapp
\itemgroupcommands
{
1606 \next
{
\v!item
}
\strc_itemgroups_start_do_item
1607 \next
{
\v!sub
}
\strc_itemgroups_start_subitem
1608 \next
{
\v!sym
}
\strc_itemgroups_start_symbol
1609 \next
{
\v!ran
}
\strc_itemgroups_start_edge
1610 \next
{
\v!head
}
\strc_itemgroups_head
1611 \next
{
\v!its
}
\strc_itemgroups_start_items
1612 \next
{
\v!mar
}
\strc_itemgroups_start_margin
1613 \next
{
\v!txt
}
\strc_itemgroups_start_text
1614 \next
{
\e!start\v!item
}
\startitemgroupitem
1615 \next
{
\e!stop
\v!item
}
\stopitemgroupitem
1616 \next
{
\e!start\v!head
}
\startitemgrouphead
1617 \next
{
\e!stop
\v!head
}
\stopitemgrouphead
1618 }
1619
1620\fi
1621
1622\relaxvalueifundefined
\v!item
1623\relaxvalueifundefined
\v!sub
1624\relaxvalueifundefined
\v!sym
1625\relaxvalueifundefined
\v!ran
1626\relaxvalueifundefined
\v!head
1627\relaxvalueifundefined
\v!its
1628\relaxvalueifundefined
\v!mar
1629\relaxvalueifundefined
\v!txt
1630\relaxvalueifundefined
{
\e!start\v!item
}
1631\relaxvalueifundefined
{
\e!stop
\v!item
}
1632\relaxvalueifundefined
{
\e!start\v!head
}
1633\relaxvalueifundefined
{
\e!stop
\v!head
}
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658\newcount
\c_strc_itemgroups_collected_stored
1659\newcount
\c_strc_itemgroups_collected_done
1660\newcount
\c_strc_itemgroups_collected_current
1661
1662
1663
1664
1665
1666\let
\strc_itemgroups_collected_store
\relax
1667
1668\normalexpanded
{
\def
\strc_itemgroups_collected_store
#
1
\csname
\e!stop\v!item
\endcsname
}
1669 {
\advance
\c_strc_itemgroups_collected_stored
\plusone
1670 \setvalue
{
\??itemgroupstack
\number
\c_strc_itemgroups_collected_stored
}{
\startitemgroupitem
#
1
\stopitemgroupitem
}}
1671
1672\def
\strc_itemgroups_collected_flush_randomize
1673 {
\collecteditemgroupitem
}
1674
1675\def
\strc_itemgroups_collected_flush_horizontal
1676 {
\begingroup
1677 \scratchcounter
\itemgroupparameter
\c!n
\relax
1678 \ifnum
\c_strc_itemgroups_collected_done
>
\plusone
1679 \ifcase
\modulonumber\scratchcounter
\c_strc_itemgroups_collected_done
\relax
1680
1681 \hfill
1682 \allowbreak
1683 \fi
1684 \fi
1685 \noindent
1686 \hbox
to
\dimexpr
\availablehsize
\scratchcounter
\relax
{
\collecteditemgroupitem
\hss
}
1687 \endgroup
}
1688
1689
1690
1691
1692
1693
1694
1695\def
\strc_itemgroups_collected_flush_indeed
1696 {
\collecteditemgroupitem
1697 \undefinevalue
{
\??itemgroupstack
\number
\c_strc_itemgroups_collected_current
}}
1698
1699\def
\strc_itemgroups_collected_flush
1700 {
\ifconditional
\c_strc_itemgroups_randomize
1701 \getrandomcount
\c_strc_itemgroups_collected_current
\plusone
\c_strc_itemgroups_collected_stored
1702 \else
1703 \advance
\c_strc_itemgroups_collected_current
\plusone
1704 \fi
1705 \ifcsname
\??itemgroupstack
\number
\c_strc_itemgroups_collected_current
\endcsname
1706 \edef
\collecteditemgroupitem
{
\lastnamedcs
}
1707 \ifconditional
\c_strc_itemgroups_horizontal
1708 \strc_itemgroups_collected_flush_horizontal
1709 \else
1710 \strc_itemgroups_collected_flush_indeed
1711 \fi
1712 \advance
\c_strc_itemgroups_collected_done
\plusone
1713 \fi
1714 \ifnum
\c_strc_itemgroups_collected_done
<
\c_strc_itemgroups_collected_stored
1715 \expandafter
\strc_itemgroups_collected_flush
1716 \fi
}
1717
1718\unexpanded
\def
\stopcollectitems
1719 {
\ifconditional
\c_strc_itemgroups_collecting
1720 \c_strc_itemgroups_collected_done
\zerocount
1721 \c_strc_itemgroups_collected_current
\zerocount
1722 \ifnum
\c_strc_itemgroups_collected_stored
>
\zerocount
1723 \ifconditional
\c_strc_itemgroups_horizontal
1724 \strc_itemgroups_before_command
1725 \setfalse
\c_strc_itemgroups_first
1726 \strc_itemgroups_collected_flush
1727
1728 \else
1729 \strc_itemgroups_collected_flush
1730 \fi
1731 \fi
1732 \fi
}
1733
1734\unexpanded
\def
\startcollectitems
1735 {
\ifconditional
\c_strc_itemgroups_collecting
1736 \c_strc_itemgroups_collected_stored
\zerocount
1737 \letvalue
{
\e!start\v!item
}
\strc_itemgroups_collected_store
1738 \fi
}
1739
1740
1741
1742\unexpanded
\def
\item
1743 {
\strc_itemgroups_item_alone
}
1744
1745\def
\strc_itemgroups_item_alone
[#
category
]#
text
\par
1746 {
\doifelsesomething
{
#
category
}{
\startitemgroup
[#
category
]
}{
\startitemgroup
[
\v!itemize
]
}
1747 \startitem
#
text
\stopitem
1748 \stopitemgroup
}
1749
1750\unexpanded
\def
\head
1751 {
\strc_itemgroups_head_alone
}
1752
1753\def
\strc_itemgroups_head_alone
[#
category
]#
head
\par
#
body
\par
1754 {
\doifelsesomething
{
#
category
}{
\startitemgroup
[#
category
]
}{
\startitemgroup
[
\v!itemize
]
}
1755 \starthead
{
#
head
}
#
body
\stophead
1756 \stopitemgroup
}
1757
1758\setuvalue
{
\e!start\v!item
}
1759 {
\startitemgroup
[
\v!itemize
]
1760 \startitemgroupitem
1761 \setuvalue
{
\e!stop\v!item
}{
\stopitemgroupitem
\stopitemgroup
}}
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775\unexpanded
\def
\itemtag
1776 {
\dosingleempty
\strc_itemgroups_item_tag
}
1777
1778\unexpanded
\def
\strc_itemgroups_item_tag
[#
reference
]
1779 {
\def
\currentitemreference
{
#
reference
}
1780 \iftrialtypesetting
1781 \strc_counters_save
\v_strc_itemgroups_counter
1782 \strc_itemgroups_increment_item_counter
1783 \strc_itemgroups_insert_item_tag_indeed
1784 \strc_counters_restore
\v_strc_itemgroups_counter
1785 \else
1786 \strc_itemgroups_increment_item_counter
1787 \strc_itemgroups_insert_item_tag_indeed
1788 \fi
}
1789
1790\def
\strc_itemgroups_insert_item_tag_indeed
1791 {
\letitemgroupparameter
\c!distance
\zeropoint
1792
1793 \strc_itemgroups_make_symbol_box
1794 \strc_itemgroups_make_destination_box
1795 \let
\m_strc_itemgroups_destination
\empty
1796 \ht
\b_strc_itemgroups
\strutheight
1797 \dp
\b_strc_itemgroups
\strutdepth
1798 \box
\b_strc_itemgroups
1799 \ignorespaces
}
1800
1801
1802
1803\setupitemgroup
1804 [
\c!margin
=
\zeropoint
,
1805 \c!leftmargin
=
\zeropoint
,
1806 \c!rightmargin
=
\zeropoint
,
1807 \c!leftmargindistance
=
\zeropoint
,
1808 \c!rightmargindistance
=
\zeropoint
,
1809 \c!indentnext
=
\v!yes
,
1810 \c!width
=
1
.
5
\emwidth
,
1811 \c!factor
=
0
,
1812
1813 \c!step
=
.
5
\emwidth
,
1814 \c!distance
=
\zeropoint
,
1815
1816
1817
1818
1819
1820 \c!marstyle
=
\v!type
,
1821
1822
1823
1824
1825
1826
1827 \c!symcolor
=
\itemgroupparameter
\c!color
,
1828 \c!symstyle
=
\itemgroupparameter
\c!style
,
1829 \c!afterhead
=
\blank
,
1830 \c!before
=
\blank
,
1831 \c!inbetween
=
\blank
,
1832 \c!after
=
\blank
,
1833
1834 \c!placestopper
=
\v!yes
,
1835 \c!stopper
=
.
,
1836
1837 \c!n
=
2
,
1838 \c!items
=
4
,
1839 \c!levels
=
1
0
,
1840 \c!lefttext
=(
,
1841 \c!righttext
=)
,
1842 \c!start
=
1
,
1843 \c!packcriterium
=
\zerocount
,
1844 \c!criterium
=
\v!all
,
1845
1846 \c!textdistance
=
\v!space
,
1847 \c!command
=
\strc_itemgroups_default_command
,
1848 \c!indenting
=
\v!next
,
1849
1850 \c!symbol
=
\currentitemlevel
,
1851 \c!prefix
=
\v!no
,
1852
1853
1854
1855
1856
1857
1858 \c!prefixconnector
=
.
,
1859 \c!numberseparatorset
=
,
1860 \c!numberconversionset
=
,
1861 \c!numberstopper
=
.
,
1862 \c!numbersegments
=
1
]
1863
1864\defineitemgroup
1865 [
\v!itemize
]
1866
1867
1868
1869
1870
1871
1872
1873\defineitemgroup
1874 [
\v!itemize
:
\v!note
]
1875
1876\def
\strc_itemgroups_push
1877 {
\edef
\strc_itemgroups_pop
1878 {
\xdef\noexpand
\currentitemlevel
{
\currentitemlevel
}
1879 \global
\c_strc_itemgroups_nesting
\the
\c_strc_itemgroups_nesting
\relax
1880 \global
\c_strc_itemgroups_column_depth
\the
\c_strc_itemgroups_column_depth
\relax
}
1881 \global
\c_strc_itemgroups_column_depth
\zerocount
1882 \global
\c_strc_itemgroups_nesting
\zerocount
1883 \glet
\currentitemlevel
\!!zerocount
1884 \unexpanded
\def
\startitemize
{
\startitemgroup
[
\v!itemize
:
\v!note
]
}
1885 \unexpanded
\def
\stopitemize
{
\stopitemgroup
}}
1886
1887\let
\strc_itemgroups_pop
\relax
1888
1889\protect
\endinput
1890