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