4 Copyright (c) 2014 - 2015 Steffen (Daode) Nurpmeso <sdaoden@users.sf.net>.
6 Copyright (C) 2005, 2006, 2008, 2009
7 Free Software Foundation, Inc.
9 Written by Joachim Walsdorff <Joachim.Walsdorff@urz.uni-heidelberg.de>
11 Permission is granted to copy, distribute and/or modify this document
12 under the terms of the GNU Free Documentation License, Version 1.1 or
13 any later version published by the Free Software Foundation; with the
14 Invariant Sections being this .ig-section and AUTHORS, with no
15 Front-Cover Texts, and with no Back-Cover Texts.
17 You should have received a copy of the Free Documentation License
18 as part of the file COPYING; also located in the main directory of the
19 source package of this program.
22 .TH @U_ROFF@_HDTBL @MAN7EXT@ "@MDATE@" "@T_ROFF@ v@VERSION@"
26 @L_ROFF@_hdtbl \- @L_ROFF@ `hdtbl' macros for generation of tables
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.
37 .char \[lB] \F[\n[.fam]]\f[R][
38 .char \[rB] \F[\n[.fam]]\f[R]]
40 .char \[or] \F[\n[.fam]]\f[R]\||\|
41 .char \[ell] \F[\n[.fam]]\f[R].\|.\|.
43 .char \[oq] \F[\n[.fam]]\f[R]\[oq]
44 .char \[cq] \F[\n[.fam]]\f[R]\[cq]
49 . \" We have to solve the following problem. In this code
55 . \" the space immediately after `bar' should not be taken from the `C'
56 . \" family. At the same time, this
62 . \" should work also. To fulfill both constraints we emit the
63 . \" family changing commands both as escapes and macro calls.
67 . ds old-fam \\\\n[.fam]
69 . \\$2 \&\\\\$*\F[]\F[\\\\*[old-fam]]
80 . ds old-fam \\\\n[.fam]
82 . \\$1 \\\\$@ \F[]\F[\\\\*[old-fam]]
154 . CR "\[oq]\\$1\[cq]"
156 . CR "\[oq]\\$2\[cq]\c"
164 . CR "\[oq]\\$1\[cq]"
166 . CR "\[oq]\\$2\[cq]\c"
176 macros consist of four base and three optional macros, controlled by about
179 The syntax is simple and similar to the
181 table model and nearly as flexible: You can write sequences of tokens (macro
182 calls with their arguments and content data), separated by blanks and
183 beginning with a macro call, into the same line to get compact and cleanly
188 is that the tables are constructed without calling a preprocessor; this
191 full macro capabilities are available.
193 On the other hand, table processing with
195 is much slower than using the
199 A further advantage is that the HTML-like syntax of
201 will be easily converted to HTML; this is not implemented yet.
206 The simplest well-formed table consists of just single calls to the four
207 base table macros in the right order.
209 Here we construct a table with only one cell.
217 .CI contents of the table cell
223 Equivalent to the above is the following notation.
227 .CRI ".TBL .TR .TD " "contents of the table cell" " .ETB"
231 By default, the formatted table is inserted into the surrounding text at the
232 place of its definition.
234 If the vertical space isn't sufficient, it is placed at the top of the next
237 Tables can also be stored for later insertion.
241 .CIR \[oq]row-number * column-number\[cq]
242 as the data for the table cells, a table with two rows and two columns can
249 .CR ". TR .TD 1*1 .TD 1*2"
250 .CR ". TR .TD 2*1 .TD 2*2"
256 Here we see a difference to HTML tables: The number of columns must be
257 explicitly specified using the
258 .CRI \[oq]cols= m\[cq]
259 argument (or indirectly via the
261 argument, see below).
264 The contents of a table cell is arbitrary; for example, it can be another
265 table, without restriction to the nesting depth.
267 A given table layout can be either constructed with suitably nested tables
268 or with proper arguments to
272 , controlling column and row spanning.
274 Note, however, that this table
285 .CR ". TBL cols=2 border="
316 are similar but not identical.
319 Here the latter table in a more compact form.
324 .CR ".TBL cols=2 .TR \[dq].TD colspan=2\[dq] 1*1 1*2"
325 .CR ". TR .TD 2*1 .TD 2*2 .ETB"
330 If a macro has one or more arguments, and it is not starting a line, it must
331 be enclosed in double quotes.
334 .SH MACROS AND ARGUMENTS
336 The order of macro calls and other tokens follows the HTML model.
338 In the following list, valid predecessors and successors of all
340 macros are given, together with the possible arguments.
343 Macro arguments are separated by blanks.
345 The order of arguments is arbitrary; they are of the form
357 .CRI key=\[aq] "value1 \[lB]value2 \[lB]\[ell]\[rB]\[rB]" \[aq]
361 with the only exception of the optional argument of the macro
363 , which is the string
367 Another possible form is
371 .CRI \[dq]key= "value1 \[lB]value2 \[lB]\[ell]\[rB]\[rB]" \[dq]
375 However, this is limited to the case where the macro is the first one in the
376 line and not already enclosed in double quotes.
379 Argument values specified below as\~\c
381 are colors predefined by
383 or colors defined by the user with the
389 are decimal numbers with or without decimal point.
397 are numerical values with the usual
401 Some of the arguments are specific to one or two macros, but most of them
402 can be specified with
412 These common arguments are explained in the next subsection.
415 Most of the argument default values can be changed by the user by setting
416 corresponding default registers or strings, as listed below.
418 .\"------------------------------------------------------------------
421 .CBI ".TBL " \[lB]args\[rB]
426 .XB predecessor: .TD .TH .ETB "cell contents"
427 .XB successor: .CPTN .TR
431 .XAA border= \[lB]n\[rB]
432 Thickness of the surrounding box border.
434 .CR \%\[oq]border=\[cq]
435 (no value) means neither a surrounding box border nor any horizontal or
436 vertical separator lines between the table rows and cells.
438 .CR \%\[oq]border=0\[cq]
439 suppresses the surrounding box border, but still allows separator lines
440 between cells and rows.
442 .XDEFR border=.1n t*b
450 Number of table columns.
452 This argument is necessary if more than one column is in the table and no
454 arguments are present.
459 Cell padding, i.e., the extra space between the cell space border and
465 Cell spacing, i.e., the extra space between the table border or
466 vertical or horizontal lines between cells and the cellspace.
470 .XAA tal=l\[or]c\[or]r
471 Horizontal alignment of the table, if it is smaller than the line width.
473 .CR \[oq]tal=l\[cq]\c
476 .CR \[oq]tal=c\[cq]\c
477 : centered alignment.
479 .CR \[oq]tal=r\[cq]\c
484 .XAA "width=\[aq]" "w1 \[lB]w2 \[lB]\[ell]\[rB]\[rB]" \[aq]
485 Widths of table cells.
490 , \[ell] are either numbers of type\~\c
492 or natural numbers with the pseudo-scaling indicator
494 , with the meaning \[lq]percent of the actual line length (or column length
495 for inner tables, respectively)\[rq].
497 If there are less width values than table columns, the last width value is
498 used for the remaining cells.
504 .CR width=\[aq]1.5i 10%\[aq]
508 for example indicates that the first column is 1.5\|inches wide; the
509 remaining columns take 1/10 of the column length each.
512 The table width equals the outer line length or column length; the columns
518 If the table with its contents is lower than\~\c
520 , the last row is stretched to this value.
524 .\"------------------------------------------------------------------
527 .CBI ".CPTN " \[lB]args\[rB]
531 The (optionally numbered) table caption.
538 .XB predecessor: .TBL
544 Vertical alignment of the table caption.
546 .CR \[oq]val=t\[cq]\c
547 : The caption is placed above the table.
549 .CR \[oq]val=b\[cq]\c
550 : The caption is placed below the table.
556 .\"------------------------------------------------------------------
559 .CBI ".TR " \[lB]args\[rB]
560 Begin a new table row.
564 .XB predecessor: .TBL .CPTN .TD .TH .ETB "cell contents"
565 .XB successor: .TD .TH
570 The height of the row.
572 If a cell in the row is higher than\~\c
574 this value is ignored; otherwise the row height is stretched to\~\c
580 .\"------------------------------------------------------------------
583 .CBI ".TD " "\[lB]args \[lB]cell contents\[rB]\[rB]"
584 Begin a table data cell.
586 .CBI ".TH " "\[lB]args \[lB]cell contents\[rB]\[rB]"
587 Begin a table header cell.
590 Arguments and cell contents can be mixed.
594 is not really necessary and differs from
596 only in three default settings, similar to the
600 HTML tags: The contents of
602 is horizontally and vertically centered and typeset in boldface.
606 .XB predecessor: .TR .TD .TH .ETB "cell contents"
607 .XB successor: .TD .TH .TR .ETB "cell contents"
612 The width of this cell is the sum of the widths of the\~\c
614 cells above and below this row.
617 The height of this cell is the sum of the heights of the
619 cells left and right of this column.
623 Overlapping of column and row spanning, as in the following table fragment
624 (the overlapping happens in the second cell in the second row), is invalid
625 and causes incorrect results.
630 .CR ".TR .TD 1*1 \[dq].TD 1*2 rowspan=2\[dq] .TD 1*3"
631 .CR ".TR \[dq].TD 2*1 colspan=2\[dq] .TD 2*3"
637 .\"------------------------------------------------------------------
640 .CB ".ETB \[lB]hold\[rB]"
644 This macro finishes a table.
646 It causes one of the following actions.
652 is given, the table is held until it is freed by calling the macro
654 , which in turn prints the table immediately, either at the current position
655 or at the top of the next page if its height is larger than the remaining
659 Otherwise, if the table is higher than the remaining space on the page,
660 it is printed at the top of the next page.
663 If none of the two above constraints hold, the table is printed immediately
664 at the place of its definition.
669 .XB predecessor: .TD .TH .ETB "cell contents"
670 .XB successor: .TBL .TR .TD .TH .ETB "cell contents"
675 Prevent the table from being printed until it is freed by calling the
680 This argument is ignored for inner (nested) tables.
684 .\"------------------------------------------------------------------
687 .CBI ".t*free " \[lB]n\[rB]
688 Free the next held table or
692 Call this utility macro to print tables which are held by using the
699 .SS Arguments common to \f[CB].TBL\f[], \f[CB].TR\f[], \f[CB].TD\f[], and \f[CB].TH\f[]
701 The arguments described in this section can be specified with the
705 macros, but they are eventually passed on to the table cells.
707 If omitted, the defaults take place, which the user can change by setting
708 the corresponding default registers or strings, as documented below.
710 Setting an argument with the
712 macro has the same effect as setting it for all rows in the table.
714 Setting an argument with a
716 macro has the same effect as setting it for all the
723 .XAA bgc= \[lB]c\[rB]
724 The background color of the table cells.
726 This includes the area specified with the
732 (no value) suppresses a background color; this makes the background
735 .XDEFS bgc=bisque t*bgc
738 The foreground color of the cell contents.
740 .XDEFS fgc=red4 t*fgc
743 The font family for the table.
746 is one of the @L_ROFF@ font families, for example
748 for the AvantGarde fonts or
750 for Helvetica-Narrow.
753 The font family found before the table (string
758 The font style for the table.
771 or \f[BI]bold italic\f[], respectively.
778 argument can be used to specify the font family and font style together, for
780 .CR \[oq]fst=HNBI\[cq]
784 .CR \[oq]fst=BI\[cq]\c
788 The font style in use right before the table (string
789 .CR \[oq]t*fst\[cq]\c
792 .XAA "fsz=\[aq]" "d1 \[lB]d2\[rB]" \[aq]
793 A decimal or fractional factor
795 , by which the point size for the table is changed, and
797 , by which the vertical line spacing is changed.
805 .XDEFS "fsz=\[aq]1.0 1.0\[aq]" t*fsz
807 .XAA hal=l\[or]c\[or]b\[or]r
808 Horizontal alignment of the cell contents in the table.
810 .CR \[oq]hal=l\[cq]\c
813 .CR \[oq]hal=c\[cq]\c
814 : centered alignment.
816 .CR \[oq]hal=b\[cq]\c
817 : both (left and right) alignment.
819 .CR \[oq]hal=r\[cq]\c
824 .XAA val=t\[or]m\[or]b
825 Vertical alignment of the cell contents in the table for cells lower
826 than the current row.
828 .CR \[oq]val=t\[cq]\c
829 : alignment below the top of the cell.
831 .CR \[oq]val=m\[cq]\c
832 : alignment in the middle of the cell.
834 .CR \[oq]val=b\[cq]\c
835 : alignment above the cell bottom.
839 .XAA hl=\[lB]s\[or]d\[rB]
840 Horizontal line between the rows.
846 this is a separator line to the cell below.
849 (no value): no separator line.
852 : a single separator line between the rows.
855 : a double separator line.
858 The thickness of the separator lines is the half of the border thickness,
859 but at least 0.1\|inches.
861 The distance between the double lines is equal to the line thickness.
866 .CR \[oq]border=0\[cq]
867 for proper formatting the value of
869 must be at least .05\|inches for single separator lines and .15\|inches for
870 double separator lines.
874 .XAA vl=\[lB]s\[or]d\[rB]
875 Vertical separator line between the cells.
881 this is a separator line to the cell on the right.
884 : a single separator line between the cells.
887 : a double separator line.
890 (no value): no vertical cell separator lines.
892 For more information see the documentation of the
899 .SH HDTBL CUSTOMIZATION
901 A table which does not fit on a partially filled page is printed
902 automatically on the top of the next page if you append the little
905 to the page header macro of your document's main macro package.
924 has built-in page header and page footer macros,
928 If they interfere with your own header and footer macros, simply
938 .MT Joachim.Walsdorff@urz.uni-heidelberg.de
943 .SH BUGS AND SUGGESTIONS
945 Please send your commments to the
949 or directly to the author.