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