Imported Upstream version 1.22.4
[platform/upstream/groff.git] / src / preproc / tbl / tbl.1.man
1 '\" t
2 .TH @G@TBL @MAN1EXT@ "@MDATE@" "groff @VERSION@"
3 .SH NAME
4 @g@tbl \- format tables for troff
5 .
6 .
7 .\" Save and disable compatibility mode (for, e.g., Solaris 10/11).
8 .do nr tbl_C \n[.C]
9 .cp 0
10 .
11 .
12 .\" ====================================================================
13 .\" Legal Terms
14 .\" ====================================================================
15 .\"
16 .\" Copyright (C) 1989-2018 Free Software Foundation, Inc.
17 .\"
18 .\" Permission is granted to make and distribute verbatim copies of this
19 .\" manual provided the copyright notice and this permission notice are
20 .\" preserved on all copies.
21 .\"
22 .\" Permission is granted to copy and distribute modified versions of
23 .\" this manual under the conditions for verbatim copying, provided that
24 .\" the entire resulting derived work is distributed under the terms of
25 .\" a permission notice identical to this one.
26 .\"
27 .\" Permission is granted to copy and distribute translations of this
28 .\" manual into another language, under the above conditions for
29 .\" modified versions, except that this permission notice may be
30 .\" included in translations approved by the Free Software Foundation
31 .\" instead of in the original English.
32 .
33 .
34 .\" Bernd Warken <groff-bernd.warken-72@web.de> added simple examples.
35 .\" ====================================================================
36 .SH SYNOPSIS
37 .\" ====================================================================
38 .
39 .SY @g@tbl
40 .OP \-Cv
41 .RI [ file
42 \&.\|.\|.\&]
43 .YS
44 .
45 .
46 .\" ====================================================================
47 .SH DESCRIPTION
48 .\" ====================================================================
49 .
50 This manual page describes the GNU version of
51 .BR tbl ,
52 which is part of the groff document formatting system.
53 .
54 .B tbl
55 compiles descriptions of tables embedded within
56 .B troff
57 input files into commands that are understood by
58 .BR troff .
59 .
60 Normally, it should be invoked using the
61 .B \-t
62 option of
63 .B groff.
64 .
65 It is highly compatible with Unix
66 .BR tbl .
67 .
68 The output generated by GNU
69 .B tbl
70 cannot be processed with Unix
71 .BR troff ;
72 it must be processed with GNU
73 .BR troff .
74 .
75 If no files are given on the command line or a filename of
76 .B \-
77 is given, the standard input is read.
78 .
79 .
80 .\" ====================================================================
81 .SH OPTIONS
82 .\" ====================================================================
83 .
84 .TP
85 .B \-C
86 Enable compatibility mode to
87 recognize
88 .B .TS
89 and
90 .B .TE
91 even when followed by a character other than space or newline.
92 .
93 Leader characters (\[rs]a) are handled as interpreted.
94 .
95 .TP
96 .B \-v
97 Print the version number.
98 .
99 .
100 .\" ====================================================================
101 .SH "LANGUAGE OVERVIEW"
102 .\" ====================================================================
103 .
104 .B tbl
105 expects to find table descriptions wrapped in the
106 .B .TS
107 (table start) and
108 .B .TE
109 (table end) macros.
110 .
111 Within each such table sections, another table can be defined by
112 using the request
113 .B .T&
114 before the final command
115 .BR .TE .
116 .
117 Each table definition has the following structure:
118 .
119 .TP
120 .I Global options
121 This is optional.
122 .
123 This table part can use several of these options distributed in 1 or
124 more lines.
125 .
126 The
127 .I global option part
128 must always be finished by a
129 .B "semi-colon ;" .
130 .
131 .TP
132 .I Table format specification
133 .
134 This part must be given, it is not optional.
135 .
136 It determines the number of columns (cells) of the table.
137 .
138 Moreover each cell is classified by being central, left adjusted, or
139 numerical, etc.
140 .
141 This specification can have several lines, but must be finished by a
142 .B dot .
143 at the end of the last line.
144 .
145 After each cell definition,
146 .I column specifiers
147 can be appended, but that's optional.
148 .
149 .
150 .P
151 Cells are separated by a tab character by default.
152 .
153 That can be changed by the
154 .I global option
155 .BI tab( c )\c
156 ,
157 where
158 .I c
159 is an arbitrary character.
160 .
161 .
162 .\" ====================================================================
163 .SH "SIMPLE EXAMPLES"
164 .\" ====================================================================
165 .
166 The easiest table definition is.
167 .RS
168 .EX
169 \&.TS
170 c c c .
171 This    is      centered
172 Well,   this    also
173 \&.TE
174 .EE
175 .RE
176 .
177 .
178 By using
179 .B c c
180 .BR c ,
181 each cell in the whole table will be centered.
182 .
183 The separating character is here the default
184 .IR tab .
185 .
186 .
187 .P
188 The result is
189 .RS
190 .TS
191 c c c .
192 This    is      centered
193 Well,   this    also
194 .TE
195 .RE
196 .
197 .
198 .P
199 This definition is identical to
200 .RS
201 .EX
202 \&.TS
203 tab(@);
204 ccc.
205 This@is@centered
206 Well,@this@also
207 \&.TE
208 .EE
209 .RE
210 .
211 Here, the separating tab character is changed to the letter
212 .BR @ .
213 .
214 .
215 .P
216 Moreover a title can be added and the centering directions can be
217 changed to many other formats:
218 .RS
219 .EX
220 \&.TS
221 tab(@);
222 c s s
223 l c n .
224 Title
225 left@centers@123
226 another@number@75
227 \&.TE
228 .EE
229 .RE
230 .
231 The result is
232 .RS
233 .TS
234 tab(@);
235 c s s
236 l c n .
237 Title
238 left@centers@123
239 another@number@75
240 .TE
241 .RE
242 .
243 Here
244 .B l
245 means
246 .IR left\-justified ,
247 and
248 .B n
249 means
250 .IR numerical ,
251 which is here
252 .IR right\-justified .
253 .
254 .
255 .\" ====================================================================
256 .SH USAGE
257 .
258 .\" ====================================================================
259 .SS Global options
260 .\" ====================================================================
261 .
262 The line immediately following the
263 .B .TS
264 macro may contain any of the following global options (ignoring the
265 case of characters \[en] Unix tbl only accepts options with all
266 characters lowercase or all characters uppercase), separated by
267 spaces, tabs, or commas:
268 .
269 .TP
270 .B allbox
271 Enclose each item of the table in a box.
272 .
273 .TP
274 .B box
275 Enclose the table in a box.
276 .
277 .TP
278 .B center
279 Center the table (default is left-justified).
280 .
281 The alternative keyword name
282 .B centre
283 is also recognized (this is a GNU tbl extension).
284 .
285 .TP
286 .BI decimalpoint( c )
287 Set the character to be recognized as the decimal point in numeric
288 columns (GNU tbl only).
289 .
290 .TP
291 .BI delim( xy )
292 Use
293 .I x
294 and\~\c
295 .I y
296 as start and end delimiters for
297 .BR @g@eqn (@MAN1EXT@).
298 .
299 .TP
300 .B doublebox
301 Enclose the table in a double box.
302 .
303 .TP
304 .B doubleframe
305 Same as doublebox (GNU tbl only).
306 .
307 .TP
308 .B expand
309 Make the table as wide as the current line length (providing a column
310 separation factor).
311 .
312 Ignored if one or more \[oq]x\[cq] column specifiers are used (see
313 below).
314 .
315 .IP
316 In case the sum of the column widths is larger than the current line length,
317 the column separation factor is set to zero; such tables extend into the
318 right margin, and there is no column separation at all.
319 .
320 .TP
321 .B frame
322 Same as box (GNU tbl only).
323 .
324 .TP
325 .BI linesize( n )
326 Set lines or rules (e.g.\& from
327 .BR box )
328 in
329 .IR n -point
330 type.
331 .
332 .TP
333 .B nokeep
334 Don't use diversions to prevent page breaks (GNU tbl only).
335 .
336 Normally
337 .B tbl
338 attempts to prevent undesirable breaks in boxed tables by using diversions.
339 .
340 This can sometimes interact badly with macro packages' own use of
341 diversions\[em]when footnotes, for example, are used.
342 .
343 .TP
344 .B nospaces
345 Ignore leading and trailing spaces in data items (GNU tbl only).
346 .
347 .TP
348 .B nowarn
349 Turn off warnings related to tables exceeding the current line width
350 (GNU tbl only).
351 .
352 .TP
353 .BI tab( x )
354 Use the character
355 .I x
356 instead of a tab to separate items in a line of input data.
357 .
358 .
359 .LP
360 The global options must end with a semicolon.
361 .
362 There might be whitespace between an option and its argument in
363 parentheses.
364 .
365 .
366 .\" ====================================================================
367 .SS Table format specification
368 .\" ====================================================================
369 .
370 After global options come lines describing the format of each line of
371 the table.
372 .
373 Each such format line describes one line of the table itself, except
374 that the last format line (which you must end with a period) describes
375 all remaining lines of the table.
376 .
377 A single-key character describes each column of each line of the table.
378 Key characters can be separated by spaces or tabs.
379 .
380 You may run format specifications for multiple lines together on the
381 same line by separating them with commas.
382 .
383 .
384 .LP
385 You may follow each key character with specifiers that determine the
386 font and point size of the corresponding item, that determine column
387 width, inter-column spacing, etc.
388 .
389 .
390 .LP
391 The longest format line defines the number of columns in the table;
392 missing format descriptors at the end of format lines are assumed to
393 be\~\c
394 .BR L .
395 .
396 Extra columns in the data (which have no corresponding format entry)
397 are ignored.
398 .
399 .
400 .LP
401 The available key characters are:
402 .
403 .TP
404 .BR a , A
405 Center longest line in this column and then left-justifies all other
406 lines in this column with respect to that centered line.
407 .
408 The idea is to use such alphabetic subcolumns (hence the name of the
409 key character) in combination with\~
410 .BR L ;
411 they are called subcolumns because
412 .BR A \~items
413 are indented by\~1n relative to
414 .BR L \~entries.
415 .
416 Example:
417 .RS
418 .IP
419 .EX
420 \&.TS
421 \&tab(;);
422 \&ln,an.
423 \&item one;1
424 \&subitem two;2
425 \&subitem three;3
426 \&.T&
427 \&ln,an.
428 \&item eleven;11
429 \&subitem twentytwo;22
430 \&subitem thirtythree;33
431 \&.TE
432 .EE
433 .RE
434 .
435 .IP
436 Result:
437 .
438 .RS
439 .IP
440 .TS
441 tab(;);
442 ln,an.
443 item one;1
444 subitem two;2
445 subitem three;3
446 .T&
447 ln,an.
448 item eleven;11
449 subitem twentytwo;22
450 subitem thirtythree;33
451 .TE
452 .RE
453 .
454 .TP
455 .BR c , C
456 Center item within the column.
457 .
458 .TP
459 .BR l , L
460 Left-justify item within the column.
461 .
462 .TP
463 .BR n , N
464 Numerically justify item in the column: Units positions of numbers are
465 aligned vertically.
466 .
467 If there is one or more dots adjacent to a digit, use the rightmost one for
468 vertical alignment.
469 .
470 If there is no dot, use the rightmost digit for vertical alignment;
471 otherwise, center the item within the column.
472 .
473 Alignment can be forced to a certain position using \[oq]\[rs]&\[cq];
474 if there is one or more instances of this special (non-printing)
475 character present within the data, use the leftmost one for alignment.
476 .
477 Example:
478 .RS
479 .IP
480 .EX
481 \&.TS
482 \&n.
483 \&1
484 \&1.5
485 \&1.5.3
486 \&abcde
487 \&a\[rs]&bcde
488 \&.TE
489 .EE
490 .RE
491 .
492 .IP
493 Result:
494 .
495 .RS
496 .IP
497 .TS
498 n.
499 1
500 1.5
501 1.5.3
502 abcde
503 a\&bcde
504 .TE
505 .RE
506 .
507 .IP
508 If numerical entries are combined with
509 .B L
510 or
511 .BR R \~entries
512 \[en] this can happen if the table format is changed with
513 .B .T&
514 \%\[en]
515 center the widest
516 .I number
517 (of the data entered under the
518 .BR N \~specifier
519 regime) relative to the widest
520 .B L
521 or
522 .BR R \~entry,
523 preserving the alignment of all numerical entries.
524 .
525 Contrary to
526 .BR A \~type
527 entries, there is no extra indentation.
528 .
529 .IP
530 Using equations (to be processed with
531 .BR eqn )
532 within columns which use the
533 .BR N \~specifier
534 is problematic in most cases due to
535 .BR tbl 's
536 algorithm for finding the vertical alignment, as described above.
537 .
538 Using the global
539 .B delim
540 option, however, it is possible to make
541 .B tbl
542 ignore the data within
543 .B eqn
544 delimiters for that purpose.
545 .
546 .
547 .TP
548 .BR r , R
549 Right-justify item within the column.
550 .
551 .TP
552 .BR s , S
553 Span previous item on the left into this column.
554 .
555 Not allowed for the first column.
556 .
557 .TP
558 .B ^
559 Span down entry from previous row in this column.
560 .
561 Not allowed for the first row.
562 .
563 .TP
564 .BR _ , -
565 Replace this entry with a horizontal line.
566 .
567 Note that \[oq]_\[cq] and \[oq]-\[cq] can be used for table fields only,
568 not for column separator lines.
569 .
570 .TP
571 .B =
572 .
573 Replace this entry with a double horizontal line.
574 .
575 Note that \[oq]=\[cq] can be used for table fields only,
576 not for column separator lines.
577 .
578 .TP
579 .B |
580 The corresponding column becomes a vertical rule (if two of these are
581 adjacent, a double vertical rule).
582 .
583 .
584 .LP
585 A vertical bar to the left of the first key letter or to the right of
586 the last one produces a line at the edge of the table.
587 .
588 .
589 .LP
590 To change the data format within a table, use the
591 .B .T&
592 command (at the start of a line).
593 .
594 It is followed by format and data lines (but no global options)
595 similar to the
596 .B .TS
597 request.
598 .
599 .
600 .\" ====================================================================
601 .SS Column specifiers
602 .\" ====================================================================
603 .
604 Here are the specifiers that can appear in suffixes to column key
605 letters (in any order):
606 .
607 .TP
608 .BR b , B
609 Short form of
610 .B fB
611 (make affected entries bold).
612 .
613 .TP
614 .BR d , D
615 Start an item that vertically spans rows,
616 using the \[oq]^\[cq] column specifier or \[oq]\[rs]^\[cq] data item,
617 at the bottom of its range rather
618 than vertically centering it (GNU tbl only).
619 .
620 Example:
621 .RS
622 .IP
623 .EX
624 \&.TS
625 \&tab(;) allbox;
626 \&l l
627 \&l ld
628 \&r ^
629 \&l rd.
630 \&0000;foobar
631 \&T{
632 \&1111
633 \&.br
634 \&2222
635 \&T};foo
636 \&r;
637 \&T{
638 \&3333
639 \&.br
640 \&4444
641 \&T};bar
642 \&\[rs]^;\[rs]^
643 \&.TE
644 .EE
645 .RE
646 .
647 .IP
648 Result:
649 .
650 .RS
651 .IP
652 .TS
653 tab(;) allbox;
654 l l
655 l ld
656 r ^
657 l rd.
658 0000;foobar
659 T{
660 1111
661 .br
662 2222
663 T};foo
664 r;
665 T{
666 3333
667 .br
668 4444
669 T};bar
670 \^;\^
671 .TE
672 .RE
673 .
674 .TP
675 .BR e , E
676 Make equally-spaced columns.
677 .
678 All columns marked with this specifier get the same width; this happens
679 after the affected column widths have been computed (this means that the
680 largest width value rules).
681 .
682 .TP
683 .BR f , F
684 Either of these specifiers may be followed by a font name (either one or two
685 characters long), font number (a single digit), or long name in parentheses
686 (the last form is a GNU tbl extension).
687 .
688 A one-letter font name must be separated by one or more blanks from whatever
689 follows.
690 .
691 .TP
692 .BR i , I
693 Short form of
694 .B fI
695 (make affected entries italic).
696 .
697 .TP
698 .BR m , M
699 This is a GNU tbl extension.
700 .
701 Either of these specifiers may be followed by a macro name
702 (either one or two characters long),
703 or long name in parentheses.
704 .
705 A one-letter macro name must be separated by one or more blanks from
706 whatever follows.
707 .
708 The macro which name can be specified here must be defined before
709 creating the table.
710 .
711 It is called just before the table's cell text is output.
712 .
713 As implemented currently, this macro is only called if block input is
714 used, that is, text between \[oq]T{\[cq] and \[oq]T}\[cq].
715 .
716 The macro should contain only simple
717 .B troff
718 requests to change the text block formatting, like text adjustment,
719 hyphenation, size, or font.
720 .
721 The macro is called
722 .I after
723 other cell modifications like
724 .BR b ,
725 .B f
726 or
727 .B v
728 are output.
729 .
730 Thus the macro can overwrite other modification specifiers.
731 .
732 .TP
733 .BR p , P
734 Followed by a number, this does a point size change for the affected fields.
735 .
736 If signed, the current point size is incremented or decremented (using
737 a signed number instead of a signed digit is a GNU tbl extension).
738 .
739 A point size specifier followed by a column separation number must be
740 separated by one or more blanks.
741 .
742 .TP
743 .BR t , T
744 Start an item vertically spanning rows at the top of its range rather than
745 vertically centering it.
746 .
747 .TP
748 .BR u , U
749 Move the corresponding column up one half-line.
750 .
751 .TP
752 .BR v , V
753 Followed by a number, this indicates the vertical line spacing to be
754 used in a multi-line table entry.
755 .
756 If signed, the current vertical line spacing is incremented or
757 decremented (using a signed number instead of a signed digit is a GNU
758 tbl extension).
759 .
760 A vertical line spacing specifier followed by a column separation
761 number must be separated by one or more blanks.
762 .
763 No effect if the corresponding table entry isn't a text block.
764 .
765 .TP
766 .BR w , W
767 Minimum column width value.
768 Must be followed either by a
769 .BR @g@troff (@MAN1EXT@)
770 width expression in parentheses or a unitless integer.
771 .
772 If no unit is given, en units are used.
773 .
774 Also used as the default line length for included text blocks.
775 .
776 If used multiple times to specify the width for a particular column,
777 the last entry takes effect.
778 .
779 .TP
780 .BR x , X
781 An expanded column.
782 .
783 After computing all column widths without an
784 .BR x \~specifier,
785 use the remaining line width for this column.
786 .
787 If there is more than one expanded column, distribute the remaining
788 horizontal space evenly among the affected columns (this is a GNU
789 extension).
790 .
791 This feature has the same effect as specifying a minimum column width.
792 .
793 .TP
794 .BR z , Z
795 Ignore the corresponding column for width-calculation purposes, this
796 is, don't use the fields but only the specifiers of this column to
797 compute its width.
798 .
799 .
800 .LP
801 A number suffix on a key character is interpreted as a column
802 separation in en units (multiplied in proportion if the
803 .B expand
804 option is on \[en] in case of overfull tables this might be zero).
805 .
806 Default separation is 3n.
807 .
808 .
809 .LP
810 The column
811 .RB specifier\~ x
812 is mutually exclusive with
813 .B e
814 .RB and\~ w
815 (but
816 .B e
817 is not mutually exclusive
818 .RB with\~ w );
819 if specified multiple times for a particular column, the last entry takes
820 effect:
821 .BR x \~unsets
822 both
823 .B e
824 .RB and\~ w ,
825 while either
826 .B e
827 or
828 .B w
829 .RB overrides\~ x .
830 .
831 .
832 .\" ====================================================================
833 .SS Table data
834 .\" ====================================================================
835 .
836 The format lines are followed by lines containing the actual data for the
837 table, followed finally by
838 .BR .TE .
839 .
840 Within such data lines, items are normally separated by tab characters
841 (or the character specified with the
842 .B tab
843 option).
844 .
845 Long input lines can be broken across multiple lines if the last
846 character on the line is \[oq]\[rs]\[cq] (which vanishes after
847 concatenation).
848 .
849 .
850 .LP
851 Note that
852 .B @g@tbl
853 computes the column widths line by line, applying \[rs]w on each entry
854 which isn't a text block.
855 .
856 As a consequence, constructions like
857 .IP
858 .EX
859 \&.TS
860 \&c,l.
861 \&\[rs]s[20]MM
862 \&MMMM
863 \&.TE
864 .EE
865 .
866 .LP
867 fail; you must either say
868 .IP
869 .EX
870 \&.TS
871 \&cp20,lp20.
872 \&MM
873 \&MMMM
874 \&.TE
875 .EE
876 .
877 .LP
878 or
879 .
880 .IP
881 .EX
882 \&.TS
883 \&c,l.
884 \&\[rs]s[20]MM
885 \&\[rs]s[20]MMMM
886 \&.TE
887 .EE
888 .
889 .
890 .LP
891 A dot starting a line, followed by anything but a digit is handled as
892 a troff command, passed through without changes.
893 .
894 The table position is unchanged in this case.
895 .
896 .
897 .LP
898 If a data line consists of only \[oq]_\[cq] or \[oq]=\[cq], a single
899 or double line, respectively, is drawn across the table at that point;
900 if a single item in a data line consists of only \[oq]_\[cq] or
901 \[oq]=\[cq], then that item is replaced by a single or double line,
902 joining its neighbours.
903 .
904 If a data item consists only of \[oq]\[rs]_\[cq] or \[oq]\[rs]=\[cq],
905 a single or double line, respectively, is drawn across the field at
906 that point which does not join its neighbours.
907 .
908 .
909 .LP
910 A data item consisting only of \[oq]\[rs]Rx\[cq] (\[oq]x\[cq] any
911 character) is replaced by repetitions of character \[oq]x\[cq] as wide
912 as the column (not joining its neighbours).
913 .
914 .
915 .LP
916 A data item consisting only of \[oq]\[rs]^\[cq] indicates that the
917 field immediately above spans downward over this row.
918 .
919 .
920 .\" ====================================================================
921 .SS Text blocks
922 .\" ====================================================================
923 .
924 A text block can be used to enter data as a single entry which would
925 be too long as a simple string between tabs.
926 .
927 It is started with \[oq]T{\[cq] and closed with \[oq]T}\[cq].
928 .
929 The former must end a line, and the latter must start a line, probably
930 followed by other data columns (separated with tabs or the character
931 given with the
932 .B tab
933 global option).
934 .
935 .
936 .LP
937 By default, the text block is formatted with the settings which were
938 active before entering the table, possibly overridden by the
939 .BR m ,
940 .BR v ,
941 and
942 .B w
943 tbl specifiers.
944 .
945 For example, to make all text blocks ragged-right, insert
946 .B .na
947 right before the starting
948 .B .TS
949 (and
950 .B .ad
951 after the table).
952 .
953 .
954 .LP
955 If either \[oq]w\[cq] or \[oq]x\[cq] specifiers are not given for
956 .I all
957 columns of a text block span, the default length of the text block (to
958 be more precise, the line length used to process the text block
959 diversion) is computed as L\[tmu]C/(N+1), where \[oq]L\[cq] is the
960 current line length, \[oq]C\[cq] the number of columns spanned by the
961 text block, and \[oq]N\[cq] the total number of columns in the table.
962 .
963 Note, however, that the actual diversion width as returned in register
964 .B \[rs]n[dl]
965 is used eventually as the text block width.
966 .
967 If necessary, you can also control the text block width with a direct
968 insertion of a
969 .B .ll
970 request right after \[oq]T{\[cq].
971 .
972 .
973 .\" ====================================================================
974 .SS Miscellaneous
975 .\" ====================================================================
976 .
977 The number register
978 .B \[rs]n[TW]
979 holds the table width; it can't be used within the table itself
980 but is defined right before calling
981 .B .TE
982 so that this macro can make use of it.
983 .
984 .
985 .LP
986 .B tbl
987 also defines a macro
988 .B .T#
989 which produces the bottom and side lines of a boxed table.
990 .
991 While
992 .B tbl
993 does call this macro itself at the end of the table, it can be used by
994 macro packages to create boxes for multi-page tables by calling it within the
995 page footer.
996 .
997 An example of this is shown by the
998 .B \-ms
999 macros which provide this functionality if a table starts with
1000 .B .TS\ H
1001 instead of the standard call to the
1002 .B .TS
1003 macro.
1004 .
1005 .
1006 .\" ====================================================================
1007 .SH "INTERACTION WITH @G@EQN"
1008 .\" ====================================================================
1009 .
1010 .BR @g@tbl (@MAN1EXT@)
1011 should always be called before
1012 .BR @g@eqn (@MAN1EXT@)
1013 .RB ( groff (@MAN1EXT@)
1014 automatically takes care of the correct order of preprocessors).
1015 .
1016 .
1017 .\" ====================================================================
1018 .SH "GNU TBL ENHANCEMENTS"
1019 .\" ====================================================================
1020 .
1021 There is no limit on the number of columns in a table, nor any limit on the
1022 number of text blocks.
1023 .
1024 All the lines of a table are considered in deciding column widths, not just
1025 the first 200.
1026 .
1027 Table continuation
1028 .RB ( .T& )
1029 lines are not restricted to the first 200 lines.
1030 .
1031 .
1032 .LP
1033 Numeric and alphabetic items may appear in the same column.
1034 .
1035 .
1036 .LP
1037 Numeric and alphabetic items may span horizontally.
1038 .
1039 .
1040 .LP
1041 .B @g@tbl
1042 uses register, string, macro and diversion names beginning with the digit\~\c
1043 .BR 3 .
1044 .
1045 When using
1046 .B @g@tbl
1047 you should avoid using any names beginning with a\~\c
1048 .BR 3 .
1049 .
1050 .
1051 .\" ====================================================================
1052 .SH "GNU TBL WITHIN MACROS"
1053 .\" ====================================================================
1054 .
1055 Since
1056 .B @g@tbl
1057 defines its own macros (right before each table) it is necessary to use
1058 an \[oq]end-of-macro\[cq] macro.
1059 .
1060 Additionally, the escape character has to be switched off.
1061 .
1062 Here an example.
1063 .IP
1064 .EX
1065 \&.eo
1066 \&.de ATABLE ..
1067 \&.TS
1068 \&allbox tab(;);
1069 \&cl.
1070 \&\[rs]$1;\[rs]$2
1071 \&.TE
1072 \&...
1073 \&.ec
1074 \&.ATABLE A table
1075 \&.ATABLE Another table
1076 \&.ATABLE And \[dq]another one\[dq]
1077 .EE
1078 .
1079 .
1080 .LP
1081 Note, however, that not all features of
1082 .B @g@tbl
1083 can be wrapped into a macro because
1084 .B @g@tbl
1085 sees the input earlier than
1086 .BR @g@troff .
1087 .
1088 For example, number formatting with vertically aligned decimal points
1089 fails if those numbers are passed on as macro parameters because
1090 decimal point alignment is handled by
1091 .B @g@tbl
1092 itself: It only sees \[oq]\[rs]$1\[cq], \[oq]\[rs]$2\[cq], etc., and
1093 therefore can't recognize the decimal point.
1094 .
1095 .
1096 .\" ====================================================================
1097 .SH BUGS
1098 .\" ====================================================================
1099 .
1100 You should use
1101 .BR .TS\ H / .TH
1102 in conjunction with a supporting macro package for
1103 .I all
1104 multi-page boxed tables.
1105 .
1106 If there is no header that you wish to appear at the top of each page
1107 of the table, place the
1108 .B .TH
1109 line immediately after the format section.
1110 .
1111 Do not enclose a multi-page table within keep/release macros,
1112 or divert it in any other way.
1113 .
1114 .
1115 .LP
1116 A text block within a table must be able to fit on one page.
1117 .
1118 .
1119 .LP
1120 The
1121 .B bp
1122 request cannot be used to force a page-break in a multi-page table.
1123 .
1124 Instead, define
1125 .B BP
1126 as follows
1127 .
1128 .IP
1129 .EX
1130 \&.de BP
1131 \&.  ie '\[rs]\[rs]n(.z'' .bp \[rs]\[rs]$1
1132 \&.  el \[rs]!.BP \[rs]\[rs]$1
1133 \&..
1134 .EE
1135 .
1136 .
1137 .LP
1138 and use
1139 .B BP
1140 instead of
1141 .BR bp .
1142 .
1143 .
1144 .LP
1145 Using \[rs]a directly in a table to get leaders does not work (except in
1146 compatibility mode).
1147 .
1148 This is correct behaviour: \[rs]a is an
1149 .B uninterpreted
1150 leader.
1151 .
1152 To get leaders use a real leader, either by using a control A or like
1153 this:
1154 .
1155 .IP
1156 .EX
1157 \&.ds a \[rs]a
1158 \&.TS
1159 \&tab(;);
1160 \&lw(1i) l.
1161 \&A\[rs]*a;B
1162 \&.TE
1163 .EE
1164 .
1165 .
1166 .LP
1167 A leading and/or trailing \[oq]|\[cq] in a format line, such as
1168 .
1169 .IP
1170 .EX
1171 |l r|.
1172 .EE
1173 .
1174 .
1175 .LP
1176 gives output which has a 1n\~space between the resulting
1177 bordering vertical rule and the content of the adjacent column,
1178 as in
1179 .
1180 .IP
1181 .EX
1182 \&.TS
1183 \&tab(#);
1184 \&|l r|.
1185 \&left column#right column
1186 \&.TE
1187 .EE
1188 .
1189 .
1190 .LP
1191 If it is desired to have zero space (so that the rule touches
1192 the content), this can be achieved by introducing extra \[lq]dummy\[rq]
1193 columns, with no content and zero separation, before and/or after,
1194 as in
1195 .
1196 .IP
1197 .EX
1198 \&.TS
1199 \&tab(#);
1200 \&r0|l r0|l.
1201 \&#left column#right column#
1202 \&.TE
1203 .EE
1204 .
1205 .
1206 .LP
1207 The resulting \[lq]dummy\[rq] columns are invisible and have zero width;
1208 note that such columns usually don't work with TTY devices.
1209 .
1210 .
1211 .\" ====================================================================
1212 .SH REFERENCE
1213 .\" ====================================================================
1214 Lesk, M.E.: "TBL \[en] A Program to Format Tables".
1215 For copyright reasons it cannot be included in the groff distribution,
1216 but copies can be found with a title search on the World Wide Web.
1217 .
1218 .
1219 .\" ====================================================================
1220 .SH "SEE ALSO"
1221 .\" ====================================================================
1222 .BR groff (@MAN1EXT@),
1223 .BR @g@troff (@MAN1EXT@)
1224 .
1225 .
1226 .\" Restore compatibility mode (for, e.g., Solaris 10/11).
1227 .cp \n[tbl_C]
1228 .
1229 .
1230 .\" Local Variables:
1231 .\" mode: nroff
1232 .\" End:
1233 .\" vim: set filetype=groff: