Imported Upstream version 1.22.4
[platform/upstream/groff.git] / contrib / hdtbl / groff_hdtbl.7.man
1 .TH GROFF_HDTBL @MAN7EXT@ "@MDATE@" "groff @VERSION@"
2 .SH NAME
3 groff_hdtbl \- Heidelberger table macros for GNU roff
4 .
5 .
6 .\" Save and disable compatibility mode (for, e.g., Solaris 10/11).
7 .do nr groff_hdtbl_C \n[.C]
8 .cp 0
9 .
10 .
11 .\" ====================================================================
12 .\" Legal Terms
13 .\" ====================================================================
14 .\"
15 .\" Copyright (C) 2005-2018 Free Software Foundation, Inc.
16 .\"
17 .\" This file is part of groff, the GNU roff type-setting system.
18 .\"
19 .\" Permission is granted to copy, distribute and/or modify this
20 .\" document under the terms of the GNU Free Documentation License,
21 .\" Version 1.3 or any later version published by the Free Software
22 .\" Foundation; with no Invariant Sections, with no Front-Cover Texts,
23 .\" and with no Back-Cover Texts.
24 .\"
25 .\" A copy of the Free Documentation License is included as a file
26 .\" called FDL in the main directory of the groff source package.
27 .
28 .
29 .ig
30   Some simple formatting macros.  Note that we use '.ig' here and not a
31   comment to make 'mandb' 2.4.1 (and probably more recent versions also)
32   happy; otherwise the '.char' lines and the stuff which follows is included
33   in the 'whatis' database.
34 ..
35 .
36 .
37 .char \[lB] \F[\n[.fam]]\f[R][
38 .char \[rB] \F[\n[.fam]]\f[R]]
39 .
40 .char \[or] \F[\n[.fam]]\f[R]\||\|
41 .char \[ell] \F[\n[.fam]]\f[R].\|.\|.
42 .
43 .char \[oq] \F[\n[.fam]]\f[R]\[oq]
44 .char \[cq] \F[\n[.fam]]\f[R]\[cq]
45 .
46 .
47 .ie F CR \{\
48 .
49 .  \" We have to solve the following problem.  In this code
50 .  \"
51 .  \"   foo
52 .  \"   .CR bar
53 .  \"   foo
54 .  \"
55 .  \" the space immediately after 'bar' should not be taken from the 'C'
56 .  \" family.  At the same time, this
57 .  \"
58 .  \"   foo
59 .  \"   .CR bar\c
60 .  \"   foo
61 .  \"
62 .  \" should work also.  To fulfill both constraints we emit the
63 .  \" family changing commands both as escapes and macro calls.
64 .
65 .  de make-C-macro
66 .    de C\\$1
67 .      ds old-fam \\\\n[.fam]
68 .      fam C
69 .      \\$2 \&\\\\$*\F[]\F[\\\\*[old-fam]]
70 .      fam
71 \\..
72 .  .
73 .
74 .  make-C-macro R nop
75 .  make-C-macro B B
76 .  make-C-macro I I
77 .
78 .  de make-C-macro
79 .    de C\\$1
80 .      ds old-fam \\\\n[.fam]
81 .      fam C
82 .      \\$1 \\\\$@ \F[]\F[\\\\*[old-fam]]
83 .      fam
84 \\..
85 .  .
86 .
87 .  make-C-macro BI
88 .  make-C-macro IB
89 .  make-C-macro RI
90 .  make-C-macro IR
91 .  make-C-macro BR
92 .  make-C-macro RB
93 .\}
94 .el \{\
95 .  ftr CR R
96 .  ftr CI I
97 .  ftr CB B
98 .  ftr CBI BI
99 .
100 .  de CR
101 .    nop \&\\$*
102 .  .
103 .  als CB B
104 .  als CI I
105 .
106 .  als CBI BI
107 .  als CIB IB
108 .  als CRI RI
109 .  als CIR IR
110 .  als CBR BR
111 .  als CRB RB
112 .\}
113 .
114 .
115 .
116 .de XB
117 .  B "\\$1"
118 .  shift
119 .  CR "\\$1\c"
120 .  shift
121 .  while \\n[.$] \{\
122 .    nop ,
123 .    CR "\\$1\c"
124 .    shift
125 .  \}
126 .  br
127 ..
128 .
129 .
130 .de XAA
131 .  TQ
132 .  CRI \\$@
133 ..
134 .
135 .
136 .de XDEF
137 .  br
138 .  B Default:
139 .  if !\\n[.$] \
140 .    return
141 .  CRI "\\$1" "\\$2"
142 ..
143 .
144 .
145 .de XDEFR
146 .  br
147 .  B Default:
148 .  CR "\[oq]\\$1\[cq]"
149 .  nop (register
150 .  CR "\[oq]\\$2\[cq]\c"
151 .  nop ).
152 ..
153 .
154 .
155 .de XDEFS
156 .  br
157 .  B Default:
158 .  CR "\[oq]\\$1\[cq]"
159 .  nop (string
160 .  CR "\[oq]\\$2\[cq]\c"
161 .  nop ).
162 ..
163 .
164 .\" ====================================================================
165 .SH DESCRIPTION
166 .\" ====================================================================
167 .
168 The
169 .B hdtbl
170 macros consist of four base and three optional macros, controlled by about
171 twenty arguments.
172 .
173 The syntax is simple and similar to the
174 .B HTML
175 table model and nearly as flexible: You can write sequences of tokens (macro
176 calls with their arguments and content data), separated by blanks and
177 beginning with a macro call, into the same line to get compact and cleanly
178 arrranged input.
179 .
180 An advantage of
181 .B hdtbl
182 is that the tables are constructed without calling a preprocessor; this
183 means that
184 .BR groff 's
185 full macro capabilities are available.
186 .
187 On the other hand, table processing with
188 .B hdtbl
189 is much slower than using the
190 .BR tbl (@MAN1EXT@)
191 preprocessor.
192 .
193 A further advantage is that the HTML-like syntax of
194 .B hdtbl
195 will be easily converted to HTML; this is not implemented yet.
196 .
197 .
198 .\" ====================================================================
199 .SH USAGE
200 .\" ====================================================================
201 .
202 In this and the next section, we present examples to help users
203 understand the basic workflow of
204 .BR hdtbl .
205 .
206 First of all, you must load the
207 .I hdtbl.tmac
208 file.
209 .
210 As with nearly all other groff macro packages, there are two possibilities
211 to do so:
212 .
213 Either add the line
214 .
215 .PP
216 .nf
217 .nh
218 .RS
219 .CR .mso hdtbl.tmac
220 .fi
221 .hy
222 .RE
223 .
224 .PP
225 to your
226 .I roff
227 file before using any macros of the
228 .B hdtbl
229 package, or add the option
230 .
231 .PP
232 .nf
233 .nh
234 .RS
235 .CR \-m hdtbl
236 .fi
237 .hy
238 .RE
239 .
240 .PP
241 to the command line of groff (before the document file which contains
242 .B hdtbl
243 macros).
244 .
245 Then you can include on or more tables in your document, where each one
246 must be started and ended with the
247 .CR .TBL
248 and
249 .CR .ETB
250 macros, respectively.
251 .
252 .
253 .PP
254 In this man page, we approximate the result of each example in the
255 .I tty
256 format to be as generic as possible since
257 .B hdtbl
258 currently only supports the PS and PDF output devices.
259 .
260 .
261 .PP
262 The simplest well-formed table consists of just single calls to the
263 four base table macros in the right order.
264 .
265 Here we construct a table with only one cell.
266 .
267 .PP
268 .RS
269 .nf
270 .nh
271 .CR .TBL
272 .CR .TR
273 .CR .TD
274 .CI contents of the table cell
275 .CR .ETB
276 .fi
277 .hy
278 .RE
279 .
280 .
281 .PP
282 A
283 .I tty
284 representation is
285 .
286 .PP
287 .nf
288 .nh
289 .ft CR
290 .RS
291 +------------------------------------------------------+
292 | contents-of-the-table-cell                           |
293 +------------------------------------------------------+
294 .RE
295 .ft
296 .hy
297 .fi
298 .
299 .
300 .PP
301 Equivalent to the above is the following notation.
302 .
303 .PP
304 .RS
305 .nh
306 .nf
307 .CRI ".TBL .TR .TD \[dq]" "contents of the table cell" "\[dq] .ETB"
308 .fi
309 .hy
310 .RE
311 .
312 .
313 .PP
314 By default, the formatted table is inserted into the surrounding text
315 at the place of its definition.
316 .
317 If the vertical space isn't sufficient, it is placed at the top of
318 the next page.
319 .
320 Tables can also be stored for later insertion.
321 .
322 .
323 .PP
324 Using
325 .CIR \[oq]row-number * column-number\[cq]
326 as the data for the table cells, a table with two rows and two columns
327 can be written as
328 .
329 .
330 .PP
331 .RS
332 .nf
333 .nh
334 .CR ".TBL cols=2"
335 .CR ".  TR .TD 1*1 .TD 1*2"
336 .CR ".  TR .TD 2*1 .TD 2*2"
337 .CR ".ETB"
338 .fi
339 .hy
340 .RE
341 .
342 .
343 .PP
344 A
345 .I tty
346 representation is
347 .
348 .
349 .PP
350 .nf
351 .nh
352 .ft CR
353 .RS
354 +--------------------------+---------------------------+
355 | 1*1                      | 1*2                       |
356 +--------------------------+---------------------------+
357 | 2*1                      | 2*2                       |
358 +--------------------------+---------------------------+
359 .RE
360 .ft
361 .hy
362 .fi
363 .
364 .
365 .PP
366 Here we see a difference from HTML tables: The number of columns must be
367 explicitly specified using the
368 .CRI \[oq]cols= m\[cq]
369 argument (or indirectly via the
370 .CR \[oq]width\[cq]
371 argument, see below).
372 .
373 .
374 .PP
375 The contents of a table cell is arbitrary; for example, it can be another
376 table, without restriction to the nesting depth.
377 .
378 A given table layout can be either constructed with suitably nested tables
379 or with proper arguments to
380 .CR .TD
381 and
382 .CR .TH\c
383 , controlling column and row spanning.
384 .
385 Note, however, that this table
386 .
387 .PP
388 .RS
389 .nf
390 .nh
391 .CR ".TBL"
392 .CR ".  TR"
393 .CR ".    TD"
394 .CR ".      nop 1*1 1*2"
395 .CR ".  TR"
396 .CR ".    TD"
397 .CR ".      TBL cols=2 border="
398 .CR ".        TR"
399 .CR ".          TD"
400 .CR ".            nop 2*1"
401 .CR ".          TD"
402 .CR ".            nop 2*2"
403 .CR ".      ETB"
404 .CR ".ETB"
405 .fi
406 .hy
407 .RE
408 .
409 .PP
410 and this table
411 .
412 .PP
413 .RS
414 .nf
415 .nh
416 .CR ".TBL cols=2"
417 .CR ".  TR"
418 .CR ".    TD colspan=2"
419 .CR ".      nop 1*1 1*2"
420 .CR ".  TR"
421 .CR ".    TD"
422 .CR ".      nop 2*1"
423 .CR ".    TD"
424 .CR ".      nop 2*2"
425 .CR ".ETB"
426 .fi
427 .hy
428 .RE
429 .
430 .PP
431 are similar but not identical (the use of
432 .CR .nop
433 is purely cosmetic to get proper indentation).
434 .
435 .
436 .PP
437 The first table looks like
438 .
439 .PP
440 .nf
441 .nh
442 .ft CR
443 .RS
444 +------------------------------------------------------+
445 | 1*1 1*2                                              |
446 +------------------------------------------------------+
447 |                                                      |
448 | 2*1                         2*2                      |
449 |                                                      |
450 +------------------------------------------------------+
451 .RE
452 .ft
453 .hy
454 .fi
455 .
456 .PP
457 and the second one like
458 .
459 .PP
460 .nf
461 .nh
462 .ft CR
463 .RS
464 +------------------------------------------------------+
465 | 1*1 1*2                                              |
466 +---------------------------+--------------------------+
467 | 2*1                       | 2*2                      |
468 +---------------------------+--------------------------+
469 .RE
470 .ft
471 .hy
472 .fi
473 .
474 .PP
475 Here the latter table in a more compact form.
476 .
477 .PP
478 .RS
479 .nf
480 .nh
481 .CR ".TBL cols=2 .TR \[dq].TD colspan=2\[dq] 1*1 1*2"
482 .CR ".            TR .TD 2*1 .TD 2*2 .ETB"
483 .fi
484 .hy
485 .RE
486 .
487 .
488 .PP
489 If a macro has one or more arguments (see below), and it is not starting a
490 line, everything belonging to this macro including the macro itself must be
491 enclosed in double quotes.
492 .
493 .
494 .\" ====================================================================
495 .SH MACROS AND ARGUMENTS
496 .\" ====================================================================
497 .
498 The order of macro calls and other tokens follows the HTML model.
499 .
500 In the following list, valid predecessors and successors of all
501 .B hdtbl
502 macros are given, together with the possible arguments.
503 .
504 .PP
505 Macro arguments are separated by blanks.
506 .
507 The order of arguments is arbitrary; they are of the form
508 .
509 .PP
510 .RS
511 .CRI key= value
512 .RE
513 .
514 .PP
515 or
516 .
517 .PP
518 .RS
519 .CRI key=\[aq] "value1 \[lB]value2 \[lB]\[ell]\[rB]\[rB]" \[aq]
520 .RE
521 .
522 .PP
523 with the only exception of the optional argument of the macro
524 .CR .ETB\c
525 , which is the string
526 .CR \[oq]hold\[cq]\c
527 \&.
528 .
529 Another possible form is
530 .
531 .PP
532 .RS
533 .CRI \[dq]key= "value1 \[lB]value2 \[lB]\[ell]\[rB]\[rB]" \[dq]
534 .RE
535 .
536 .
537 .PP
538 However, this is limited to the case where the macro is the first one in the
539 line and not already enclosed in double quotes.
540 .
541 .
542 .PP
543 Argument values specified below as\~\c
544 .CI c
545 are colors predefined by
546 .B groff
547 or colors defined by the user with the
548 .CR .defcolor
549 request.
550 .
551 Argument values\~\c
552 .CI d
553 are decimal numbers with or without decimal point.
554 .
555 Argument values\~\c
556 .CI m
557 are natural numbers.
558 .
559 Argument values\~\c
560 .CI n
561 are numerical values with the usual
562 .B groff
563 scaling indicators.
564 .
565 Some of the arguments are specific to one or two macros, but most of
566 them can be specified with
567 .CR .TBL\c
568 ,
569 .CR .TR\c
570 ,
571 .CR .TD\c
572 , and
573 .CR .TH\
574 \&.
575 .
576 These common arguments are explained in the next subsection.
577 .
578 .
579 .PP
580 Most of the argument default values can be changed by the user by
581 setting corresponding default registers or strings, as listed below.
582 .
583 .\"==================================================================
584 .
585 .TP
586 .CBI ".TBL " \[lB]args\[rB]
587 Begin a new table.
588 .
589 .IP
590 .RS
591 .XB predecessor: .TD .TH .ETB "cell contents"
592 .XB successor: .CPTN .TR
593 .XB arguments:
594 .
595 .RS
596 .XAA border= \[lB]n\[rB]
597 Thickness of the surrounding box border.
598 .
599 .CR \%\[oq]border=\[cq]
600 (no value) means neither a surrounding box border nor any horizontal or
601 vertical separator lines between the table rows and cells.
602 .
603 .CR \%\[oq]border=0\[cq]
604 suppresses the surrounding box border, but still allows separator lines
605 between cells and rows.
606 .
607 .XDEFR border=.1n t*b
608 .
609 .XAA bc= c
610 Border color.
611 .
612 .XDEFS bc=red4 t*bc
613 .
614 .XAA cols= m
615 Number of table columns.
616 .
617 This argument is necessary if more than one column is in the table and no
618 .CR \[oq]width\[cq]
619 arguments are present.
620 .
621 .XDEFR cols=1 t*cols
622 .
623 .XAA cpd= n
624 Cell padding, i.e., the extra space between the cell space border and
625 the cell contents.
626 .
627 .XDEFR cpd=.5n t*cpd
628 .
629 .XAA csp= n
630 Cell spacing, i.e., the extra space between the table border or
631 vertical or horizontal lines between cells and the cellspace.
632 .
633 .XDEFR csp=.5n t*csp
634 .
635 .XAA tal=l\[or]c\[or]r
636 Horizontal alignment of the table, if it is smaller than the line width.
637 .
638 .CR \[oq]tal=l\[cq]\c
639 : left alignment.
640 .
641 .CR \[oq]tal=c\[cq]\c
642 : centered alignment.
643 .
644 .CR \[oq]tal=r\[cq]\c
645 : right alignment.
646 .
647 .XDEFR tal=l t*tal
648 .
649 .XAA "width=\[aq]" "w1 \[lB]w2 \[lB]\[ell]\[rB]\[rB]" \[aq]
650 Widths of table cells.
651 .
652 .CI w1\c
653 .RI , ""
654 .CI w2\c
655 .RI , ""
656 \[ell] are either numbers of type\~\c
657 .CI n
658 or natural numbers with the pseudo-scaling indicator
659 .CR \[oq]%\[cq]\c
660 , with the meaning \[lq]percent of the actual line length (or column length
661 for inner tables, respectively)\[rq].
662 .
663 If there are less width values than table columns, the last width value is
664 used for the remaining cells.
665 .
666 The argument
667 .
668 .RS
669 .IP
670 .CR width=\[aq]1.5i 10%\[aq]
671 .RE
672 .
673 .IP
674 for example indicates that the first column is 1.5\~inches wide; the
675 remaining columns take 1/10 of the column length each.
676 .
677 .XDEF
678 The table width equals the outer line length or column length; the columns
679 have equal widths.
680 .
681 .XAA height= n
682 Height of the table.
683 .
684 If the table with its contents is lower than\~\c
685 .CI n\c
686 .RI , ""
687 the last row is stretched to this value.
688 .RE
689 .RE
690 .
691 .\"==================================================================
692 .
693 .TP
694 .CBI ".CPTN " \[lB]args\[rB]
695 Text of caption.
696 .
697 .IP
698 The (optionally numbered) table caption.
699 .
700 .CR .CPTN
701 is optional.
702 .
703 .IP
704 .RS
705 .XB predecessor: .TBL
706 .XB successor: .TR
707 .XB arguments:
708 .
709 .RS
710 .XAA val=t\[or]b
711 Vertical alignment of the table caption.
712 .
713 .CR \[oq]val=t\[cq]\c
714 : The caption is placed above the table.
715 .
716 .CR \[oq]val=b\[cq]\c
717 : The caption is placed below the table.
718 .
719 .XDEFS val=t t*cptn
720 .RE
721 .RE
722 .
723 .\"==================================================================
724 .
725 .TP
726 .CBI ".TR " \[lB]args\[rB]
727 Begin a new table row.
728 .
729 .IP
730 .RS
731 .XB predecessor: .TBL .CPTN .TD .TH .ETB "cell contents"
732 .XB successor: .TD .TH
733 .XB arguments:
734 .
735 .RS
736 .XAA height= n
737 The height of the row.
738 .
739 If a cell in the row is higher than\~\c
740 .CI n\c
741 .RI , ""
742 this value is ignored;
743 otherwise the row height is stretched to\~\c
744 .CI n\c
745 .RI . ""
746 .RE
747 .RE
748 .
749 .\"==================================================================
750 .
751 .TP
752 .CBI ".TD " "\[lB]args \[lB]cell contents\[rB]\[rB]"
753 Begin a table data cell.
754 .TQ
755 .CBI ".TH " "\[lB]args \[lB]cell contents\[rB]\[rB]"
756 Begin a table header cell.
757 .
758 .IP
759 Arguments and cell contents can be mixed.
760 .
761 The macro
762 .CR .TH
763 is not really necessary and differs from
764 .CR .TD
765 only in three default settings, similar to the
766 .CR <TH>
767 and
768 .CR <TD>
769 HTML tags: The contents of
770 .CR .TH
771 is horizontally and vertically centered and typeset in boldface.
772 .
773 .IP
774 .RS
775 .XB predecessor: .TR .TD .TH .ETB "cell contents"
776 .XB successor: .TD .TH .TR .ETB "cell contents"
777 .XB arguments:
778 .
779 .RS
780 .XAA colspan= m
781 The width of this cell is the sum of the widths of the\~\c
782 .CI m
783 cells above and below this row.
784 .
785 .XAA rowspan= m
786 The height of this cell is the sum of the heights of the
787 .CI m
788 cells left and right of this column.
789 .
790 .IP
791 .B Remark:
792 Overlapping of column and row spanning, as in the following table fragment
793 (the overlapping happens in the second cell in the second row), is invalid
794 and causes incorrect results.
795 .
796 .RS
797 .IP
798 .nh
799 .nf
800 .CR ".TR .TD 1*1 \[dq].TD 1*2 rowspan=2\[dq] .TD 1*3"
801 .CR ".TR \[dq].TD 2*1 colspan=2\[dq]         .TD 2*3"
802 .fi
803 .hy
804 .RE
805 .
806 .PP
807 A working example for headers and cells with
808 .B colspan
809 is
810 .
811 .PP
812 .RS
813 .nf
814 .nh
815 .CR .TBL cols=3
816 .CR ".  TR" \[dq].TH colspan=2\[dq] header1+2 .TH header3
817 .CR ".  TR" .TD 1*1 .TD 1*2 .TD 1*3
818 .CR ".  TR" .TD 2*1 \[dq].TD colspan=2\[dq] 2*2+3
819 .CR .ETB
820 .fi
821 .hy
822 .RE
823 .
824 .PP
825 This looks like
826 .
827 .PP
828 .ft CR
829 .if t \{\
830 .  ne 7v
831 .\}
832 .RS
833 .nf
834 .nh
835 +------------------------------+---------------+
836 |          header1+2           |    header3    |
837 +--------------+---------------+---------------+
838 | 1*1          | 1*2           | 1*3           |
839 +--------------+---------------+---------------+
840 | 2*1          | 2*2+3                         |
841 +--------------+-------------------------------+
842 .RE
843 .ft
844 .hy
845 .fi
846 .
847 .PP
848 A working example with
849 .B rowspan
850 is
851 .
852 .PP
853 .RS
854 .nf
855 .nh
856 .CR .TBL cols=3
857 .CR ".  TR"
858 .CR ".  TD" 1*1
859 .CR ".  TD" rowspan=2 1+2*2
860 .CR ".  TD" 1*3
861 .CR .
862 .CR ".  TR"
863 .CR ".  TD" 2*1
864 .CR ".  TD" 2*3
865 .CR .ETB
866 .fi
867 .hy
868 .RE
869 .
870 .PP
871 which looks like
872 .
873 .PP
874 .ft CR
875 .RS
876 .nf
877 .nh
878 +--------------+---------------+---------------+
879 | 1*1          | 1+2*2         | 1*3           |
880 +--------------+               +---------------+
881 | 2*1          |               | 2*3           |
882 +--------------+---------------+---------------+
883 .hy
884 .fi
885 .RE
886 .ft CR
887 .
888 .RE
889 .RE
890 .
891 .\"==================================================================
892 .
893 .TP
894 .CB ".ETB \[lB]hold\[rB]"
895 End of the table.
896 .
897 .IP
898 This macro finishes a table.
899 .
900 It causes one of the following actions.
901 .
902 .RS
903 .IP \[bu] 3
904 If the argument
905 .CR \[oq]hold\[cq]
906 is given, the table is held until it is freed by calling the macro
907 .CR .t*free\c
908 , which in turn prints the table immediately, either at the current position
909 or at the top of the next page if its height is larger than the remaining
910 space on the page.
911 .
912 .IP \[bu] 3
913 Otherwise, if the table is higher than the remaining space on the page,
914 it is printed at the top of the next page.
915 .
916 .IP \[bu] 3
917 If neither of the two above constraints hold, the table is printed
918 immediately at the place of its definition.
919 .RE
920 .
921 .IP
922 .RS
923 .XB predecessor: .TD .TH .ETB "cell contents"
924 .XB successor: .TBL .TR .TD .TH .ETB "cell contents"
925 .XB arguments:
926 .
927 .RS
928 .XAA hold
929 Prevent the table from being printed until it is freed by calling the
930 macro
931 .CR .t*free\c
932 \&.
933 .
934 This argument is ignored for inner (nested) tables.
935 .RE
936 .RE
937 .
938 .\"==================================================================
939 .
940 .TP
941 .CBI ".t*free " \[lB]n\[rB]
942 Free the next held table or
943 .CI n\~\c
944 .RI held ""
945 tables.
946 .
947 Call this utility macro to print tables which are held by using the
948 .CR \[oq]hold\[cq]
949 argument of the
950 .CR .ETB
951 macro.
952 .
953 .
954 .\" ====================================================================
955 .SS "Arguments common to \f[CB].TBL\f[], \f[CB].TR\f[], \f[CB].TD\f[], and \f[CB].TH\f[]"
956 .\" ====================================================================
957 .
958 The arguments described in this section can be specified with the
959 .CR .TBL
960 and
961 .CR .TR
962 macros, but they are eventually passed on to the table cells.
963 .
964 If omitted, the defaults take place, which the user can change by setting
965 the corresponding default registers or strings, as documented below.
966 .
967 Setting an argument with the
968 .CR .TBL
969 macro has the same effect as setting it for all rows in the table.
970 .
971 Setting an argument with a
972 .CR .TR
973 macro has the same effect as setting it for all the
974 .CR .TH
975 or
976 .CR .TD
977 macro in this row.
978 .
979 .IP
980 .XAA bgc= \[lB]c\[rB]
981 The background color of the table cells.
982 .
983 This includes the area specified with the
984 .CR \[oq]csp\[cq]
985 argument.
986 .
987 The argument
988 .CR \[oq]bgc=\[cq]
989 (no value) suppresses a background color; this makes the background
990 transparent.
991 .
992 .XDEFS bgc=bisque t*bgc
993 .
994 .XAA fgc= c
995 The foreground color of the cell contents.
996 .
997 .XDEFS fgc=red4 t*fgc
998 .
999 .XAA ff= name
1000 The font family for the table.
1001 .
1002 .CI name
1003 is one of the groff font families, for example
1004 .CR A
1005 for the AvantGarde fonts or
1006 .CR HN
1007 for Helvetica-Narrow.
1008 .
1009 .XDEF
1010 The font family found before the table (string
1011 .CR \[oq]t*ff\[cq]\c
1012 ).
1013 .
1014 .XAA fst= style
1015 The font style for the table.
1016 .
1017 One of
1018 .CR R\c
1019 ,
1020 .CR B\c
1021 ,
1022 .CR I\c
1023 , or
1024 .CR BI
1025 for roman,
1026 .BR bold ,
1027 .IR italic ,
1028 or \f[BI]bold italic\f[], respectively.
1029 .
1030 As with
1031 .BR roff 's
1032 .CR .ft
1033 request the
1034 .CR \[oq]fst\[cq]
1035 argument can be used to specify the font family and font style together, for
1036 example
1037 .CR \[oq]fst=HNBI\[cq]
1038 instead of
1039 .CR \[oq]ff=HN\[cq]
1040 and
1041 .CR \[oq]fst=BI\[cq]\c
1042 \&.
1043 .
1044 .XDEF
1045 The font style in use right before the table (string
1046 .CR \[oq]t*fst\[cq]\c
1047 ).
1048 .
1049 .XAA "fsz=\[aq]" "d1 \[lB]d2\[rB]" \[aq]
1050 A decimal or fractional factor
1051 .CI d1\c
1052 .RI , ""
1053 by which the point size for the table is changed, and
1054 .CI d2\c
1055 .RI , ""
1056 by which the vertical line spacing is changed.
1057 .
1058 If
1059 .CI d2
1060 is omitted, value
1061 .CI d1
1062 is taken for both.
1063 .
1064 .XDEFS "fsz=\[aq]1.0 1.0\[aq]" t*fsz
1065 .
1066 .XAA hal=l\[or]c\[or]b\[or]r
1067 Horizontal alignment of the cell contents in the table.
1068 .
1069 .CR \[oq]hal=l\[cq]\c
1070 : left alignment.
1071 .
1072 .CR \[oq]hal=c\[cq]\c
1073 : centered alignment.
1074 .
1075 .CR \[oq]hal=b\[cq]\c
1076 : both (left and right) alignment.
1077 .
1078 .CR \[oq]hal=r\[cq]\c
1079 : right alignment.
1080 .
1081 .XDEFS hal=b t*hal
1082 .
1083 .XAA val=t\[or]m\[or]b
1084 Vertical alignment of the cell contents in the table for cells lower
1085 than the current row.
1086 .
1087 .CR \[oq]val=t\[cq]\c
1088 : alignment below the top of the cell.
1089 .
1090 .CR \[oq]val=m\[cq]\c
1091 : alignment in the middle of the cell.
1092 .
1093 .CR \[oq]val=b\[cq]\c
1094 : alignment above the cell bottom.
1095 .
1096 .XDEFS val=t t*val
1097 .
1098 .XAA hl=\[lB]s\[or]d\[rB]
1099 Horizontal line between the rows.
1100 .
1101 If specified with
1102 .CR .TD
1103 or
1104 .CR .TH
1105 this is a separator line to the cell below.
1106 .
1107 .CR \[oq]hl=\[cq]
1108 (no value): no separator line.
1109 .
1110 .CR \[oq]hl=s\[cq]\c
1111 : a single separator line between the rows.
1112 .
1113 .CR \[oq]hl=d\[cq]\c
1114 : a double separator line.
1115 .
1116 .IP
1117 The thickness of the separator lines is the half of the border thickness,
1118 but at least 0.1\~inches.
1119 .
1120 The distance between the double lines is equal to the line thickness.
1121 .
1122 .IP
1123 .B Remark:
1124 Together with
1125 .CR \[oq]border=0\[cq]
1126 for proper formatting the value of
1127 .CR \[oq]csp\[cq]
1128 must be at least .05\~inches for single separator lines and .15\~inches for
1129 double separator lines.
1130 .
1131 .XDEFS hl=s t*hl
1132 .
1133 .XAA vl=\[lB]s\[or]d\[rB]
1134 Vertical separator line between the cells.
1135 .
1136 If specified with
1137 .CR .TD
1138 or
1139 .CR .TH
1140 this is a separator line to the cell on the right.
1141 .
1142 .CR \[oq]vl=s\[cq]\c
1143 : a single separator line between the cells.
1144 .
1145 .CR \[oq]vl=d\[cq]\c
1146 : a double separator line.
1147 .
1148 .CR \[oq]vl=\[cq]
1149 (no value): no vertical cell separator lines.
1150 .
1151 For more information see the documentation of the
1152 .CR \[oq]hl\[cq]
1153 argument above.
1154 .
1155 .XDEFS vl=s t*vl
1156 .
1157 .
1158 .\" ====================================================================
1159 .SH HDTBL CUSTOMIZATION
1160 .\" ====================================================================
1161 .
1162 .PP
1163 Before creating the first table, you should configure default values
1164 to minimize the markup needed in each table.
1165 .
1166 The following example sets up defaults suitable for typical papers:
1167 .PP
1168 .RS
1169 .nf
1170 .CR ".ds t*bgc white\e\[dq] background color
1171 .CR ".ds t*fgc black\e\[dq] foreground color
1172 .CR ".ds t*bc black\e\[dq]  border color
1173 .CR ".nr t*cpd 0.1n\e\[dq]  cell padding
1174 .fi
1175 .RE
1176 .
1177 .
1178 .PP
1179 The file
1180 .B examples/common.roff
1181 provides another example setup
1182 in the \[lq]minimal Page setup\[rq] section.
1183 .
1184 .
1185 .PP
1186 A table which does not fit on a partially filled page is printed
1187 automatically on the top of the next page if you append the little
1188 utility macro
1189 .CR t*hm
1190 to the page header macro of your document's main macro package.
1191 .
1192 For example, say
1193 .
1194 .PP
1195 .RS
1196 .nf
1197 .CR ".am pg@top"
1198 .CR ".  t*hm"
1199 .CR ".."
1200 .fi
1201 .RE
1202 .
1203 .
1204 .PP
1205 if you use the
1206 .B ms
1207 macro package.
1208 .
1209 .
1210 .PP
1211 The macro
1212 .CR t*EM
1213 checks for held or kept tables,
1214 and for missing
1215 .CR ETB
1216 macros (table not closed).
1217 .
1218 You can append this macro
1219 to the \[lq]end\[rq] macro of your document's main macro package.
1220 .
1221 For example:
1222 .
1223 .PP
1224 .RS
1225 .nf
1226 .nh
1227 .CR ".am pg@end-text"
1228 .CR ".  t*EM"
1229 .CR ".."
1230 .fi
1231 .hy
1232 .RE
1233 .
1234 .PP
1235 If you use the
1236 .B ms
1237 macro package.
1238 .
1239 .
1240 .\" ====================================================================
1241 .SH BUGS AND SUGGESTIONS
1242 .\" ====================================================================
1243 .
1244 Please send your commments to the
1245 .MT groff@\:gnu.org
1246 groff mailing list
1247 .ME
1248 or directly to the author.
1249 .
1250 .
1251 .\" ====================================================================
1252 .SH AUTHORS
1253 .\" ====================================================================
1254 The
1255 .B hdtbl
1256 macro package was written by
1257 .MT Joachim.Walsdorff@\:urz.uni\-heidelberg.de
1258 Joachim Walsdorff
1259 .ME .
1260 .
1261 .
1262 .\" ====================================================================
1263 .SH SEE ALSO
1264 .\" ====================================================================
1265 .TP
1266 .BR groff (1)
1267 provides an overview of GNU
1268 .I roff
1269 and details how to invoke
1270 .I groff
1271 at the command line.
1272 .TP
1273 .BR groff (7)
1274 summarizes the
1275 .I roff
1276 language and GNU extensions to it.
1277 .TP
1278 .BR tbl (1)
1279 describes the traditional
1280 .I roff
1281 preprocessor for tables.
1282 .
1283 .
1284 .\" Restore compatibility mode (for, e.g., Solaris 10/11).
1285 .cp \n[groff_hdtbl_C]
1286 .
1287 .
1288 .\" ====================================================================
1289 .\" Emacs settings
1290 .\" ====================================================================
1291 .
1292 .\" Local Variables:
1293 .\" mode: nroff
1294 .\" End:
1295 .\" vim: filetype=groff: