1
2
3
4
5
6
7
8
9
10
11
12
13
14\writestatus{loading}{ConTeXt Table Macros Tabulation}
15
16\unprotect
17
18
19
20\newinteger\c_tabl_tabulate_nofcolumns
21\newinteger\c_tabl_tabulate_has_rule_spec_first
22\newinteger\c_tabl_tabulate_has_rule_spec_last
23
24\registerctxluafile{tabltbl}{autosuffix}
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\newtoks \t_tabl_tabulate_preamble
156\newtoks \t_tabl_tabulate_before
157\newtoks \t_tabl_tabulate_after
158\newtoks \t_tabl_tabulate_bmath
159\newtoks \t_tabl_tabulate_emath
160\newtoks \t_tabl_tabulate_font
161\newtoks \t_tabl_tabulate_settings
162\newtoks \t_tabl_tabulate_dummy
163\newtoks \t_tabl_tabulate_every_row
164\newtoks \t_tabl_tabulate_every_after_row
165\newtoks \t_tabl_tabulate_every_real_row
166
167\newtoks \t_tabl_tabulate_initializers_first
168\newtoks \t_tabl_tabulate_initializers_second
169
170\newinteger \c_tabl_tabulate_nofauto
171\newinteger \c_tabl_tabulate_columns
172\newinteger \c_tabl_tabulate_column
173\newinteger \c_tabl_tabulate_plines_min
174\newinteger \c_tabl_tabulate_plines_max
175\newinteger \c_tabl_tabulate_max_colorcolumn
176\newinteger \c_tabl_tabulate_max_vrulecolumn
177\newinteger \c_tabl_tabulate_repeathead
178\newinteger \c_tabl_tabulate_noflines
179\newinteger \c_tabl_tabulate_totalnoflines
180\newinteger \c_tabl_tabulate_minusnoflines
181\newinteger \c_tabl_tabulate_align
182\newinteger \c_tabl_tabulate_nofrealrows
183\newinteger \c_tabl_tabulate_autocolor
184
185\newconditional \c_tabl_tabulate_nopbreak
186\newconditional \c_tabl_tabulate_firstflushed
187\newconditional \c_tabl_tabulate_equal
188\newconditional \c_tabl_tabulate_split
189\newconditional \c_tabl_tabulate_automode
190\newconditional \c_tabl_tabulate_handlepbreak
191\newconditional \c_tabl_tabulate_autorulespacing
192\newconditional \c_tabl_tabulate_someamble
193\newconditional \c_tabl_tabulate_tolerant_break
194\newconditional \c_tabl_tabulate_splitoff_whitespace
195\newconditional \c_tabl_tabulate_pwidth_set
196\newconditional \c_tabl_tabulate_reshape
197\newconditional \c_tabl_tabulate_no_blank_in_paragraphs
198\newconditional \c_tabl_tabulate_no_interline_space
199
200\c_tabl_tabulate_split \conditionaltrue
201\c_tabl_tabulate_handlepbreak \conditionaltrue
202\c_tabl_tabulate_autorulespacing \conditionaltrue
203\c_tabl_tabulate_no_blank_in_paragraphs\conditionaltrue
204
205\newdimension \d_tabl_tabulate_width_p
206\newdimension \d_tabl_tabulate_width_w
207\newdimension \d_tabl_tabulate_width
208\newdimension \d_tabl_tabulate_unit
209\newdimension \d_tabl_tabulate_height_p_max
210\newdimension \d_tabl_tabulate_vrulethickness_default
211\newdimension \d_tabl_tabulate_hrulethickness_default
212\newdimension \d_tabl_tabulate_vrulethickness
213\newdimension \d_tabl_tabulate_hrulethickness
214\newdimension \d_tabl_tabulate_vrulethickness_local
215\newdimension \d_tabl_tabulate_hrulethickness_local
216\newdimension \d_tabl_tabulate_indent
217\newdimension \d_tabl_tabulate_splitoff_betweenskip
218\newdimension \d_tabl_tabulate_margin
219
220\newgluespec \s_tabl_tabulate_pre
221\newgluespec \s_tabl_tabulate_post
222\newgluespec \s_tabl_tabulate_first
223\newgluespec \s_tabl_tabulate_last
224\newgluespec \s_tabl_tabulate_separator
225
226\newbox \b_tabl_tabulate
227
228\newconstant \c_tabl_tabulate_pass
229\newconstant \c_tabl_tabulate_type
230\newconstant \c_tabl_tabulate_kind
231\newconstant \c_tabl_tabulate_splitlinemode \c_tabl_tabulate_splitlinemode\plustwo
232\newconstant \c_tabl_tabulate_colorspan
233\newconstant \c_tabl_tabulate_localcolorspan
234\newconstant \c_tabl_tabulate_modus
235
236
237\newconditional \c_tabl_post_is_set
238
239\lettonothing \m_tabl_tabulate_separator_factor
240
241\aliasinteger\tabulatesplitlinemode\c_tabl_tabulate_splitlinemode
242
243\newtoks \everytabulatepar
244\newtoks \everytabulate
245
246\permanent\protected\def\tolerantTABLEbreaktrue{\c_tabl_tabulate_tolerant_break\conditionaltrue}
247
248\permanent\def\noftabulaterows{\the\c_tabl_tabulate_noflines}
249
250\installcorenamespace{tabulatebox}
251\installcorenamespace{tabulatesetup}
252\installcorenamespace{tabulatehook}
253\installcorenamespace{tabulatesplit}
254\installcorenamespace{tabulateseparator}
255\installcorenamespace{tabulatecolor}
256\installcorenamespace{tabulateheader}
257\installcorenamespace{tabulatealigning}
258\installcorenamespace{tabulatepreamble}
259\installcorenamespace{tabulatevrule}
260
261\installcorenamespace{tabulatehead}
262\installcorenamespace{tabulatefoot}
263\installcorenamespace{tabulatenext}
264
265\prependtoks
266 \global\c_tabl_tabulate_nofrealrows\zerocount
267\to \t_tabl_tabulate_initializers_first
268
269\prependtoks
270 \global\c_tabl_tabulate_nofrealrows\zerocount
271\to \t_tabl_tabulate_initializers_second
272
273\prependtoks
274 \global\advanceby\c_tabl_tabulate_nofrealrows\plusone
275\to \t_tabl_tabulate_every_real_row
276
277\permanent\def\b_tabl_tabulate_current#1
278 {\csname\??tabulatebox\number#1\endcsname}
279
280\def\tabl_tabulate_initialize_boxes#1
281 {\scratchcounter#1\relax
282 \tabl_tabulate_initialize_boxes_step}
283
284\def\tabl_tabulate_initialize_boxes_step
285 {\ifnum\scratchcounter>\zerocount
286 \tabl_tabulate_initialize_box\scratchcounter
287 \advanceby\scratchcounter\minusone
288 \expandafter\tabl_tabulate_initialize_boxes_step
289 \fi}
290
291\def\tabl_tabulate_initialize_box#1
292 {\ifcsname\??tabulatebox\number#1\endcsname
293 \tabl_tabulate_initialize_box_yes
294 \else
295 \tabl_tabulate_initialize_box_nop#1
296 \fi}
297
298\def\tabl_tabulate_initialize_box_yes {\global\setbox\lastnamedcs\emptybox}
299\def\tabl_tabulate_initialize_box_nop#1{\expandafter\newbox\csname\??tabulatebox\number#1\endcsname}
300
301\tabl_tabulate_initialize_boxes{16}
302
303
304
305
306
307
308
309
310\def\tabl_tabulate_nobreak_inject_tracer
311 {\red
312 \hrule\s!height.5\linewidth\s!depth.5\linewidth
313 \par
314 \kern\linewidth
315 \tabl_tabulate_break_no}
316
317\installtextracker
318 {tables.tabulate.breaks}
319 {\let\tabl_tabulate_break_no_tracer\tabl_tabulate_nobreak_inject_tracer}
320 {\let\tabl_tabulate_break_no_tracer\donothing}
321
322\let\tabl_tabulate_break_no_tracer\donothing
323
324\def\tabl_tabulate_nobreak_inject_indeed
325 {\tabl_tabulate_break_no
326 \tabl_tabulate_break_no_tracer}
327
328\def\tabl_tabulate_nobreak_inject
329 {\noalign{\tabl_tabulate_nobreak_inject_indeed}}
330
331\protected\def\tabl_tabulate_hook_check
332 {\ifnum\c_tabl_tabulate_type<\plustwo
333 \glet\tabl_tabulate_hook\tabl_tabulate_hook_nop
334 \else
335 \glet\tabl_tabulate_hook\tabl_tabulate_hook_yes
336 \fi}
337
338\protected\def\tabl_tabulate_setups_check
339 {\begincsname\??tabulatesetup\the\c_tabl_tabulate_column\endcsname}
340
341\let\tabl_tabulate_kooh\relax
342
343\protected\def\tabl_tabulate_entry_before{\ignorespaces\tabl_tabulate_hook}
344\protected\def\tabl_tabulate_entry_after {\unskip\unskip\ifmmode\else\endgraf\fi\tabl_tabulate_kooh}
345
346\protected\def\tabl_tabulate_shaped_par_begin
347 {\dowithnextboxcs\tabl_tabulate_shaped_par_finish\vbox\bgroup}
348
349\def\tabl_tabulate_shaped_par_finish
350 {\clf_doreshapeframedbox\nextbox\relax
351 \ifvmode\unvbox\else\box\fi\nextbox}
352
353\let\tabl_tabulate_shaped_par_end\egroup
354
355\ifdefined\dotagtabulatecell \else \aliased\let\dotagtabulatecell \relax \fi
356\ifdefined\dotagtabulatesignal \else \aliased\let\dotagtabulatesignal\relax \fi
357
358\protected\def\tabl_tabulate_check_local_color_first#1#2
359 {\relax}
360
361\protected\def\tabl_tabulate_check_local_color_second#1#2
362 {\relax
363 \ifempty\m_tabl_tabulate_color_local
364 \xdef\m_tabl_tabulate_color{#1}
365 \else
366 \glet\m_tabl_tabulate_color\m_tabl_tabulate_color_local
367 \glettonothing\m_tabl_tabulate_color_local
368 \fi
369 \ifcase\c_tabl_tabulate_localcolorspan
370 \global\c_tabl_tabulate_colorspan#2\relax
371 \else
372 \global\c_tabl_tabulate_colorspan\c_tabl_tabulate_localcolorspan
373 \global\c_tabl_tabulate_localcolorspan\zerocount
374 \fi}
375
376\protected\def\tabl_tabulate_check_local_vrule_thickness#1
377 {\relax
378 \ifcase\d_tabl_tabulate_vrulethickness_local
379 \global\d_tabl_tabulate_vrulethickness#1\relax
380 \else
381 \global\d_tabl_tabulate_vrulethickness\d_tabl_tabulate_vrulethickness_local
382 \global\d_tabl_tabulate_vrulethickness_local\zeropoint
383 \fi}
384
385\protected\def\tabl_tabulate_check_local_vrule_color_first#1
386 {\relax}
387
388\protected\def\tabl_tabulate_check_local_vrule_color_second#1
389 {\relax
390 \ifempty\m_tabl_tabulate_vrule_color_local
391 \xdef\m_tabl_tabulate_vrule_color{#1}
392 \else
393 \glet\m_tabl_tabulate_vrule_color\m_tabl_tabulate_vrule_color_local
394 \glettonothing\m_tabl_tabulate_vrule_color_local
395 \fi}
396
397\let\tabl_tabulate_check_local_color \gobbletwoarguments
398\let\tabl_tabulate_check_local_vrule_color\gobbleoneargument
399
400\appendtoks
401 \let\tabl_tabulate_check_local_color \tabl_tabulate_check_local_color_first
402 \let\tabl_tabulate_check_local_vrule_color\tabl_tabulate_check_local_vrule_color_first
403\to \t_tabl_tabulate_initializers_first
404
405\appendtoks
406 \let\tabl_tabulate_check_local_color \tabl_tabulate_check_local_color_second
407 \let\tabl_tabulate_check_local_vrule_color\tabl_tabulate_check_local_vrule_color_second
408\to \t_tabl_tabulate_initializers_second
409
410
411\def\tabl_tabulate_inject_pre_skip#1
412 {\ifdim#1>\zeropoint
413 \kern#1\relax
414 \orelse\ifzero\c_tabl_tabulate_column
415 \ifconditional\c_tabl_tabulate_autorulespacing
416 \ifcase\c_tabl_tabulate_has_rule_spec_first\else
417 \kern\s_tabl_tabulate_first\relax
418 \fi
419 \fi
420 \fi}
421
422
423\def\tabl_tabulate_inject_post_skip#1#2
424 {\ifdim#1>\zeropoint
425 \kern\ifnum\c_tabl_tabulate_columns=\c_tabl_tabulate_nofcolumns#2\else#1\fi\relax
426 \orelse\ifnum\c_tabl_tabulate_columns=\c_tabl_tabulate_nofcolumns
427 \ifconditional\c_tabl_tabulate_autorulespacing
428 \ifcase\c_tabl_tabulate_has_rule_spec_last\else
429 \kern\s_tabl_tabulate_last\relax
430 \fi
431 \fi
432 \fi}
433
434\let\tabl_tabulate_hook_b\donothing
435\let\tabl_tabulate_hook_e\donothing
436\let\tabl_tabulate_hook_g\donothing
437\let\tabl_tabulate_hook_G\donothing
438
439\newconditional\c_tabl_use_size
440\newconditional\c_tabl_sparse_skips
441
442\c_tabl_use_size \conditionaltrue
443\c_tabl_sparse_skips\conditionaltrue
444
445
446
447
448\def\tabl_tabulate_tag_start
449 {\dostarttaggedchained\t!tabulate\empty\??tabulation}
450
451\def\tabl_tabulate_tag_start_row
452 {\dostarttagged\t!tabulaterow\empty}
453
454\def\tabl_tabulate_tag_start_cell
455 {\dostarttagged\t!tabulatecell\empty
456 \dotagtabulatecell}
457
458\def\tabl_tabulate_tag_stop
459 {\dostoptagged}
460
461\def\tabl_tabulate_tag_stop_row
462 {\dostoptagged}
463
464\def\tabl_tabulate_tag_stop_cell
465 {\dostoptagged}
466
467\noaligned\def\tabl_tabulate_disable_tagging
468 {\lettonothing\tabl_tabulate_tag_start
469 \lettonothing\tabl_tabulate_tag_start_row
470 \lettonothing\tabl_tabulate_tag_start_cell
471 \lettonothing\tabl_tabulate_tag_stop
472 \lettonothing\tabl_tabulate_tag_stop_row
473 \lettonothing\tabl_tabulate_tag_stop_cell}
474
475\def\tabl_tabulate_set_preamble_step#1#2
476 {\etoksapp\t_tabl_tabulate_preamble{
477
478 \tabl_tabulate_check_local_vrule_thickness\constantdimenargument\d_tabl_tabulate_vrulethickness
479 \tabl_tabulate_check_local_vrule_color\constantemptyargument\m_tabl_tabulate_vrule_color
480 \tabl_tabulate_check_local_color\constantemptyargument\m_tabl_tabulate_color\constantnumberargument\c_tabl_tabulate_colorspan
481 \tabl_tabulate_color_side_right
482
483 \aligntab
484
485 \tabl_tabulate_column_vrule_inject
486 \tabl_tabulate_color_side_left
487 \tabl_tabulate_inject_pre_skip{\the\dimexpr\s_tabl_tabulate_pre}
488 \aligncontent
489
490 \ifconditional\c_tabl_use_size
491 \tabsize\zeropoint
492 \fi
493 \aligntab
494
495 \tabl_tabulate_color_side_both
496 \global\c_tabl_tabulate_colorspan\zerocount
497 \global\c_tabl_tabulate_column\constantnumber\c_tabl_tabulate_columns
498 \tabl_tabulate_hook_g
499 \tabl_tabulate_anchor
500 \tabl_tabulate_setups_check
501 \tabl_tabulate_hook_check
502 \ifzeropt\d_tabl_tabulate_width
503 \ifcase\c_tabl_tabulate_modus\else
504 \c_tabl_tabulate_automode\conditionaltrue
505 \fi
506 \else
507 \ifcase\c_tabl_tabulate_modus
508 \ifconditional\c_tabl_use_size
509 \tabsize
510 \else
511 \hbox to
512 \fi
513 \else
514 \hsize
515 \fi
516 \the\d_tabl_tabulate_width
517 \fi
518 \bgroup
519 \tabl_tabulate_bbskip
520 \bgroup
521 \tabl_tabulate_hook_b
522 \c_tabl_tabulate_align\constantnumber\c_tabl_tabulate_align
523 \ifempty\m_tabl_tabulate_alignment \else
524 \spac_align_use_now{\m_tabl_tabulate_alignment}
525 \fi
526 \noexpand\tabl_tabulate_tag_start_cell
527 \noexpand#1
528 \ifconditional\c_tabl_tabulate_reshape
529 \tabl_tabulate_shaped_par_begin
530 \fi
531 \dotagtabulatesignal
532 \noexpand\ifnum\noexpand\c_tabl_tabulate_type=\plusone\noexpand\else
533 \the\t_tabl_tabulate_bmath
534 \the\t_tabl_tabulate_font
535 \the\t_tabl_tabulate_settings
536 \the\t_tabl_tabulate_before
537 \ifempty\m_tabl_tabulate_text_color
538 \expandafter\gobbleoneargument
539 \else
540 \expandafter\colo_helpers_direct_activate
541 \fi\m_tabl_tabulate_text_color
542 \noexpand\fi
543
544
545 \bgroup
546 \tabl_tabulate_hook_G
547 \tabl_tabulate_entry_before
548 \tabl_tabulate_hook_box_begin
549 \aligncontent
550 \tabl_tabulate_hook_box_end
551 \tabl_tabulate_entry_after
552 \egroup
553 \noexpand\ifnum\noexpand\c_tabl_tabulate_type=\plusone\noexpand\else
554 \the\t_tabl_tabulate_after
555 \the\t_tabl_tabulate_emath
556 \noexpand\fi
557 \ifconditional\c_tabl_tabulate_reshape
558 \tabl_tabulate_shaped_par_end
559 \else
560 \fi
561 \noexpand#2
562 \tabl_tabulate_hook_e
563 \egroup
564 \egroup
565
566 \aligntab
567 \ifconditional\c_tabl_use_size
568 \tabsize\zeropoint
569 \fi
570
571 \noexpand\tabl_tabulate_tag_stop_cell
572 \tabl_tabulate_inject_post_skip
573 {\the\ifconditional\c_tabl_post_is_set\s_tabl_tabulate_post\else\s_tabl_tabulate_last\fi}
574 {\the\s_tabl_tabulate_post}
575 \aligncontent
576
577 }
578 \toksapp\t_tabl_tabulate_dummy{\NC}
579 \s_tabl_tabulate_pre.5\d_tabl_tabulate_unit\relax
580 \ifnum\c_tabl_tabulate_columns<\numexpr\c_tabl_tabulate_nofcolumns\plusone\relax
581 \s_tabl_tabulate_post\s_tabl_tabulate_pre
582 \else
583 \s_tabl_tabulate_post\zeroskip
584 \fi
585
586 \d_tabl_tabulate_width\zeropoint
587
588 \c_tabl_post_is_set\conditionalfalse}
589
590\permanent\protected\def\installtabulatepreambleoption#1#2
591 {\defcsname\??tabulatepreamble\string#1\endcsname{#2}}
592
593\installtabulatepreambleoption{x}{\c_tabl_tabulate_align\zerocount
594 \tabl_tabulate_set_preamble}
595\installtabulatepreambleoption{l}{\c_tabl_tabulate_align\plusone
596 \tabl_tabulate_set_preamble}
597\installtabulatepreambleoption{r}{\c_tabl_tabulate_align\plustwo
598 \tabl_tabulate_set_preamble}
599\installtabulatepreambleoption{c}{\c_tabl_tabulate_align\plusthree
600 \tabl_tabulate_set_preamble}
601\installtabulatepreambleoption{p}{\tabl_tabulate_set_paragraph}
602\installtabulatepreambleoption{s}{\tabl_tabulate_set_setups}
603\installtabulatepreambleoption{w}{\tabl_tabulate_set_width}
604\installtabulatepreambleoption{f}{\tabl_tabulate_set_font}
605\installtabulatepreambleoption{B}{\t_tabl_tabulate_font{\bf}
606 \tabl_tabulate_set_preamble}
607\installtabulatepreambleoption{I}{\t_tabl_tabulate_font{\it}
608 \tabl_tabulate_set_preamble}
609\installtabulatepreambleoption{S}{\t_tabl_tabulate_font{\sl}
610 \tabl_tabulate_set_preamble}
611\installtabulatepreambleoption{T}{\t_tabl_tabulate_font{\tt}
612 \tabl_tabulate_set_preamble}
613\installtabulatepreambleoption{R}{\t_tabl_tabulate_font{\rm}
614 \tabl_tabulate_set_preamble}
615\installtabulatepreambleoption{m}{\t_tabl_tabulate_bmath{\normalstartimath}
616 \t_tabl_tabulate_emath{\normalstopimath}
617 \tabl_tabulate_set_preamble}
618\installtabulatepreambleoption{M}{\t_tabl_tabulate_bmath{\normalstartimath\forcedisplaymath}
619 \t_tabl_tabulate_emath{\normalstopimath}
620 \tabl_tabulate_set_preamble}
621\installtabulatepreambleoption{h}{\tabl_tabulate_set_hook}
622\installtabulatepreambleoption{b}{\tabl_tabulate_set_before}
623\installtabulatepreambleoption{a}{\tabl_tabulate_set_after}
624\installtabulatepreambleoption{i}{\tabl_tabulate_set_preskip}
625\installtabulatepreambleoption{j}{\tabl_tabulate_set_posskip}
626\installtabulatepreambleoption{k}{\tabl_tabulate_set_preposskip}
627\installtabulatepreambleoption{e}{\toksapp\t_tabl_tabulate_settings{\global\c_tabl_tabulate_equal\conditionaltrue}
628 \tabl_tabulate_set_preamble}
629\installtabulatepreambleoption{g}{\tabl_tabulate_set_align}
630\installtabulatepreambleoption{G}{\tabl_tabulate_set_align_new}
631\installtabulatepreambleoption{.}{\tabl_tabulate_set_align.}
632\installtabulatepreambleoption{,}{\tabl_tabulate_set_align,}
633\installtabulatepreambleoption{C}{\tabl_tabulate_set_color_span}
634\installtabulatepreambleoption{d}{\toksapp\t_tabl_tabulate_settings{\fixedspaces}
635 \tabl_tabulate_set_preamble}
636\installtabulatepreambleoption{ }{\tabl_tabulate_set_preamble}
637\installtabulatepreambleoption{A}{\tabl_tabulate_set_alignment}
638
639
640
641
642
643
644
645
646
647
648
649
650
651\installtabulatepreambleoption\relax
652 {}
653
654\def\tabl_tabulate_set_preamble#1
655 {\ifcsname\??tabulatepreamble\string#1\endcsname
656 \expandafter\expandafter\expandafter\lastnamedcs\expandafter\gobbleoneargument
657 \else
658 \expandafter\tabl_tabulate_set_preamble_nop
659 \fi{#1}}
660
661\def\tabl_tabulate_set_preamble_yes#1
662 {\csname\??tabulatepreamble\string#1\expandafter\endcsname}
663
664\def\tabl_tabulate_set_preamble_nop#1
665 {\writestatus{tabulate}{unknown preamble key: #1}
666 \tabl_tabulate_set_preamble}
667
668\def\tabl_tabulate_set_preskip#1
669 {
670 \doifelsenumber{#1}
671 {\s_tabl_tabulate_pre#1\d_tabl_tabulate_unit\tabl_tabulate_set_preamble }
672 {\s_tabl_tabulate_pre.5\d_tabl_tabulate_unit\tabl_tabulate_set_preamble#1}}
673
674\def\tabl_tabulate_set_posskip#1
675 {\c_tabl_post_is_set\conditionaltrue
676 \doifelsenumber{#1}
677 {\s_tabl_tabulate_post#1\d_tabl_tabulate_unit\tabl_tabulate_set_preamble }
678 {\s_tabl_tabulate_post.5\d_tabl_tabulate_unit\tabl_tabulate_set_preamble#1}}
679
680\def\tabl_tabulate_set_preposskip#1
681 {
682 \c_tabl_post_is_set\conditionaltrue
683 \doifelsenumber{#1}
684 {\s_tabl_tabulate_pre#1\d_tabl_tabulate_unit\s_tabl_tabulate_post\s_tabl_tabulate_pre\tabl_tabulate_set_preamble }
685 {\s_tabl_tabulate_pre.5\d_tabl_tabulate_unit\s_tabl_tabulate_post\s_tabl_tabulate_pre\tabl_tabulate_set_preamble#1}}
686
687\def\tabl_tabulate_set_setups#1
688 {\defcsname\??tabulatesetup\the\c_tabl_tabulate_columns\endcsname{\setups[#1]}
689 \tabl_tabulate_set_preamble}
690
691\def\tabl_tabulate_set_hook#1
692 {\defcsname\??tabulatehook\the\c_tabl_tabulate_columns\endcsname{#1}
693 \tabl_tabulate_set_preamble}
694
695
696
697\newconditional\c_tabl_auto_align_mode
698\newconditional\c_tabl_auto_align_mode_new
699
700\def\tabl_tabulate_hook_g
701 {\ifconditional\c_tabl_auto_align_mode
702 \signalcharacteralign\c_tabl_tabulate_column{\c_tabl_tabulate_noflines\plusone}
703 \typo_charalign_adapt_font
704 \fi}
705
706\def\tabl_tabulate_hook_G
707 {\ifconditional\c_tabl_auto_align_mode_new
708 \typo_charalign_adapt_font
709 \attribute\aligncharacterattribute\the\attribute\aligncharacterattribute\relax
710 \else
711 \attribute\aligncharacterattribute\attributeunsetvalue
712 \fi}
713
714\def\tabl_tabulate_set_align#1
715 {\global\c_tabl_auto_align_mode\conditionaltrue
716 \setcharacteralign\c_tabl_tabulate_columns{#1}
717 \tabl_tabulate_set_preamble}
718
719\def\tabl_tabulate_set_align_new#1
720 {\global\c_tabl_auto_align_mode_new\conditionaltrue
721 \ifempty{#1}\else\setalignmentcharacter{#1}\fi
722 \tabl_tabulate_set_preamble}
723
724
725
726\def\tabl_tabulate_set_before#1
727 {\t_tabl_tabulate_before{#1}
728 \tabl_tabulate_set_preamble}
729
730\def\tabl_tabulate_set_after#1
731 {\t_tabl_tabulate_after{#1}
732 \tabl_tabulate_set_preamble}
733
734\def\tabl_tabulate_set_font#1
735 {\t_tabl_tabulate_font{#1}
736 \tabl_tabulate_set_preamble}
737
738\def\tabl_tabulate_pickup_width
739 {\doifelsenextparenthesis\tabl_tabulate_set_width_indeed\tabl_tabulate_set_preamble}
740
741\def\tabl_tabulate_set_width
742 {\c_tabl_tabulate_pwidth_set\conditionalfalse
743 \c_tabl_tabulate_modus\zerocount
744 \tabl_tabulate_pickup_width}
745
746\def\tabl_tabulate_set_alignment#1
747 {\edef\m_tabl_tabulate_alignment{#1}
748 \spac_align_use_later\m_tabl_tabulate_alignment
749 \tabl_tabulate_set_preamble}
750
751\def\tabl_tabulate_set_paragraph
752 {\doifelsenextparenthesis
753 {\c_tabl_tabulate_modus\plusone
754 \c_tabl_tabulate_pwidth_set\conditionaltrue
755 \tabl_tabulate_pickup_width}
756 {\c_tabl_tabulate_modus\plustwo
757 \c_tabl_tabulate_pwidth_set\conditionalfalse
758 \tabl_tabulate_set_preamble}}
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805\installcorenamespace{tabulatewidth}
806
807\defcsname\??tabulatewidth\v!fit\endcsname
808 {\c_tabl_tabulate_modus\plusthree}
809
810\defcsname\??tabulatewidth\v!fixed\endcsname
811 {\c_tabl_tabulate_modus\plusthree
812 \c_tabl_tabulate_nopbreak\conditionaltrue}
813
814\defcsname\??tabulatewidth\v!packed\endcsname
815 {\c_tabl_tabulate_no_interline_space\conditionaltrue}
816
817\defcsname\??tabulatewidth\v!auto\endcsname
818 {\c_tabl_tabulate_modus\plusthree\c_tabl_tabulate_reshape\conditionaltrue}
819
820\lettonothing\tabl_tabulate_hook_box
821\lettonothing\tabl_tabulate_hook_box_begin
822\lettonothing\tabl_tabulate_hook_box_end
823
824\defcsname\??tabulatewidth\v!top\endcsname
825 {\def\tabl_tabulate_hook_box_begin{\vtop\bgroup\begstrut}
826 \def\tabl_tabulate_hook_box_end {\endstrut\egroup}}
827
828\defcsname\??tabulatewidth\v!bottom\endcsname
829 {\def\tabl_tabulate_hook_box_begin{\vbox\bgroup\begstrut}
830 \def\tabl_tabulate_hook_box_end {\endstrut\egroup}}
831
832\def\tabl_tabulate_set_width_step#1
833 {\ifcsname\??tabulatewidth#1\endcsname
834 \lastnamedcs
835 \else
836 \d_tabl_tabulate_width#1\relax
837 \fi}
838
839\def\tabl_tabulate_set_width_indeed(#1)
840 {\rawprocesscommacommand[#1]\tabl_tabulate_set_width_step
841 \ifconditional\c_tabl_tabulate_pwidth_set
842 \global\advanceby\d_tabl_tabulate_width_p\d_tabl_tabulate_width
843 \fi
844 \tabl_tabulate_set_preamble}
845
846
847
848\def\tabl_tabulate_set_raggedright {\ifnum\c_tabl_tabulate_type=\plusone \else\raggedright \fi}
849\def\tabl_tabulate_set_raggedcenter{\ifnum\c_tabl_tabulate_type=\plusone \else\raggedcenter\fi}
850\def\tabl_tabulate_set_raggedleft {\ifnum\c_tabl_tabulate_type=\plusone \else\raggedleft \fi}
851\def\tabl_tabulate_set_notragged {\ifnum\c_tabl_tabulate_type=\plusone \else\notragged \fi}
852\def\tabl_tabulate_set_hss {\ifnum\c_tabl_tabulate_type=\plusone \else\hss \fi}
853
854\def\tabl_tabulate_bskip_raggedright {\tabl_tabulate_bskip\tabl_tabulate_set_raggedright }
855\def\tabl_tabulate_bskip_raggedleft {\tabl_tabulate_bskip\tabl_tabulate_set_raggedleft }
856\def\tabl_tabulate_bskip_raggedcenter{\tabl_tabulate_bskip\tabl_tabulate_set_raggedcenter}
857
858\def\tabl_tabulate_set_width_normal
859 {\ifcase\c_tabl_tabulate_align\relax
860 \tabl_tabulate_set_preamble_step\empty \tabl_tabulate_set_hss \or
861 \tabl_tabulate_set_preamble_step\empty \tabl_tabulate_set_hss \or
862 \tabl_tabulate_set_preamble_step\tabl_tabulate_set_hss\empty \or
863 \tabl_tabulate_set_preamble_step\tabl_tabulate_set_hss\tabl_tabulate_set_hss \fi}
864
865\def\tabl_tabulate_set_width_fixed
866 {\ifcase\c_tabl_tabulate_align\relax
867 \tabl_tabulate_set_preamble_step\tabl_tabulate_bskip \tabl_tabulate_eskip \or
868 \tabl_tabulate_set_preamble_step\tabl_tabulate_bskip_raggedright \tabl_tabulate_eskip \or
869 \tabl_tabulate_set_preamble_step\tabl_tabulate_bskip_raggedleft \tabl_tabulate_eskip \or
870 \tabl_tabulate_set_preamble_step\tabl_tabulate_bskip_raggedcenter\tabl_tabulate_eskip \fi}
871
872\def\tabl_tabulate_set_width_auto
873 {\global\advanceby\c_tabl_tabulate_nofauto\plusone
874 \ifcase\c_tabl_tabulate_align\relax
875 \tabl_tabulate_set_preamble_step\tabl_tabulate_bskip \tabl_tabulate_eskip \or
876 \tabl_tabulate_set_preamble_step\tabl_tabulate_bskip_raggedright \tabl_tabulate_eskip \or
877 \tabl_tabulate_set_preamble_step\tabl_tabulate_bskip_raggedleft \tabl_tabulate_eskip \or
878 \tabl_tabulate_set_preamble_step\tabl_tabulate_bskip_raggedcenter\tabl_tabulate_eskip \fi}
879
880\def\tabl_tabulate_set_width_simple
881 {\tabl_tabulate_set_preamble_step\tabl_tabulate_xbskip\tabl_tabulate_xeskip}
882
883
884
885
886
887
888\installcorenamespace{tabulatecolorspec}
889
890\defcsname\??tabulatecolorspec C\endcsname#1{\xdef\m_tabl_tabulate_color {#1}\global\c_tabl_tabulate_colorspan\zerocount}
891\defcsname\??tabulatecolorspec L\endcsname#1{\xdef\m_tabl_tabulate_color {#1}\global\c_tabl_tabulate_colorspan\plusone }
892\defcsname\??tabulatecolorspec M\endcsname#1{\xdef\m_tabl_tabulate_color {#1}\global\c_tabl_tabulate_colorspan\plustwo }
893\defcsname\??tabulatecolorspec R\endcsname#1{\xdef\m_tabl_tabulate_color {#1}\global\c_tabl_tabulate_colorspan\plusthree}
894\defcsname\??tabulatecolorspec T\endcsname#1{\xdef\m_tabl_tabulate_text_color{#1}}
895
896\def\tabl_tabulate_set_color_span#1#2
897 {\csname\??tabulatecolorspec#1\endcsname{#2}
898 \tabl_tabulate_set_preamble}
899
900\def\tabl_tabulate_set_vrule_command#1
901 {\doifelsenumber{#1}
902 {\global\d_tabl_tabulate_vrulethickness#1\d_tabl_tabulate_vrulethickness_default}
903 {\xdef\m_tabl_tabulate_vrule_color{#1}}}
904
905\permanent\protected\def\tabl_tabulate_set_entry#1#2
906 {\c_tabl_tabulate_align\v_tabl_tabulate_align
907 \c_tabl_tabulate_modus\zerocount
908 \c_tabl_tabulate_pwidth_set\conditionalfalse
909 \c_tabl_tabulate_reshape\conditionalfalse
910
911 \c_tabl_post_is_set\conditionalfalse
912 \t_tabl_tabulate_before\emptytoks
913 \t_tabl_tabulate_after\emptytoks
914 \t_tabl_tabulate_bmath\emptytoks
915 \t_tabl_tabulate_emath\emptytoks
916 \t_tabl_tabulate_font\emptytoks
917 \t_tabl_tabulate_settings\emptytoks
918 \glettonothing\m_tabl_tabulate_alignment
919 \glettonothing\m_tabl_tabulate_color
920 \glettonothing\m_tabl_tabulate_text_color
921 \glettonothing\m_tabl_tabulate_vrule_color
922 \glettonothing\tabl_tabulate_hook_box
923 \global\c_tabl_tabulate_colorspan\zerocount
924 \global\c_tabl_auto_align_mode\conditionalfalse
925 \global\c_tabl_auto_align_mode_new\conditionalfalse
926 \resetalignmentcharacter
927
928 \global\advanceby\c_tabl_tabulate_columns\plusone
929 \letcsname\??tabulatesetup\the\c_tabl_tabulate_columns\endcsname\donothing
930 \ifempty{#1}
931 \global\d_tabl_tabulate_vrulethickness\zeropoint
932 \else
933 \global\d_tabl_tabulate_vrulethickness\d_tabl_tabulate_vrulethickness_default
934
935 \rawprocesscommalist[#1]\tabl_tabulate_set_vrule_command
936 \fi
937 \tabl_tabulate_set_preamble#2\relax\relax
938 \ifcase\c_tabl_tabulate_modus\relax
939 \tabl_tabulate_set_width_normal
940 \or
941 \tabl_tabulate_set_width_fixed
942 \or
943 \tabl_tabulate_set_width_auto
944 \or
945 \tabl_tabulate_set_width_simple
946 \fi}
947
948\permanent\protected\def\tabl_tabulate_set_last_entry#1
949 {\glettonothing\m_tabl_tabulate_color
950 \glettonothing\m_tabl_tabulate_vrule_color
951 \ifempty{#1}
952 \global\d_tabl_tabulate_vrulethickness\zeropoint
953 \else
954 \global\d_tabl_tabulate_vrulethickness\d_tabl_tabulate_vrulethickness_default
955 \rawprocesscommalist[#1]\tabl_tabulate_set_vrule_command
956 \fi
957 \etoksapp\t_tabl_tabulate_preamble{
958 \tabl_tabulate_check_local_vrule_thickness\constantdimenargument\d_tabl_tabulate_vrulethickness
959 \tabl_tabulate_check_local_vrule_color\constantemptyargument\m_tabl_tabulate_vrule_color
960 \tabl_tabulate_column_vrule_inject}}
961
962\aliased\let\settabulateentry \tabl_tabulate_set_entry
963\aliased\let\settabulatelastentry\tabl_tabulate_set_last_entry
964
965\def\tabl_tabulate_normalize_splitline
966 {\ifcase\c_tabl_tabulate_splitlinemode
967
968 \or
969 \ht\b_tabl_tabulate\strutht
970 \dp\b_tabl_tabulate\strutdp
971 \or
972 \ifdim\ht\b_tabl_tabulate<\strutht
973 \ht\b_tabl_tabulate\strutht
974 \fi
975 \ifdim\dp\b_tabl_tabulate<\strutdp
976 \dp\b_tabl_tabulate\strutdp
977 \fi
978 \fi}
979
980\def\tabl_tabulate_whitespace
981 {\ifdim\d_tabl_tabulate_splitoff_betweenskip>\zeropoint
982 \vskip\d_tabl_tabulate_splitoff_betweenskip
983 \global\d_tabl_tabulate_splitoff_betweenskip\zeropoint
984 \fi}
985
986\def\tabl_tabulate_check_whitespace
987 {\setbox\scratchbox\vpack
988 {\splitdiscards
989 \unskip
990 \ifdim\lastskip>\d_tabl_tabulate_splitoff_betweenskip
991 \global\d_tabl_tabulate_splitoff_betweenskip\lastskip
992 \fi}}
993
994
995
996
997\installtexdirective
998 {tabulate.linenumbers}
999 {\def\tabl_tabulate_check_linenumbers{\page_postprocessors_linenumbers_deepbox\b_tabl_tabulate}}
1000 {\let\tabl_tabulate_check_linenumbers\relax}
1001
1002\let\tabl_tabulate_check_linenumbers\relax
1003
1004\def\tabl_tabulate_splitoff_box
1005 {\dontcomplain
1006 \setbox\b_tabl_tabulate\vsplit\b_tabl_tabulate_current\c_tabl_tabulate_column upto \lineheight
1007 \ifconditional\c_tabl_tabulate_splitoff_whitespace
1008 \tabl_tabulate_check_whitespace
1009 \fi
1010 \tabl_tabulate_color_repeat
1011 \setbox\b_tabl_tabulate\hpack to \wd\b_tabl_tabulate
1012 {\hss
1013 \tabl_tabulate_hook_yes{\box\b_tabl_tabulate}
1014 \hss}
1015 \tabl_tabulate_normalize_splitline
1016 \tabl_tabulate_check_linenumbers
1017 \box\b_tabl_tabulate}
1018
1019\protected\def\tabl_tabulate_hook_nop
1020 {}
1021
1022\let\tabl_tabulate_hook\tabl_tabulate_hook_nop
1023
1024\def\tabl_tabulate_hook_yes{\begincsname\??tabulatehook\the\c_tabl_tabulate_column\endcsname}
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042\newinteger\c_tabl_tabulate_height_p_max_lines
1043
1044\def\tabl_tabulate_pheight_reset
1045 {\global\c_tabl_tabulate_plines_min\plusone
1046 \iftrue
1047 \global\c_tabl_tabulate_plines_max\c_tabl_tabulate_height_p_max_lines
1048 \orelse\ifdim\d_tabl_tabulate_height_p_max>\zeropoint
1049 \getnoflines\d_tabl_tabulate_height_p_max
1050 \global\c_tabl_tabulate_plines_max\noflines
1051 \else
1052 \global\c_tabl_tabulate_plines_max\zerocount
1053 \fi
1054 \global\d_tabl_tabulate_height_p_max\zeropoint
1055 \global\c_tabl_tabulate_height_p_max_lines\zerocount}
1056
1057\def\tabl_tabulate_pheight_set
1058 {\scratchdimen\ht\b_tabl_tabulate_current\c_tabl_tabulate_column\relax
1059 \ifdim\scratchdimen>\d_tabl_tabulate_height_p_max
1060 \global\d_tabl_tabulate_height_p_max\scratchdimen
1061 \fi
1062 \scratchcounter\noflinesinbox\b_tabl_tabulate_current\c_tabl_tabulate_column\relax
1063 \ifnum\scratchcounter>\c_tabl_tabulate_height_p_max_lines
1064 \global\c_tabl_tabulate_height_p_max_lines\scratchcounter
1065 \fi}
1066
1067\def\tabl_tabulate_pbreak_inject
1068 {\ifconditional\c_tabl_tabulate_handlepbreak
1069 \ifconditional\c_tabl_tabulate_nopbreak
1070 \tabl_tabulate_nobreak_inject
1071 \orelse\ifnum\c_tabl_tabulate_plines_max>\plusone
1072 \ifnum\c_tabl_tabulate_plines_min=\plusone
1073 \tabl_tabulate_nobreak_inject
1074 \fi
1075 \global\advanceby\c_tabl_tabulate_plines_min\plusone
1076 \ifnum\c_tabl_tabulate_plines_min=\c_tabl_tabulate_plines_max\relax
1077 \tabl_tabulate_nobreak_inject
1078 \fi
1079 \fi
1080 \fi}
1081
1082\def\tabl_tabulate_pbreak_check
1083 {\noalign\bgroup
1084 \tabl_tabulate_pbreak_inject
1085 \ifconditional\c_tabl_tabulate_splitoff_whitespace
1086 \tabl_tabulate_whitespace
1087 \fi
1088 \egroup}
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154\installcorenamespace {tabulation}
1155
1156\installcommandhandler \??tabulation {tabulation} \??tabulation
1157
1158\setuptabulation
1159 [\c!unit=1em,
1160 EQ={:},
1161 \c!format={lp},
1162 \c!frame=\v!off,
1163
1164 \c!rule=\v!normal,
1165
1166 \c!rulethickness=\linewidth,
1167
1168 \c!before=\blank,
1169 \c!after=\blank,
1170 \c!distance={\v!depth,\v!medium},
1171 \c!align=\v!normal,
1172 \c!margin=\!!zeropoint,
1173 \c!split=\v!auto,
1174 \c!header=\v!yes,
1175
1176 \c!indenting=\v!no]
1177
1178\permanent\tolerant\protected\def\definetabulate[#1]#*[#S#2]#*[#S#3]
1179 {\ifarguments
1180
1181 \or
1182
1183 \definetabulation[#1][\c!format={lp},\s!check=]
1184 \or
1185
1186 \definetabulation[#1][\c!format={#2},\s!check=]
1187 \or
1188
1189 \ifcsname\namedtabulationhash{#1}\s!check\endcsname \else
1190 \definetabulation[#1][\c!format={#3},\s!check=]
1191 \fi
1192 \definetabulation[#1:#2][#1][\c!format={#3},\s!check=]
1193 \fi}
1194
1195\permanent\tolerant\protected\def\setuptabulate[#S#1]#*[#S#2]#*[#S#3]
1196 {\ifarguments
1197
1198 \or
1199
1200 \setuptabulation[#1]
1201 \or
1202
1203 \setuptabulation[#1][#2]
1204 \or
1205
1206 \setuptabulation[#1:#2][#3]
1207 \fi}
1208
1209\appendtoks
1210 \enforced\permanent\protected\edefcsname\e!start \currenttabulation\endcsname{\tabl_start_defined[\currenttabulation]}
1211 \enforced\aliased \letcsname \e!stop \currenttabulation\endcsname\relax
1212 \mutable \letcsname \??tabulatehead\currenttabulation\endcsname\empty
1213 \mutable \letcsname \??tabulatefoot\currenttabulation\endcsname\empty
1214\to \everydefinetabulation
1215
1216\aliased \let\tabulateparameter\tabulationparameter
1217\permanent\def\currenttabulate {\currenttabulation}
1218
1219
1220
1221\lettonothing\tabl_tabulate_insert_head
1222\lettonothing\tabl_tabulate_insert_body
1223\lettonothing\tabl_tabulate_insert_foot
1224
1225\def\tabl_tabulate_insert_head_content
1226 {\noalign{\global\c_tabl_tabulate_someamble\conditionaltrue}
1227 \begincsname\??tabulatehead\currenttabulation\endcsname
1228 \noalign{\global\c_tabl_tabulate_someamble\conditionalfalse}}
1229
1230\def\tabl_tabulate_insert_foot_content
1231 {\noalign{\global\c_tabl_tabulate_someamble\conditionaltrue}
1232 \begincsname\??tabulatefoot\currenttabulation\endcsname
1233 \noalign{\global\c_tabl_tabulate_someamble\conditionalfalse}}
1234
1235\def\tabl_tabulate_check_full_content
1236 {\ifcsname\??tabulatehead\currenttabulation\endcsname
1237 \ifempty{\lastnamedcs}
1238 \lettonothing\tabl_tabulate_insert_head
1239 \else
1240 \let\tabl_tabulate_insert_head\tabl_tabulate_insert_head_content
1241 \fi
1242 \else
1243 \lettonothing\tabl_tabulate_insert_head
1244 \fi
1245 \ifcsname\??tabulatefoot\currenttabulation\endcsname
1246 \ifempty{\lastnamedcs}
1247 \lettonothing\tabl_tabulate_insert_foot
1248 \else
1249 \let\tabl_tabulate_insert_foot\tabl_tabulate_insert_foot_content
1250 \fi
1251 \else
1252 \lettonothing\tabl_tabulate_insert_foot
1253 \fi}
1254
1255\def\tabl_tabulate_insert_content
1256 {\tabl_tabulate_insert_head
1257 \ifcase\c_tabl_tabulate_repeathead \else
1258 \noalign{\penalty\zerocount}
1259 \fi
1260 \tabl_tabulate_insert_body
1261 \tabl_tabulate_insert_foot
1262 \tabl_tabulate_remove_funny_line}
1263
1264\def\tabl_tabulate_remove_funny_line
1265 {\ifhmode
1266
1267 \strut\crcr
1268 \noalign{\kern\lineheight}
1269
1270 \fi}
1271
1272
1273
1274\permanent\protected\defcsname\e!start\v!tabulatehead\endcsname{\doifelsenextoptionalcs\tabl_tabulate_start_head_yes\tabl_tabulate_start_head_nop}
1275\permanent\protected\defcsname\e!start\v!tabulatetail\endcsname{\doifelsenextoptionalcs\tabl_tabulate_start_foot_yes\tabl_tabulate_start_foot_nop}
1276
1277\lettonothing\m_tabl_tabulate_data
1278
1279\def\tabl_tabulate_start_head_yes[#1]
1280 {\processcontent{\e!stop\v!tabulatehead}\m_tabl_tabulate_data{\letcsname\??tabulatehead#1\endcsname\m_tabl_tabulate_data}}
1281
1282\def\tabl_tabulate_start_foot_yes[#1]
1283 {\processcontent{\e!stop\v!tabulatetail}\m_tabl_tabulate_data{\letcsname\??tabulatefoot#1\endcsname\m_tabl_tabulate_data}}
1284
1285
1286
1287
1288\def\tabl_tabulate_start_head_nop{\tabl_tabulate_start_head_yes[]}
1289\def\tabl_tabulate_start_foot_nop{\tabl_tabulate_start_foot_yes[]}
1290
1291\protected\def\tabl_start_defined[#1]
1292 {\bgroup
1293 \cdef\currenttabulationparent{#1}
1294 \let\currenttabulation\currenttabulationparent
1295 \ifcstok{\tabulationparameter\c!format}\v!none
1296
1297
1298 \lettabulationparameter\c!format\tabl_default_format
1299 \expandafter\tabl_start_regular
1300 \else
1301 \expandafter\tabl_start_defined_indeed
1302 \fi}
1303
1304\tolerant\def\tabl_start_defined_indeed[#S#1]#*[#S#2]
1305 {\ifarguments\or
1306 \ifhastok={#1}
1307 \setuptabulation[\currenttabulation][#1]
1308 \else
1309 \cdef\currenttabulation{\currenttabulation:#1}
1310 \fi
1311 \else
1312 \cdef\currenttabulation{\currenttabulation:#1}
1313 \setuptabulation[\currenttabulation][#2]
1314 \fi
1315 \tabl_tabulate_start_building}
1316
1317
1318
1319\def\tabl_default_format{lp}
1320
1321\permanent\protected\defcsname\e!start\v!tabulate\endcsname
1322 {\bgroup
1323 \lettonothing\currenttabulationparent
1324 \tabl_start_regular}
1325
1326\tolerant\protected\def\tabl_start_regular[#S#1]#*[#S#2]
1327 {\let\currenttabulation\currenttabulationparent
1328 \ifempty{#1}
1329 \ifhaschar={#2}\relax
1330 \setupcurrenttabulation[#2]
1331 \fi
1332 \orelse\ifhaschar={#1}\relax
1333 \ifempty{#2}\else
1334 \settabulationparameter\c!format{#2}
1335 \fi
1336 \setupcurrenttabulation[#1]
1337 \else
1338 \ifempty{#1}\else
1339 \settabulationparameter\c!format{#1}
1340 \fi
1341 \ifhaschar={#2}\relax
1342 \setupcurrenttabulation[#2]
1343 \fi
1344 \fi
1345 \tabl_tabulate_start_building}
1346
1347\permanent\letcsname\e!stop\v!tabulate \endcsname\relax
1348\permanent\letcsname\e!stop\v!tabulatehead\endcsname\relax
1349\permanent\letcsname\e!stop\v!tabulatetail\endcsname\relax
1350
1351\permanent\protected\def\tabl_tabulate_start_ignore
1352 {\em Nested tabulate is not (yet) supported.\relax
1353 \expandafter\ignoreupto\csname\ifconditional\c_tabl_generic stoptabulate\else\e!stop\v!tabulate\fi\endcsname}
1354
1355\appendtoks
1356 \enforced\letcsname\e!start\v!tabulate\endcsname\tabl_tabulate_start_ignore
1357\to \everytabulate
1358
1359\defcsname\??tabulatesplit\v!yes \endcsname{\c_tabl_tabulate_split\conditionaltrue}
1360\defcsname\??tabulatesplit\v!repeat\endcsname{\c_tabl_tabulate_split\conditionaltrue}
1361\defcsname\??tabulatesplit\v!no \endcsname{\c_tabl_tabulate_split\conditionalfalse}
1362\defcsname\??tabulatesplit\v!auto \endcsname{\ifinsidefloat\ifinsidesplitfloat\else\c_tabl_tabulate_split\conditionalfalse\fi\fi}
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394\let\tabl_tabulate_inside_after \relax
1395\let\tabl_tabulate_outside_after \relax
1396\let\tabl_tabulate_inside_inbetween \relax
1397\let\tabl_tabulate_outside_inbetween\relax
1398
1399\protected\def\tabl_tabulate_inside_before
1400 {\ifhmode\par\fi
1401 \ifhmode
1402 \ifinsidesplitfloat
1403 \let\tabl_tabulate_inside_after\relax
1404 \else
1405 \vbox\bgroup
1406 \let\tabl_tabulate_inside_after\egroup
1407 \fi
1408 \else
1409 \let\tabl_tabulate_inside_after\relax
1410 \fi}
1411
1412\protected\def\tabl_tabulate_outside_before
1413 {\ifhmode\par\fi
1414 \ifhmode
1415 \vbox\bgroup
1416 \let\tabl_tabulate_outside_after \egroup
1417 \let\tabl_tabulate_outside_inbetween\relax
1418 \orelse\ifinner
1419 \let\tabl_tabulate_outside_after \relax
1420 \let\tabl_tabulate_outside_inbetween\relax
1421 \else
1422 \whitespace
1423 \tabulationparameter\c!before
1424 \relax
1425 \let\tabl_tabulate_outside_after \tabl_tabulate_outside_after_indeed
1426 \let\tabl_tabulate_outside_inbetween\tabl_tabulate_outside_inbetween_indeed
1427 \fi}
1428
1429\def\tabl_tabulate_outside_after_indeed
1430 {\tabulationparameter\c!after}
1431
1432\def\tabl_tabulate_outside_inbetween_indeed
1433 {\ifempty{\tabulationparameter\c!after}\else
1434 \vskip\strutdp
1435 \verticalstrut
1436 \vskip\struttotal
1437 \fi}
1438
1439\def\tabl_tabulate_inside_inbetween
1440 {\ifempty{\tabulationparameter\c!after}\else
1441 \vskip\strutdp
1442 \verticalstrut
1443 \vskip\struttotal
1444 \fi}
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508\protected\def\tabl_tabulate_start_building
1509 {\ifinsidefloat
1510 \tabl_tabulate_inside_before
1511 \else
1512 \tabl_tabulate_outside_before
1513 \fi
1514 \bgroup
1515
1516 \t_tabl_tabulate_preamble\emptytoks
1517 \t_tabl_tabulate_dummy \emptytoks
1518
1519 \resetcharacteralign
1520
1521 \edef\p_distance {\tabulationparameter\c!distance}
1522 \edef\p_align {\tabulationparameter\c!align}
1523 \edef\p_line {\tabulationparameter\c!rule}
1524 \edef\p_rulecolor {\tabulationparameter\c!rulecolor}
1525 \edef\p_rulethickness {\tabulationparameter\c!rulethickness}
1526 \edef\p_bodyfont {\tabulationparameter\c!bodyfont}
1527 \edef\p_indenting {\tabulationparameter\c!indenting}
1528 \edef\p_blank {\tabulationparameter\c!blank}
1529
1530 \ifcstok{\tabulationparameter\c!keeptogether}\v!no
1531 \c_tabl_tabulate_tolerant_break\conditionaltrue
1532
1533 \else
1534 \c_tabl_tabulate_tolerant_break\conditionalfalse
1535
1536 \fi
1537
1538 \ifcstok{\tabulationparameter\c!interlinespace}\v!no
1539 \c_tabl_tabulate_no_interline_space\conditionaltrue
1540 \else
1541 \c_tabl_tabulate_no_interline_space\conditionalfalse
1542 \fi
1543
1544 \c_tabl_tabulate_split\conditionaltrue
1545 \begincsname\??tabulatesplit\tabulationparameter\c!split\endcsname
1546
1547 \let\m_tabl_tabulate_blank_default\p_blank
1548
1549 \d_tabl_tabulate_unit\tabulationparameter\c!unit
1550 \d_tabl_tabulate_margin\tabulationparameter\c!margin
1551 \let\m_tabl_tabulate_vrule_color_default\p_rulecolor
1552 \let\m_tabl_tabulate_hrule_color_default\p_rulecolor
1553 \d_tabl_tabulate_vrulethickness_default\p_rulethickness
1554 \d_tabl_tabulate_hrulethickness_default\p_rulethickness
1555 \ifempty\p_bodyfont\else
1556 \switchtobodyfont[\p_bodyfont]
1557 \fi
1558 \postponenotes
1559 \widowpenalty\zerocount
1560 \clubpenalty \zerocount
1561 \expand\everytabulate
1562 \usesetupsparameter\tabulationparameter
1563 \tabulationparameter\c!inner
1564 \d_tabl_tabulate_indent\dimexpr\leftskip\hangindent\ifx\p_indenting\v!yes\parindent\fi\relax
1565 \global\c_tabl_tabulate_column\zerocount
1566 \begingroup
1567 \catcode\hashasciicode\othercatcode
1568 \ifconditional\c_tabl_generic
1569 \expandafter\tabl_tabulate_pickup_generic
1570 \orelse\ifempty\currenttabulationparent
1571 \expandafter\tabl_tabulate_pickup_interfaced
1572 \else
1573 \expandafter\tabl_tabulate_pickup_specific
1574 \fi}
1575
1576\protected\def\tabl_tabulate_pickup_generic
1577 #L\starttabulate
1578 #R\stoptabulate
1579 #1
1580 {\endgroup
1581 \def\tabl_tabulate_insert_body{#1}
1582 \tabl_tabulate_process}
1583
1584\protected\def\tabl_tabulate_pickup_indeed#1#2
1585 {\protected\def\tabl_tabulate_pickup##L#1##R#2##1
1586 {\endgroup
1587 \def\tabl_tabulate_insert_body{##1}
1588 \tabl_tabulate_process}
1589 \tabl_tabulate_pickup}
1590
1591\protected\def\tabl_tabulate_pickup_interfaced
1592 {\normalexpanded{\tabl_tabulate_pickup_indeed
1593 \expandafter\noexpand\csname\e!start\v!tabulate\endcsname
1594 \expandafter\noexpand\csname\e!stop \v!tabulate\endcsname}}
1595
1596\protected\def\tabl_tabulate_pickup_specific
1597 {\normalexpanded{\tabl_tabulate_pickup_indeed
1598 \expandafter\noexpand\csname\e!start\currenttabulationparent\endcsname
1599 \expandafter\noexpand\csname\e!stop \currenttabulationparent\endcsname}}
1600
1601\permanent\protected\def\tabulateEQ
1602 {\ifconditional\c_tabl_tabulate_firstflushed\else
1603 \dostarttaggedchained\t!ignore\empty\empty
1604 \dostarttagged\t!ignore\empty
1605 \tabulationparameter{EQ}
1606 \dostoptagged
1607 \dostoptagged
1608 \fi
1609 \global\c_tabl_tabulate_equal\conditionalfalse}
1610
1611
1612
1613\let\tabulatenormalpos\relax
1614\let\tabulateequalpos \relax
1615
1616
1617
1618\lettonothing\m_tabl_tabulate_color_previous
1619\lettonothing\m_tabl_tabulate_color
1620\lettonothing\m_tabl_tabulate_text_color
1621\lettonothing\m_tabl_tabulate_color_local
1622\lettonothing\m_tabl_tabulate_vrule_color
1623\lettonothing\m_tabl_tabulate_vrule_color_local
1624\lettonothing\m_tabl_tabulate_vrule_color_default
1625\lettonothing\m_tabl_tabulate_hrule_color_default
1626\lettonothing\m_tabl_tabulate_blank_default
1627
1628\appendtoks
1629 \glettonothing\m_tabl_tabulate_color_previous
1630 \glettonothing\m_tabl_tabulate_color
1631 \glettonothing\m_tabl_tabulate_text_color
1632 \glettonothing\m_tabl_tabulate_color_local
1633 \glettonothing\m_tabl_tabulate_vrule_color
1634 \glettonothing\m_tabl_tabulate_vrule_color_local
1635 \global\d_tabl_tabulate_vrulethickness_local\zeropoint
1636\to \t_tabl_tabulate_every_row
1637
1638\protected\def\tabl_tabulate_color_side_right_second
1639 {\ifempty\m_tabl_tabulate_color_previous \else
1640 \tabl_tabulate_color_set\m_tabl_tabulate_color_previous
1641 \glettonothing\m_tabl_tabulate_color_previous
1642 \fi}
1643
1644\protected\def\tabl_tabulate_color_side_left_second
1645 {\ifempty\m_tabl_tabulate_color \else
1646 \ifcase\c_tabl_tabulate_colorspan
1647 \or
1648 \tabl_tabulate_color_set\m_tabl_tabulate_color
1649 \or
1650 \tabl_tabulate_color_set\m_tabl_tabulate_color
1651 \fi
1652 \fi}
1653
1654\protected\def\tabl_tabulate_color_side_both_second
1655 {\ifempty\m_tabl_tabulate_color \else
1656 \tabl_tabulate_color_set\m_tabl_tabulate_color
1657 \ifcase\c_tabl_tabulate_colorspan
1658
1659 \or
1660 \glettonothing\m_tabl_tabulate_color_previous
1661 \or
1662 \glet\m_tabl_tabulate_color_previous\m_tabl_tabulate_color
1663 \or
1664 \glet\m_tabl_tabulate_color_previous\m_tabl_tabulate_color
1665 \fi
1666 \fi}
1667
1668\let\tabl_tabulate_color_side_right \relax
1669\let\tabl_tabulate_color_side_left \relax
1670\let\tabl_tabulate_color_side_both \relax
1671
1672\appendtoks
1673 \let\tabl_tabulate_color_side_right\tabl_tabulate_color_side_right_second
1674 \let\tabl_tabulate_color_side_left \tabl_tabulate_color_side_left_second
1675 \let\tabl_tabulate_color_side_both \tabl_tabulate_color_side_both_second
1676\to \t_tabl_tabulate_initializers_second
1677
1678\def\tabl_tabulate_set_color_column#1
1679 {\unskip
1680 \doifelsefastoptionalcheck{\tabl_tabulate_set_color_column_yes#1}{\tabl_tabulate_set_color_column_nop#1}}
1681
1682\def\tabl_tabulate_set_color_column_nop
1683 {\tabl_tabulate_column_normal\zerocount}
1684
1685\def\tabl_tabulate_set_color_column_yes#1[#2]
1686 {\xdef\m_tabl_tabulate_color_local{#2}
1687 \tabl_tabulate_column_normal\zerocount#1}
1688
1689
1690
1691\def\tabl_tabulate_column_normal#1#2
1692 {\unskip
1693 \aligntab
1694 \ifconditional\c_tabl_tabulate_equal\tabulateequalpos\else\tabulatenormalpos\fi
1695 \ifnum\c_tabl_tabulate_column>\c_tabl_tabulate_max_vrulecolumn\else
1696 \tabl_tabulate_column_vrule_setup
1697 \fi
1698 \aligntab
1699 \global\c_tabl_tabulate_kind#1
1700 \global\c_tabl_tabulate_type#2
1701 \aligntab}
1702
1703
1704
1705\def\tabl_tabulate_column_equal#1#2
1706 {\unskip
1707 \aligntab
1708 \tabulateequalpos
1709 \aligntab
1710 \global\c_tabl_tabulate_kind#1
1711 \global\c_tabl_tabulate_type#2
1712 \aligntab}
1713
1714
1715
1716\def\tabl_tabulate_column_vruled_preset
1717 {\glet\m_tabl_tabulate_vrule_color_local\m_tabl_tabulate_vrule_color_default
1718 \global\d_tabl_tabulate_vrulethickness_local\d_tabl_tabulate_vrulethickness_default}
1719
1720\def\tabl_tabulate_column_vruled#1#2
1721 {\unskip
1722
1723
1724
1725
1726
1727 \ifnum\c_tabl_tabulate_column>\c_tabl_tabulate_max_vrulecolumn
1728 \global\c_tabl_tabulate_max_vrulecolumn\c_tabl_tabulate_column
1729 \fi
1730 \doifelsefastoptionalcheck{\tabl_tabulate_column_vruled_yes#1#2}{\tabl_tabulate_column_vruled_nop#1#2}}
1731
1732\def\tabl_tabulate_column_vrule_setup
1733 {\begincsname\??tabulatevrule\the\c_tabl_tabulate_column\endcsname}
1734
1735\def\tabl_tabulate_column_vruled_nop
1736 {\gletcsname\??tabulatevrule\the\c_tabl_tabulate_column\endcsname\tabl_tabulate_column_vruled_preset
1737 \tabl_tabulate_column_normal}
1738
1739\def\tabl_tabulate_column_vruled_step#1
1740 {\doifelsenumber{#1}
1741 {\global\d_tabl_tabulate_vrulethickness_local#1\d_tabl_tabulate_vrulethickness_default}
1742 {\xdef\m_tabl_tabulate_vrule_color_local{#1}}}
1743
1744\def\tabl_tabulate_column_vruled_yes#1#2[#3]
1745 {\gdefcsname\??tabulatevrule\the\c_tabl_tabulate_column\endcsname
1746 {\tabl_tabulate_column_vruled_preset
1747 \rawprocesscommalist[#3]\tabl_tabulate_column_vruled_step}
1748 \tabl_tabulate_column_normal#1#2}
1749
1750\def\tabl_tabulate_vrule_reset
1751 {\ifcase\c_tabl_tabulate_max_vrulecolumn\else
1752 \tabl_tabulate_vrule_reset_indeed
1753 \fi}
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763\def\tabl_tabulate_vrule_reset_indeed
1764 {\localcontrolledloop\zerocount\c_tabl_tabulate_max_vrulecolumn\plusone
1765 {\gletcsname\??tabulatevrule\the\currentloopiterator\endcsname\undefined}
1766 \global\c_tabl_tabulate_max_vrulecolumn\zerocount}
1767
1768\appendtoks
1769 \tabl_tabulate_vrule_reset
1770\to \t_tabl_tabulate_every_after_row
1771
1772\def\tabl_tabulate_column_vruled_normal
1773 {\vrule\s!width\d_tabl_tabulate_vrulethickness\relax}
1774
1775\def\tabl_tabulate_column_vruled_colored
1776 {\dousecolorparameter\m_tabl_tabulate_vrule_color
1777 \vrule\s!width\d_tabl_tabulate_vrulethickness\relax}
1778
1779\protected\def\tabl_tabulate_column_vrule_inject_first
1780 {\ifcase\d_tabl_tabulate_vrulethickness\else
1781 \tabl_tabulate_column_vruled_normal
1782 \fi
1783 \global\d_tabl_tabulate_vrulethickness\zeropoint}
1784
1785\protected\def\tabl_tabulate_column_vrule_inject_second
1786 {\ifcase\d_tabl_tabulate_vrulethickness
1787 \orelse\ifempty\m_tabl_tabulate_vrule_color
1788 \tabl_tabulate_column_vruled_normal
1789 \else
1790 \tabl_tabulate_column_vruled_colored
1791 \fi
1792 \global\d_tabl_tabulate_vrulethickness\zeropoint}
1793
1794\let\tabl_tabulate_column_vrule_inject\relax
1795
1796\appendtoks
1797 \let\tabl_tabulate_column_vrule_inject\tabl_tabulate_column_vrule_inject_first
1798\to \t_tabl_tabulate_initializers_first
1799
1800\appendtoks
1801 \let\tabl_tabulate_column_vrule_inject\tabl_tabulate_column_vrule_inject_second
1802\to \t_tabl_tabulate_initializers_second
1803
1804
1805
1806\def\tabl_tabulate_column_inject_auto
1807 {\tabl_tabulate_column_normal\zerocount\zerocount
1808 \ifnum\c_tabl_tabulate_column>\c_tabl_tabulate_columns\relax
1809 \expandafter\NR
1810 \else
1811 \expandafter\ignorepars
1812 \fi}
1813
1814\protected\def\tabl_tabulate_set_quick#1
1815 {\enforced\let#1\tabl_tabulate_column_inject_auto
1816 \enforced\let\\\tabl_tabulate_column_inject_auto}
1817
1818\defcsname\??tabulateseparator\v!blank \endcsname{\s_tabl_tabulate_separator\bigskipamount}
1819\defcsname\??tabulateseparator\v!depth \endcsname{\s_tabl_tabulate_separator\strutdp}
1820\defcsname\??tabulateseparator\v!small \endcsname{\def\m_tabl_tabulate_separator_factor{.25}}
1821\defcsname\??tabulateseparator\v!medium\endcsname{\def\m_tabl_tabulate_separator_factor{.5}}
1822\defcsname\??tabulateseparator\v!big \endcsname{}
1823\defcsname\??tabulateseparator\v!none \endcsname{\s_tabl_tabulate_separator\zeroskip\let\m_tabl_tabulate_separator_factor\zerocount}
1824\defcsname\??tabulateseparator\v!grid \endcsname{\s_tabl_tabulate_separator\zeroskip\let\m_tabl_tabulate_separator_factor\zerocount}
1825
1826\def\tabl_tabulate_column_rule_separator_step#1
1827 {\ifcsname\??tabulateseparator#1\endcsname
1828 \lastnamedcs
1829 \else
1830 \s_tabl_tabulate_separator#1\relax
1831 \fi}
1832
1833\def\tabl_tabulate_column_rule_separator_inject
1834 {\bgroup
1835 \s_tabl_tabulate_separator\strutdp
1836 \ifempty\p_distance\else
1837 \let\m_tabl_tabulate_separator_factor\plusone
1838 \processcommacommand[\p_distance]\tabl_tabulate_column_rule_separator_step
1839 \s_tabl_tabulate_separator\m_tabl_tabulate_separator_factor\s_tabl_tabulate_separator
1840 \fi
1841
1842
1843
1844
1845 \directvskip\s_tabl_tabulate_separator
1846 \egroup}
1847
1848\lettonothing\m_tabl_tabulate_hrule_color
1849
1850\def\tabl_tabulate_hrule_preset_step#1
1851 {\doifelsenumber{#1}
1852 {\global\d_tabl_tabulate_hrulethickness_local#1\d_tabl_tabulate_hrulethickness_default}
1853 {\xdef\m_tabl_tabulate_hrule_color{#1}}}
1854
1855\def\tabl_tabulate_hrule_preset[#1]
1856 {\glet\m_tabl_tabulate_hrule_color\m_tabl_tabulate_hrule_color_default
1857 \global\d_tabl_tabulate_hrulethickness_local\d_tabl_tabulate_hrulethickness_default
1858 \ifempty{#1}\else\rawprocesscommalist[#1]\tabl_tabulate_hrule_preset_step\fi}
1859
1860\def\tabl_tabulate_hrule_inject_normal
1861 {\autorule
1862 \s!height.5\d_tabl_tabulate_hrulethickness_local
1863 \s!depth .5\d_tabl_tabulate_hrulethickness_local
1864 \s!left \d_tabl_tabulate_indent
1865 \relax}
1866
1867\def\tabl_tabulate_hrule_inject_colored
1868 {\dousecolorparameter\m_tabl_tabulate_hrule_color
1869 \tabl_tabulate_hrule_inject_normal}
1870
1871\protected\def\tabl_tabulate_hrule_inject_first
1872 {\ifcase\d_tabl_tabulate_hrulethickness_local\else
1873 \tabl_tabulate_hrule_inject_normal
1874 \fi}
1875
1876\protected\def\tabl_tabulate_hrule_inject_second
1877 {\ifcase\d_tabl_tabulate_hrulethickness_local\else
1878 \ifempty\m_tabl_tabulate_hrule_color
1879 \tabl_tabulate_hrule_inject_normal
1880 \else
1881 \tabl_tabulate_hrule_inject_colored
1882 \fi
1883 \fi}
1884
1885\let\tabl_tabulate_hrule_inject\relax
1886
1887\appendtoks
1888 \let\tabl_tabulate_hrule_inject\tabl_tabulate_hrule_inject_first
1889\to \t_tabl_tabulate_initializers_first
1890
1891\appendtoks
1892 \let\tabl_tabulate_hrule_inject\tabl_tabulate_hrule_inject_second
1893\to \t_tabl_tabulate_initializers_second
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920\protected\def\tabl_tabulate_color_set#1
1921 {\begingroup
1922 \clf_enablebackgroundalign
1923 \glet\tabl_tabulate_color_repeat\tabl_tabulate_color_repeat_second
1924 \ifnum\c_tabl_tabulate_column>\c_tabl_tabulate_max_colorcolumn
1925 \global\c_tabl_tabulate_max_colorcolumn\c_tabl_tabulate_column
1926 \fi
1927 \xdefcsname\??tabulatecolor\the\c_tabl_tabulate_column\endcsname{#1}
1928 \hpack \thealignbackgroundcolorattr{#1}{}
1929 \endgroup}
1930
1931\def\tabl_tabulate_color_repeat_second
1932 {\begingroup
1933 \scratchcounter\numexpr\c_tabl_tabulate_column\plusone\relax
1934 \ifcsname\??tabulatecolor\the\scratchcounter\endcsname
1935
1936 \hpack \expandafter\thealignbackgroundcolorattr\expandafter{\lastnamedcs}{}
1937 \fi
1938 \endgroup}
1939
1940\let\tabl_tabulate_color_repeat\relax
1941
1942\appendtoks
1943 \let\tabl_tabulate_color_repeat\relax
1944\to \everytabulate
1945
1946\def\tabl_tabulate_color_reset
1947 {\ifcase\c_tabl_tabulate_max_colorcolumn\else
1948 \tabl_tabulate_color_reset_indeed
1949 \fi}
1950
1951
1952
1953
1954
1955
1956
1957\def\tabl_tabulate_color_reset_indeed
1958 {\localcontrolledloop\zerocount\c_tabl_tabulate_max_colorcolumn\plusone
1959 {\gletcsname\??tabulatecolor\the\currentloopiterator\endcsname\undefined}
1960 \global\c_tabl_tabulate_max_colorcolumn\zerocount}
1961
1962\appendtoks
1963 \tabl_tabulate_color_reset
1964\to \t_tabl_tabulate_every_after_row
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982\def\tabl_tabulate_register_par_options_first
1983 {}
1984
1985\def\tabl_tabulate_register_par_options_second
1986 {\registerparoptions
1987 \ifinsidefloat
1988
1989 \glettonothing\tabl_tabulate_register_par_options
1990 \else
1991
1992
1993 \fi}
1994
1995\let\tabl_tabulate_register_par_options\relax
1996
1997\appendtoks
1998 \let\tabl_tabulate_register_par_options\tabl_tabulate_register_par_options_first
1999\to \t_tabl_tabulate_initializers_first
2000
2001\appendtoks
2002 \let\tabl_tabulate_register_par_options\tabl_tabulate_register_par_options_second
2003\to \t_tabl_tabulate_initializers_second
2004
2005\appendtoks
2006 \tabl_tabulate_register_par_options
2007\to \t_tabl_tabulate_every_row
2008
2009\def\tabl_tabulate_flush_indent_indeed
2010 {\hbox to \d_tabl_tabulate_indent
2011 {
2012
2013
2014 \advanceby\hsize\d_tabl_tabulate_indent
2015
2016
2017 \expand\t_tabl_tabulate_every_row
2018 \hss}}
2019
2020\def\tabl_tabulate_flush_indent
2021 {\ifzero\c_tabl_tabulate_column
2022 \tabl_tabulate_flush_indent_indeed
2023 \fi}
2024
2025\def\tabl_tabulate_digits{\digits}
2026
2027
2028
2029
2030
2031\defcsname\??tabulatealigning\v!normal\endcsname{0}
2032\defcsname\??tabulatealigning\v!right \endcsname{1}
2033\defcsname\??tabulatealigning\v!left \endcsname{2}
2034\defcsname\??tabulatealigning\v!middle\endcsname{3}
2035
2036\defcsname\??tabulateheader\v!repeat\endcsname{\plusone}
2037\defcsname\??tabulateheader\v!text \endcsname{\plustwo}
2038
2039\protected\def\tabl_tabulate_bskip_first {\setbox\b_tabl_tabulate\vbox\bgroup\glet\tabl_tabulate_hook\tabl_tabulate_hook_nop}
2040\protected\def\tabl_tabulate_eskip_first {\par\egroup\glet\tabl_tabulate_hook\tabl_tabulate_hook_yes}
2041\protected\def\tabl_tabulate_xbskip_first{\hpack\bgroup\vbox\bgroup\glet\tabl_tabulate_hook\tabl_tabulate_hook_nop}
2042\protected\def\tabl_tabulate_xeskip_first{\par\egroup\egroup\glet\tabl_tabulate_hook\tabl_tabulate_hook_yes}
2043
2044\let\tabl_tabulate_bbskip\relax
2045\let\tabl_tabulate_eeskip\relax
2046\let\tabl_tabulate_bskip \relax
2047\let\tabl_tabulate_eskip \relax
2048\let\tabl_tabulate_xbskip\relax
2049\let\tabl_tabulate_xeskip\relax
2050
2051\appendtoks
2052 \let\tabl_tabulate_bbskip\relax
2053
2054 \let\tabl_tabulate_bskip \tabl_tabulate_bskip_first
2055 \let\tabl_tabulate_eskip \tabl_tabulate_eskip_first
2056 \let\tabl_tabulate_xbskip\tabl_tabulate_xbskip_first
2057 \let\tabl_tabulate_xeskip\tabl_tabulate_xeskip_first
2058\to \t_tabl_tabulate_initializers_first
2059
2060\def\tabl_tabulate_baselinecorrection
2061 {\def\dobaselinecorrection{\vskip\dimexpr\prevdepth\strutdp\strutdp\relax}
2062 \baselinecorrection}
2063
2064
2065
2066
2067
2068\installcorenamespace{tabulatenobreak}
2069
2070\def\tabl_tabulate_break_allow{\directvpenalty\zerocount}
2071\def\tabl_tabulate_break_maybe{\directvpenalty\zerocount}
2072\def\tabl_tabulate_break_no {\directvpenalty\plustenthousand}
2073
2074\let\tabl_tabulate_break_state_set \relax
2075\let\tabl_tabulate_break_state_reset \relax
2076\let\tabl_tabulate_break_state_allowbreak\tabl_tabulate_break_maybe
2077
2078
2079
2080\permanent\protected\def\tabl_tabulate_VL_first{\tabl_tabulate_column_vruled\zerocount\zerocount}
2081\permanent\protected\def\tabl_tabulate_NC_first{\tabl_tabulate_column_normal\zerocount\zerocount}
2082\permanent\protected\def\tabl_tabulate_RC_first{\tabl_tabulate_column_normal\zerocount\plusone}
2083\permanent\protected\def\tabl_tabulate_HC_first{\tabl_tabulate_column_normal\zerocount\plustwo}
2084\permanent\protected\def\tabl_tabulate_EQ_first{\tabl_tabulate_column_equal \plustwo \zerocount}
2085\permanent\protected\def\tabl_tabulate_RQ_first{\tabl_tabulate_column_equal \zerocount\plusone}
2086\permanent\protected\def\tabl_tabulate_HQ_first{\tabl_tabulate_column_equal \zerocount\plustwo}
2087
2088\permanent\protected\def\tabl_tabulate_NG_first{\tabl_tabulate_column_normal\zerocount\zerocount}
2089\permanent\protected\def\tabl_tabulate_NN_first{\tabl_tabulate_column_normal\zerocount\zerocount\tabl_tabulate_digits}
2090\permanent\protected\def\tabl_tabulate_ND_first{\tabl_tabulate_column_normal\zerocount\zerocount\tabl_tabulate_digits}
2091
2092\permanent\protected\def\tabl_tabulate_NR_first {\tabl_tabulate_NR_common\conditionaltrue \tabl_tabulate_check_penalties}
2093\permanent\protected\def\tabl_tabulate_NB_first {\tabl_tabulate_NR_common\conditionaltrue \tabl_tabulate_nobreak_inject }
2094
2095\permanent\protected\def\tabl_tabulate_NR_second{\tabl_tabulate_NR_common\conditionalfalse\tabl_tabulate_check_penalties}
2096\permanent\protected\def\tabl_tabulate_NB_second{\tabl_tabulate_NR_common\conditionalfalse\tabl_tabulate_nobreak_inject }
2097
2098\permanent\protected\def\tabl_tabulate_CC_first{\global\c_tabl_tabulate_localcolorspan\zerocount\tabl_tabulate_set_color_column\zerocount}
2099\permanent\protected\def\tabl_tabulate_CL_first{\global\c_tabl_tabulate_localcolorspan\plusone \tabl_tabulate_set_color_column\zerocount}
2100\permanent\protected\def\tabl_tabulate_CM_first{\global\c_tabl_tabulate_localcolorspan\plustwo \tabl_tabulate_set_color_column\zerocount}
2101\permanent\protected\def\tabl_tabulate_CR_first{\global\c_tabl_tabulate_localcolorspan\plusthree\tabl_tabulate_set_color_column\zerocount}
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138\installcorenamespace{tabulatemove}
2139
2140\installcommandhandler \??tabulatemove {tabulatemove} \??tabulatemove
2141
2142\setuptabulatemove
2143 [\c!xoffset=\zeropoint,
2144 \c!yoffset=\zeropoint,
2145 \c!orientation=]
2146
2147\noaligned\permanent\tolerant\protected\def\tabl_tabulate_TM_yes[#S#1]#*[#S#2]
2148 {\beginlocalcontrol
2149 \ifhastok={#1}
2150 \setupcurrenttabulatemove[#1]
2151 \else
2152 \cdef\currenttabulatemove{#1}
2153 \setupcurrenttabulatemove[#2]
2154 \fi
2155 \edef\p_orientation{\theorientation{\tabulatemoveparameter\c!orientation}}
2156 \edef\p_xoffset {\tabulatemoveparameter\c!xoffset}
2157 \edef\p_yoffset {\tabulatemoveparameter\c!yoffset}
2158 \scratchyoffset
2159 \ifx\p_yoffset\v!depth
2160 \strutdp
2161 \orelse\ifx\p_yoffset\v!height
2162 \strutht
2163 \else
2164 \p_yoffset
2165 \fi
2166 \relax
2167 \scratchxoffset\p_xoffset\relax
2168 \xdef\tabl_tabulate_tm
2169 {\ifzeropt\scratchxoffset\else\s!xmove \the\scratchxoffset\fi
2170 \ifzeropt\scratchyoffset\else\s!ymove \the\scratchyoffset\fi
2171 \ifzero \p_orientation \else\s!orientation\p_orientation \fi
2172 }
2173 \endlocalcontrol
2174 \noalign\tabl_tabulate_tm{}}
2175
2176\noaligned\permanent\tolerant\protected\def\tabl_tabulate_TM_nop[#S#1]#*[#S#2]
2177 {}
2178
2179\lettonothing\tabl_tabulate_tm
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205\permanent\tolerant\protected\def\tabl_tabulate_NI_first[#1]{\NC\itemtag[#1]\NC}
2206
2207
2208
2209\permanent\protected\def\tabl_tabulate_BC_first
2210 {\tabl_tabulate_column_normal\plusone\zerocount
2211 \let\fontstyle\globalfontstyle
2212 \bf}
2213
2214\appendtoks
2215 \enforced\let\VL\tabl_tabulate_VL_first
2216 \enforced\let\NC\tabl_tabulate_NC_first
2217 \enforced\let\BC\tabl_tabulate_BC_first
2218 \enforced\let\RC\tabl_tabulate_RC_first
2219 \enforced\let\HC\tabl_tabulate_HC_first
2220 \enforced\let\EQ\tabl_tabulate_EQ_first
2221 \enforced\let\RQ\tabl_tabulate_RQ_first
2222 \enforced\let\HQ\tabl_tabulate_HQ_first
2223 \enforced\let\NG\tabl_tabulate_NG_first
2224 \enforced\let\NN\tabl_tabulate_NN_first
2225 \enforced\let\ND\tabl_tabulate_ND_first
2226 \enforced\let\NR\tabl_tabulate_NR_first
2227 \enforced\let\NB\tabl_tabulate_NB_first
2228 \enforced\let\CC\tabl_tabulate_CC_first
2229 \enforced\let\CL\tabl_tabulate_CL_first
2230 \enforced\let\CM\tabl_tabulate_CM_first
2231 \enforced\let\CR\tabl_tabulate_CR_first
2232 \enforced\let\NI\tabl_tabulate_NI_first
2233\to \t_tabl_tabulate_initializers_first
2234
2235\appendtoks
2236 \enforced\let\NR\tabl_tabulate_NR_second
2237 \enforced\let\NB\tabl_tabulate_NB_second
2238 \enforced\let\TM\tabl_tabulate_TM_yes
2239\to \t_tabl_tabulate_initializers_second
2240
2241\appendtoks
2242 \enforced\let\SR\NR
2243 \enforced\let\FR\NR
2244 \enforced\let\MR\NR
2245 \enforced\let\LR\NR
2246 \enforced\let\AR\NR
2247 \enforced\let\TM\tabl_tabulate_TM_nop
2248\to \t_tabl_tabulate_initializers_first
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272\permanent\tolerant\protected\def\tabl_tabulate_NR_common#1#2
2273 {\global\advanceby\c_tabl_tabulate_noflines\plusone
2274 \global\c_tabl_tabulate_firstflushed\conditionalfalse
2275 \global\c_tabl_tabulate_equal\conditionalfalse
2276 \global\c_tabl_tabulate_column\zerocount
2277 \ifconditional#1\relax
2278 \tabl_tabulate_break_state_reset
2279 \fi
2280 \tabl_tabulate_pheight_reset
2281 \unskip\unskip\crcr\tabl_tabulate_flush_collected
2282
2283
2284 \noalign{\expand\t_tabl_tabulate_every_after_row#2\ignorepars}}
2285
2286\def\tabl_tabulate_check_penalties
2287 {\ifconditional\c_tabl_tabulate_tolerant_break\else
2288 \ifnum\c_tabl_tabulate_totalnoflines=\plusone
2289
2290 \else
2291 \ifconditional\c_tabl_tabulate_someamble \ifcase\c_tabl_tabulate_repeathead \else
2292 \tabl_tabulate_break_allow
2293 \fi \fi
2294 \ifnum\c_tabl_tabulate_noflines=\plusone
2295 \tabl_tabulate_nobreak_inject
2296 \orelse\ifnum\c_tabl_tabulate_noflines=\c_tabl_tabulate_minusnoflines
2297 \ifnum\c_tabl_tabulate_plines_max<\plustwo
2298 \tabl_tabulate_nobreak_inject
2299 \else
2300 \tabl_tabulate_break_allow
2301 \fi
2302 \else
2303 \tabl_tabulate_break_state_allowbreak
2304 \fi
2305 \fi
2306 \fi
2307 \global\c_tabl_tabulate_firstflushed\conditionalfalse
2308 \ifconditional\c_tabl_tabulate_no_interline_space
2309 \nointerlineskip
2310 \injectzerobaselineskip
2311 \fi}
2312
2313\protected\def\tabl_tabulate_bbskip_second_split_yes
2314 {\ifvoid\b_tabl_tabulate_current\c_tabl_tabulate_column
2315 \ifempty\tabl_tabulate_flush_collected_indeed\else
2316 \setbox0\hbox
2317 \fi
2318 \fi}
2319
2320\protected\def\tabl_tabulate_eskip_second
2321 {\par
2322 \ifconditional\c_tabl_tabulate_no_blank_in_paragraphs
2323 \removelastskip
2324 \fi
2325 \egroup
2326 \tabl_tabulate_pheight_set
2327 \glet\tabl_tabulate_hook\tabl_tabulate_hook_yes
2328 \tabl_tabulate_splitoff_box}
2329
2330\protected\def\tabl_tabulate_bskip_second_split_yes
2331 {\ifvoid\b_tabl_tabulate_current\c_tabl_tabulate_column
2332
2333 \global\setbox\b_tabl_tabulate_current\c_tabl_tabulate_column\vbox
2334 \bgroup
2335 \ifconditional\c_tabl_tabulate_no_blank_in_paragraphs
2336 \inhibitblank
2337 \fi
2338 \glet\tabl_tabulate_hook\tabl_tabulate_hook_nop
2339 \ifconditional\c_tabl_tabulate_automode\hsize\d_tabl_tabulate_width\fi
2340
2341
2342 \let\tabl_tabulate_eskip\tabl_tabulate_eskip_second
2343 \expandafter\ignorepars
2344 \else
2345
2346 \lettonothing\tabl_tabulate_eskip
2347
2348 \glet\tabl_tabulate_hook\tabl_tabulate_hook_yes
2349 \expandafter\tabl_tabulate_splitoff_box
2350 \fi}
2351
2352\protected\def\tabl_tabulate_xbskip_second{\tabl_tabulate_bskip}
2353\protected\def\tabl_tabulate_xeskip_second{\tabl_tabulate_eskip}
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375\newconditional\c_tabl_tabulate_split_done
2376
2377\protected\def\tabl_tabulate_flush_second_indeed
2378 {\glettonothing\tabl_tabulate_flush_collected_indeed
2379 \global\c_tabl_tabulate_column\zerocount
2380 \tabl_tabulate_pbreak_check
2381 \global\c_tabl_tabulate_split_done\conditionalfalse
2382 \localcontrolledloop\plusone\c_tabl_tabulate_columns\plusone{\tabl_tabulate_flush_second_step}
2383 \ifconditional\c_tabl_tabulate_split_done\else
2384 \glet\tabl_tabulate_tm\s!reset
2385 \fi
2386 \global\c_tabl_tabulate_firstflushed\conditionaltrue}
2387
2388\protected\def\tabl_tabulate_flush_second_step
2389 {\ifvoid\b_tabl_tabulate_current\currentloopiterator
2390 \else
2391 \gdef\tabl_tabulate_flush_collected_indeed{\expand\t_tabl_tabulate_dummy}
2392 \ifvoid\b_tabl_tabulate_current\currentloopiterator \else
2393 \global\c_tabl_tabulate_split_done\conditionaltrue
2394 \fi
2395 \fi}
2396
2397\def\tabl_tabulate_flush_second
2398 {\noalign{\tabl_tabulate_flush_second_indeed}
2399 \noalign\tabl_tabulate_tm{\ifx\tabl_tabulate_tm\s!reset\glettonothing\tabl_tabulate_tm\fi}
2400 \tabl_tabulate_flush_collected_indeed}
2401
2402\protected\def\tabl_tabulate_bskip_second_split_nop
2403
2404 {\vtop\bgroup
2405 \ifconditional\c_tabl_tabulate_automode\hsize\d_tabl_tabulate_width\fi
2406\inhibitblank
2407
2408
2409 \ignorepars}
2410
2411\protected\def\tabl_tabulate_eskip_second_split_nop
2412 {\par\verticalstrut
2413 \vskip\struttotal
2414 \egroup}
2415
2416
2417
2418
2419\appendtoks
2420 \let\tabl_tabulate_xbskip\tabl_tabulate_xbskip_second
2421 \let\tabl_tabulate_xeskip\tabl_tabulate_xeskip_second
2422 \ifconditional\c_tabl_tabulate_split
2423 \let\tabl_tabulate_bskip \tabl_tabulate_bskip_second_split_yes
2424 \let\tabl_tabulate_bbskip\tabl_tabulate_bbskip_second_split_yes
2425 \else
2426 \let\tabl_tabulate_bskip \tabl_tabulate_bskip_second_split_nop
2427 \let\tabl_tabulate_eskip \tabl_tabulate_eskip_second_split_nop
2428 \fi
2429\to \t_tabl_tabulate_initializers_second
2430
2431
2432
2433
2434
2435
2436
2437
2438\permanent\tolerant\noaligned\protected\def\tabl_tabulate_XX_none [#1]{\noalign{\tabl_tabulate_break_state_set}}
2439
2440\permanent\tolerant\noaligned\protected\def\tabl_tabulate_FL_second[#1]{\noalign{\tabl_tabulate_hrule_preset[#1]\tabl_tabulate_FL_second_indeed}}
2441\permanent\tolerant\noaligned\protected\def\tabl_tabulate_ML_second[#1]{\noalign{\tabl_tabulate_hrule_preset[#1]\tabl_tabulate_ML_second_indeed}}
2442\permanent\tolerant\noaligned\protected\def\tabl_tabulate_LL_second[#1]{\noalign{\tabl_tabulate_hrule_preset[#1]\tabl_tabulate_LL_second_indeed}}
2443\permanent\tolerant\noaligned\protected\def\tabl_tabulate_TL_second[#1]{\noalign{\tabl_tabulate_hrule_preset[#1]\tabl_tabulate_TL_second_indeed}}
2444\permanent\tolerant\noaligned\protected\def\tabl_tabulate_BL_second[#1]{\noalign{\tabl_tabulate_hrule_preset[#1]\tabl_tabulate_BL_second_indeed}}
2445
2446\protected\def\tabl_tabulate_FL_second_indeed
2447 {\ifinsidefloat\orelse\ifempty{\tabulationparameter\c!before}
2448 \tabl_tabulate_baselinecorrection
2449 \fi
2450 \tabl_tabulate_hrule_inject
2451 \tabl_tabulate_nobreak_inject
2452 \tabl_tabulate_column_rule_separator_inject
2453 \prevdepth\strutdp
2454 \tabl_tabulate_nobreak_inject}
2455
2456\def\spac_vspacing_no_topskip
2457 {\c_attr_skipcategory\plusten}
2458
2459\protected\def\tabl_tabulate_ML_second_indeed
2460 {\tabl_tabulate_break_no
2461 \tabl_tabulate_column_rule_separator_inject
2462 \tabl_tabulate_break_no
2463 \tabl_tabulate_hrule_inject
2464 \vskip\p_rulethickness\relax
2465 \begingroup
2466 \spac_vspacing_no_topskip
2467 \tabl_tabulate_hrule_inject
2468 \endgroup
2469 \tabl_tabulate_break_no
2470 \tabl_tabulate_column_rule_separator_inject}
2471
2472\protected\def\tabl_tabulate_LL_second_indeed
2473 {\tabl_tabulate_nobreak_inject
2474 \tabl_tabulate_column_rule_separator_inject
2475 \tabl_tabulate_nobreak_inject
2476 \tabl_tabulate_hrule_inject
2477 \ifinsidefloat
2478 \tabl_tabulate_inside_inbetween
2479 \else
2480 \tabl_tabulate_outside_inbetween
2481 \fi}
2482
2483\protected\def\tabl_tabulate_TL_second_indeed
2484 {\tabl_tabulate_nobreak_inject
2485 \tabl_tabulate_column_rule_separator_inject
2486 \tabl_tabulate_nobreak_inject
2487 \tabl_tabulate_hrule_inject
2488 \tabl_tabulate_nobreak_inject
2489 \tabl_tabulate_column_rule_separator_inject
2490
2491 \tabl_tabulate_nobreak_inject}
2492
2493\let\tabl_tabulate_BL_second_indeed\tabl_tabulate_TL_second_indeed
2494
2495\permanent\def\tabl_tabulate_HL_second
2496 {\csname
2497 \ifnum\c_tabl_tabulate_noflines=\zerocount F\orelse
2498
2499 \ifnum\c_tabl_tabulate_noflines=\c_tabl_tabulate_totalnoflines L\else
2500 M\fi
2501 L\endcsname}
2502
2503\appendtoks
2504 \enforced\let\FL\tabl_tabulate_XX_none
2505 \enforced\let\ML\tabl_tabulate_XX_none
2506 \enforced\let\LL\tabl_tabulate_XX_none
2507 \enforced\let\TL\tabl_tabulate_XX_none
2508 \enforced\let\BL\tabl_tabulate_XX_none
2509 \enforced\let\HL\tabl_tabulate_XX_none
2510 \enforced\let\HR\tabl_tabulate_XX_none
2511\to \t_tabl_tabulate_initializers_first
2512
2513\appendtoks
2514 \enforced\let\FL\tabl_tabulate_FL_second
2515 \enforced\let\ML\tabl_tabulate_ML_second
2516 \enforced\let\LL\tabl_tabulate_LL_second
2517 \enforced\let\TL\tabl_tabulate_TL_second
2518 \enforced\let\BL\tabl_tabulate_BL_second
2519 \enforced\let\HL\tabl_tabulate_HL_second
2520 \enforced\let\HR\tabl_tabulate_HL_second
2521\to \t_tabl_tabulate_initializers_second
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544\permanent\def\tabulaterule {\HR}
2545\permanent\def\tabulateline {\HL}
2546\permanent\def\tabulateautorule{\HR}
2547\permanent\def\tabulateautoline{\HL}
2548
2549
2550
2551
2552
2553
2554
2555
2556\lettonothing\tabl_tabulate_flush_collected
2557\lettonothing\tabl_tabulate_flush_collected_indeed
2558
2559\let\v_tabl_tabulate_align\!!zerocount
2560
2561\def\tabl_tabulate_check_side_float
2562 {\ifdefined\page_sides_check_floats_indeed
2563 \page_sides_check_floats_indeed
2564 \ifdim\hangindent>\zeropoint
2565 \advanceby\d_tabl_tabulate_indent\hangindent
2566 \fi
2567 \fi}
2568
2569\def\tabl_tabulate_set_local_hsize
2570 {\setlocalhsize
2571 \hsize\localhsize}
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599\protected\def\tabl_tabulate_anchor_indeed
2600 {\edef\xanchor{\the\c_tabl_tabulate_column}
2601 \edef\yanchor{\the\c_tabl_tabulate_nofrealrows}
2602 \markanchor{matrix}{\c_tabl_tabulate_column}{\c_tabl_tabulate_nofrealrows}}
2603
2604\def\tabl_tabulate_anchor_setup
2605 {\edef\p_synchronize{\tabulationparameter\c!synchronize}
2606 \ifx\p_synchronize\v!background
2607 \cdef\currentframedcontent{\tabulationparameter\c!frame}
2608 \ifx\currentframedcontent\v!off
2609 \resettabulationparameter\c!frame
2610 \lettonothing\currentframedcontent
2611 \letframedcontentparameter\c!frame\v!off
2612 \fi
2613 \letframedcontentparameter\c!synchronize\p_synchronize
2614 \setframedcontentparameter\c!background {\tabulationparameter\c!background}
2615 \enforced\let\tabl_tabulate_anchor\tabl_tabulate_anchor_indeed
2616 \setlocalanchoring
2617 \fi}
2618
2619\permanent\protected\lettonothing\tabl_tabulate_anchor
2620
2621\def\tabl_tabulate_process
2622 {\c_tabl_tabulate_pass\plusone
2623 \tabl_tabulate_check_full_content
2624 \edef\v_tabl_tabulate_align{\ifcsname\??tabulatealigning\p_align\endcsname\lastnamedcs\else0\fi}
2625 \s_tabl_tabulate_first.5\d_tabl_tabulate_unit
2626 \s_tabl_tabulate_last\s_tabl_tabulate_first
2627 \s_tabl_tabulate_pre\zeroskip
2628 \s_tabl_tabulate_post\zeroskip
2629
2630 \c_tabl_post_is_set\conditionalfalse
2631 \global\c_tabl_tabulate_columns\zerocount
2632 \global\c_tabl_tabulate_nofauto\zerocount
2633 \global\c_tabl_tabulate_noflines\zerocount
2634 \c_tabl_tabulate_totalnoflines\zerocount
2635 \c_tabl_tabulate_minusnoflines\zerocount
2636 \global\d_tabl_tabulate_width_p\zeropoint
2637 \global\d_tabl_tabulate_width_w\zeropoint
2638 \global\c_tabl_tabulate_equal\conditionalfalse
2639 \tabl_tabulate_pheight_reset
2640 \tabskip\zeroskip
2641 \ifinsidesplitfloat
2642 \donetrue
2643 \orelse\ifinsidefloat
2644 \donefalse
2645 \else
2646 \donetrue
2647 \fi
2648 \global\c_tabl_tabulate_repeathead
2649 \ifdone
2650 \ifcsname\??tabulateheader\tabulationparameter\c!header\endcsname
2651 \lastnamedcs
2652 \else
2653 \zerocount
2654 \fi
2655 \else
2656 \zerocount
2657 \fi
2658
2659 \expand\t_tabl_tabulate_initializers_first
2660
2661 \glettonothing\tabl_tabulate_flush_collected
2662 \ifdim\d_tabl_tabulate_margin>\zeropoint
2663 \t_tabl_tabulate_preamble
2664 {\aligntab
2665 \tabl_tabulate_flush_indent
2666
2667 \strut
2668 \aligncontent
2669 \tabskip\d_tabl_tabulate_margin
2670 \strut
2671 \aligntab
2672 \aligncontent
2673 \tabskip\zeropoint}
2674 \else
2675 \t_tabl_tabulate_preamble
2676 {\aligntab
2677 \tabl_tabulate_flush_indent
2678
2679 \strut
2680 \aligncontent
2681 \aligntab
2682 \aligncontent
2683 \tabskip\zeroskip}
2684 \fi
2685 \d_tabl_tabulate_width\zeropoint
2686
2687 \c_tabl_tabulate_nofcolumns \zerocount
2688 \c_tabl_tabulate_has_rule_spec_first\zerocount
2689 \c_tabl_tabulate_has_rule_spec_last \zerocount
2690 \clf_presettabulate{\detokenizedtabulationparameter\c!format}
2691
2692
2693 \d_tabl_tabulate_width\zeropoint
2694 \tabl_tabulate_initialize_boxes\c_tabl_tabulate_columns
2695 \toksapp\t_tabl_tabulate_preamble{
2696 \aligntab
2697 \aligncontent
2698 \global\advanceby\c_tabl_tabulate_column\plusone
2699 }
2700 \toksapp\t_tabl_tabulate_dummy{
2701 \NC\unskip\unskip\crcr\tabl_tabulate_flush_collected
2702 }
2703 \global\c_tabl_tabulate_column\zerocount
2704 \tabl_tabulate_pheight_reset
2705 \glet\tabl_tabulate_hook\tabl_tabulate_hook_yes
2706 \ifx\p_indenting\v!no
2707 \forgetparindent
2708 \fi
2709 \ifinsidefloat
2710 \d_tabl_tabulate_indent\zeropoint
2711 \else
2712 \tabl_tabulate_check_side_float
2713 \tabl_tabulate_set_local_hsize
2714 \fi
2715 \dontcomplain
2716 \forgetall
2717 \everypar\everytabulatepar
2718 \setbox\scratchbox\vbox
2719 {\notesenabledfalse
2720 \d_tabl_tabulate_indent\zeropoint
2721 \settrialtypesetting
2722 \anch_backgrounds_text_level_start
2723 \halign
2724 \ifconditional\c_tabl_sparse_skips \s!noskips\fi
2725 \ifconditional\c_tabl_auto_align_mode_new \alignmentcharactertrigger\fi
2726 \expandafter{\the\t_tabl_tabulate_preamble\crcr\tabl_tabulate_insert_content\crcr}}
2727 \anch_backgrounds_text_level_stop
2728 \ifcase\c_anch_backgrounds_text_state\else
2729 \global\tablehaspositions\conditionaltrue
2730 \fi
2731 \ifnum\c_tabl_tabulate_nofauto>\zerocount
2732
2733 \d_tabl_tabulate_width\dimexpr\hsize\wd\scratchbox\d_tabl_tabulate_width_p\d_tabl_tabulate_width_w\relax
2734 \ifnum\c_tabl_tabulate_nofauto>\zerocount
2735 \divideby\d_tabl_tabulate_width \c_tabl_tabulate_nofauto\relax
2736 \fi
2737 \fi
2738 \setbox\scratchbox\emptybox
2739 \ifconditional\c_tabl_tabulate_split
2740 \splittopskip\strutht
2741 \glettonothing\tabl_tabulate_flush_collected_indeed
2742 \glet\tabl_tabulate_flush_collected\tabl_tabulate_flush_second
2743 \fi
2744 \c_tabl_tabulate_totalnoflines\c_tabl_tabulate_noflines
2745 \c_tabl_tabulate_minusnoflines\numexpr\c_tabl_tabulate_noflines\minusone\relax
2746 \global\c_tabl_tabulate_noflines\zerocount
2747
2748 \c_tabl_tabulate_pass\plustwo
2749 \expand\t_tabl_tabulate_initializers_second
2750
2751 \ifx\p_line\v!line
2752 \enforced\let\HL\HR
2753 \enforced\let\tabulateautoline\tabulateautorule
2754 \enforced\let\tabulateline \tabulaterule
2755 \fi
2756
2757 \ifcase\c_tabl_tabulate_repeathead
2758 \ifinsidesplitfloat
2759 \global\setbox\b_tabl_tabulate\vbox \bgroup
2760 \else
2761 \tabl_tabulate_anchor_setup
2762 \startframedcontent[\tabulationparameter\c!frame]
2763 \fi
2764 \else
2765 \global\setbox\b_tabl_tabulate\vbox \bgroup
2766 \fi
2767
2768 \tabl_tabulate_tag_start
2769 \tabl_tabulate_tag_start_row
2770 \inhibitmargindata\conditionalfalse
2771 \toksapp\everycr{\noalign{\the\t_tabl_tabulate_every_real_row\tabl_tabulate_tag_stop_row\tabl_tabulate_tag_start_row\empty}}
2772 \halign
2773 \ifconditional\c_tabl_sparse_skips \s!noskips\fi
2774 \ifconditional\c_tabl_auto_align_mode_new \alignmentcharactertrigger\fi
2775 \expandafter{\the\t_tabl_tabulate_preamble\crcr\tabl_tabulate_insert_content\crcr}
2776 \tabl_tabulate_tag_stop_row
2777 \tabl_tabulate_tag_stop
2778 \ifhmode\par\prevdepth\strutdp\fi
2779 \ifx\p_distance\v!grid
2780 \vskip\strutdp
2781 \fi
2782
2783 \ifcase\c_tabl_tabulate_repeathead
2784 \ifinsidesplitfloat
2785 \egroup
2786 \egroup
2787 \tabl_split_box\b_tabl_tabulate
2788 \else
2789 \stopframedcontent
2790 \egroup
2791 \fi
2792 \else
2793 \egroup
2794 \egroup
2795 \tabl_split_box\b_tabl_tabulate
2796 \fi
2797
2798 \ifinsidefloat
2799 \tabl_tabulate_inside_after
2800 \else
2801 \tabl_tabulate_outside_after
2802 \fi
2803 \egroup}
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824\def\tabl_split_box#1
2825 {\ifinsidesplitfloat
2826 \tabl_split_box_indeed#1
2827 \orelse\ifinsidefloat
2828 \unvbox#1
2829 \else
2830 \tabl_split_box_indeed#1
2831 \fi}
2832
2833\def\tabl_split_box_indeed#1
2834 {\resettsplit
2835 \c_split_minimum_free_lines\plustwo
2836 \d_split_minimum_free_space\zeropoint
2837 \setbox\b_split_content\box#1
2838 \ifcase\c_tabl_tabulate_repeathead\or
2839 \setbox\b_split_head\vsplit\b_split_content upto \lineheight
2840 \or
2841 \setbox\b_split_head\vbox{\hbox{\strut\tabulationparameter\c!title}}
2842 \fi
2843 \handletsplit}
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868\permanent\tolerant\noaligned\protected\def\tabl_tabulate_TB_yes[#1]
2869 {\noalign\bgroup
2870 \unless\ifempty{#1}
2871 \blank[#1]
2872 \orelse\ifempty\m_tabl_tabulate_blank_default
2873 \blank
2874 \else
2875 \blank[\m_tabl_tabulate_blank_default]
2876 \fi
2877 \egroup}
2878
2879\permanent\tolerant\noaligned\protected\def\tabl_tabulate_TB_nop[#1]
2880 {}
2881
2882\appendtoks
2883 \enforced\let\TB\tabl_tabulate_TB_nop
2884\to \t_tabl_tabulate_initializers_first
2885
2886\appendtoks
2887 \enforced\let\TB\tabl_tabulate_TB_yes
2888\to \t_tabl_tabulate_initializers_second
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999\mutable\let\leg \relax
3000\mutable\let\fact\relax
3001
3002\definetabulate
3003 [\v!legend]
3004 [emj1i1mR]
3005
3006\setuptabulate
3007 [\v!legend]
3008 [\c!unit=.75em,\c!inner=\tabl_tabulate_set_quick\leg,EQ={=}]
3009
3010\definetabulate
3011 [\v!legend][\v!two]
3012 [emj1emk1i1mR]
3013
3014\definetabulate
3015 [\v!fact]
3016 [Recmj1i1mR]
3017
3018\setuptabulate
3019 [\v!fact]
3020 [\c!unit=.75em,\c!inner=\tabl_tabulate_set_quick\fact,EQ={=}]
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055\newconditional\c_tabl_generic
3056
3057\pushoverloadmode
3058
3059\permanent\protected\defcsname starttabulate\endcsname
3060 {\bgroup
3061 \c_tabl_generic\conditionaltrue
3062 \lettonothing\currenttabulationparent
3063 \tabl_start_regular}
3064
3065\permanent\letcsname stoptabulate\endcsname\relax
3066
3067\popoverloadmode
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082\def\tabl_tabulate_compact_row#1#2
3083 {\NC\tabl_tabulate_compact_step#1#2,\end,}
3084
3085\def\tabl_tabulate_compact_step#1#2#3,
3086 {\ifx#2\end
3087 \NR
3088 \expandafter\gobbleoneargument
3089 \else
3090 #1{#2#3}\NC
3091 \expandafter\tabl_tabulate_compact_step
3092 \fi#1}
3093
3094\permanent\protected\def\tabulaterow {\tabl_tabulate_compact_row\relax}
3095\permanent\protected\def\tabulaterowbold{\tabl_tabulate_compact_row\bold}
3096\permanent\protected\def\tabulaterowtype{\tabl_tabulate_compact_row\type}
3097\permanent\protected\def\tabulaterowtyp {\tabl_tabulate_compact_row\typ}
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177\lettonothing\m_table_current_row_background
3178\lettonothing\m_table_current_row_background_default
3179\lettonothing\m_table_current_row_background_filler
3180\lettonothing\m_table_current_row_background_default_filler
3181\lettonothing\m_table_current_row_background_auto
3182
3183\protected\def\tabl_register_row_background#1
3184 {\xdef\m_table_current_row_background{#1}}
3185
3186\protected\def\tabl_register_row_background_filler#1
3187 {\xdef\m_table_current_row_background_filler{#1}}
3188
3189\protected\def\tabl_synchronize_row_background
3190 {\iftrialtypesetting\else
3191 \ifempty\m_table_current_row_background_filler
3192 \ifempty\m_table_current_row_background
3193
3194 \tabl_synchronize_row_background_dummy
3195 \else
3196 \tabl_synchronize_row_background_indeed\m_table_current_row_background
3197 \fi
3198 \else
3199 \tabl_synchronize_row_background_filler_indeed\m_table_current_row_background_filler
3200 \fi
3201 \fi}
3202
3203\protected\def\tabl_synchronize_row_background_dummy
3204 {\iftrialtypesetting\else
3205 \begingroup
3206
3207 \clf_setbackgroundrowdata\c_tabl_tabulate_nofrealrows\zerocount\zeropoint
3208 \endgroup
3209 \fi}
3210
3211\protected\def\tabl_synchronize_row_background_indeed#1
3212 {\iftrialtypesetting\else
3213 \begingroup
3214 \clf_enablebackgroundalign
3215 \dousecolorparameter{#1}
3216 \setbox\scratchbox\hpack{}
3217
3218 \clf_setbackgroundrowdata\c_tabl_tabulate_nofrealrows\scratchbox\d_tabl_tabulate_indent
3219 \endgroup
3220 \fi}
3221
3222\protected\def\tabl_synchronize_row_background_filler_indeed#1
3223 {\iftrialtypesetting\else
3224 \begingroup
3225 \clf_enablebackgroundalign
3226 \node_linefiller_set{#1}
3227 \setbox\scratchbox\hpack{}
3228
3229 \clf_setbackgroundrowdata\c_tabl_tabulate_nofrealrows\scratchbox\d_tabl_tabulate_indent
3230 \endgroup
3231 \fi}
3232
3233\appendtoks
3234 \glettonothing\m_table_current_row_background
3235 \glettonothing\m_table_current_row_background_filler
3236 \global\c_tabl_tabulate_nofrealrows\zerocount
3237 \global\c_tabl_tabulate_autocolor\zerocount
3238 \clf_resetbackgroundrowdata
3239\to \t_tabl_tabulate_initializers_first
3240
3241\appendtoks
3242 \glettonothing\m_table_current_row_background
3243 \glettonothing\m_table_current_row_background_filler
3244 \global\c_tabl_tabulate_nofrealrows\zerocount
3245 \global\c_tabl_tabulate_autocolor\zerocount
3246 \clf_resetbackgroundrowdata
3247\to \t_tabl_tabulate_initializers_second
3248
3249\appendtoks
3250 \tabl_synchronize_row_background
3251\to \t_tabl_tabulate_every_real_row
3252
3253\appendtoks
3254 \glettonothing\m_table_current_row_background
3255 \glettonothing\m_table_current_row_background_filler
3256\to \t_tabl_tabulate_every_after_row
3257
3258\permanent\protected\def\tabl_tabulate_NL_first[#1]
3259 {\tabl_tabulate_column_normal\zerocount\zerocount\relax
3260 \ifcase\c_tabl_tabulate_column\or
3261 \tabl_register_row_background{#1}
3262 \fi
3263 \ignorepars}
3264
3265\pushoverloadmode
3266
3267
3268
3269 \permanent\overloaded\protected\def\tabl_tabulate_ND_first
3270 {\tabl_tabulate_column_normal\zerocount\zerocount\relax
3271 \ifcase\c_tabl_tabulate_column\or
3272 \tabl_register_row_background\m_table_current_row_background_default
3273 \fi
3274 \ignorepars}
3275
3276\popoverloadmode
3277
3278\permanent\protected\def\tabl_tabulate_LB_first[#1]
3279 {\tabl_tabulate_column_normal\plusone\zerocount\relax
3280 \ifcase\c_tabl_tabulate_column\or
3281 \tabl_register_row_background{#1}
3282 \fi
3283 \usetabulationstyleandcolor\c!foregroundstyle\c!foregroundcolor
3284 \ignorepars}
3285
3286\permanent\protected\def\tabl_tabulate_DB_first
3287 {\tabl_tabulate_column_normal\plusone\zerocount\relax
3288 \ifcase\c_tabl_tabulate_column\or
3289 \tabl_register_row_background\m_table_current_row_background_default
3290 \fi
3291 \enforced\let\fontstyle\globalfontstyle
3292 \usetabulationstyleandcolor\c!foregroundstyle\c!foregroundcolor
3293 \ignorepars}
3294
3295\permanent\protected\def\tabl_tabulate_NF_first[#1]
3296 {\tabl_tabulate_column_normal\zerocount\zerocount\relax
3297 \ifcase\c_tabl_tabulate_column\or
3298 \tabl_register_row_background_filler{#1}
3299 \fi
3300 \ignorepars}
3301
3302\permanent\protected\def\tabl_tabulate_NP_first
3303 {\tabl_tabulate_column_normal\zerocount\zerocount\relax
3304 \ifcase\c_tabl_tabulate_column\or
3305 \tabl_register_row_background_filler\m_table_current_row_background_default_filler
3306 \fi
3307 \ignorepars}
3308
3309\permanent\protected\def\tabl_tabulate_FB_first[#1]
3310 {\tabl_tabulate_column_normal\plusone\zerocount\relax
3311 \ifcase\c_tabl_tabulate_column\or
3312 \tabl_register_row_background_filler{#1}
3313 \fi
3314 \usetabulationstyleandcolor\c!foregroundstyle\c!foregroundcolor
3315 \ignorepars}
3316
3317\permanent\protected\def\tabl_tabulate_PB_first
3318 {\tabl_tabulate_column_normal\plusone\zerocount\relax
3319 \ifcase\c_tabl_tabulate_column\or
3320 \tabl_register_row_background_filler\m_table_current_row_background_default_filler
3321 \fi
3322 \enforced\let\fontstyle\globalfontstyle
3323 \usetabulationstyleandcolor\c!foregroundstyle\c!foregroundcolor
3324 \ignorepars}
3325
3326\pushoverloadmode
3327
3328 \permanent\overloaded\protected\def\tabl_tabulate_BC_first
3329 {\tabl_tabulate_column_normal\plusone\zerocount
3330 \enforced\let\fontstyle\globalfontstyle
3331 \ifempty\m_table_current_row_background
3332 \ifempty\m_table_current_row_background_filler
3333 \usetabulationstyleandcolor\c!headstyle\c!headcolor
3334 \else
3335 \usetabulationstyleandcolor\c!foregroundstyle\c!foregroundcolor
3336 \fi
3337 \else
3338 \usetabulationstyleandcolor\c!foregroundstyle\c!foregroundcolor
3339 \fi}
3340
3341\popoverloadmode
3342
3343\permanent\protected\def\tabl_tabulate_A_first
3344 {\global\advanceby\c_tabl_tabulate_autocolor\plusone
3345 \edef\m_table_current_row_background_auto{\tabulateparameter{\c!backgroundcolor:\the\c_tabl_tabulate_autocolor}}
3346 \ifempty\m_table_current_row_background_auto
3347 \global\c_tabl_tabulate_autocolor\plusone
3348 \edef\m_table_current_row_background_auto{\tabulateparameter{\c!backgroundcolor:\the\c_tabl_tabulate_autocolor}}
3349 \fi
3350 \ifempty\m_table_current_row_background_auto
3351 \lettonothing\m_table_current_row_background_auto
3352 \fi
3353 \tabl_register_row_background{\m_table_current_row_background_auto}}
3354
3355\permanent\protected\def\tabl_tabulate_NA_first
3356 {\tabl_tabulate_column_normal\zerocount\zerocount\relax
3357 \iftrialtypesetting\orelse\ifcase\c_tabl_tabulate_column\or
3358 \tabl_tabulate_A_first
3359 \fi
3360 \ignorepars}
3361
3362\permanent\protected\def\tabl_tabulate_BA_first
3363 {\tabl_tabulate_column_normal\plusone\zerocount\relax
3364 \iftrialtypesetting\orelse\ifcase\c_tabl_tabulate_column\or
3365 \tabl_tabulate_A_first
3366 \fi
3367 \usetabulationstyleandcolor\c!foregroundstyle\c!foregroundcolor
3368 \ignorepars}
3369
3370\appendtoks
3371 \enforced\let\NL\tabl_tabulate_NL_first
3372 \enforced\let\ND\tabl_tabulate_ND_first
3373 \enforced\let\LB\tabl_tabulate_LB_first
3374 \enforced\let\DB\tabl_tabulate_DB_first
3375 \enforced\let\NF\tabl_tabulate_NF_first
3376 \enforced\let\NP\tabl_tabulate_NP_first
3377 \enforced\let\FB\tabl_tabulate_FB_first
3378 \enforced\let\PB\tabl_tabulate_PB_first
3379 \enforced\let\NA\tabl_tabulate_NA_first
3380 \enforced\let\BA\tabl_tabulate_BA_first
3381\to \t_tabl_tabulate_initializers_first
3382
3383\appendtoks
3384 \edef\m_table_current_row_background_default{\tabulateparameter\c!backgroundcolor}
3385 \edef\m_table_current_row_background_default_filler{\tabulateparameter\c!background}
3386 \lettonothing\m_table_current_row_background_auto
3387\to \everytabulate
3388
3389\setuptabulate
3390 [\c!headcolor=,
3391 \c!headstyle=\bf,
3392 \c!backgroundcolor=\tabulationparameter\c!rulecolor,
3393 \c!foregroundcolor=,
3394 \c!foregroundstyle=\tabulationparameter\c!headstyle]
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411\installcorenamespace{tabulatespanb}
3412\installcorenamespace{tabulatespana}
3413
3414\noaligned\def\tabl_tabulate_span{\omit\span\omit\span\omit\span}
3415
3416
3417\letcsname\??tabulatespana l\endcsname\hfill
3418\letcsname\??tabulatespanb c\endcsname\hfill
3419\letcsname\??tabulatespana c\endcsname\hfill
3420\letcsname\??tabulatespanb m\endcsname\hfill
3421\letcsname\??tabulatespana m\endcsname\hfill
3422\letcsname\??tabulatespanb r\endcsname\hfill
3423
3424
3425\noaligned\tolerant\def\tabl_tabulate_NS[#1]#*[#2]
3426 {\NC\loopcs{#1}\tabl_tabulate_span
3427 \gdef\tabl_tabulate_kooh
3428 {\begincsname\??tabulatespana#2\endcsname
3429 \glet\tabl_tabulate_kooh\relax}
3430 \begincsname\??tabulatespanb#2\endcsname
3431 \ignorepars}
3432
3433\appendtoks
3434 \enforced\let\NS\tabl_tabulate_NS
3435\to \t_tabl_tabulate_initializers_first
3436
3437
3438
3439
3440
3441\protect \endinput
3442 |