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