1 .\" A macro package for simple tables
3 .\" This package creates simple tables, without using the tbl
4 .\" preprocessor. The main macros are as follows:
6 .\" .tblbeg colwid1 colwid2 ...
7 .\" This macro begins a table. Its arguments are the widths of the
8 .\" columns. At most four columns are supported. The width of the
9 .\" last column can be 0 to expand it to the end of the line.
11 .\" .tblbox all row col
12 .\" Specifies whether to draw box around the table (when all is 1),
13 .\" between the rows (when row is 1), or between its columns (when
16 .\" .tblrow "column #1" "column #2" ...
17 .\" The compact way of specifying the contents of a table row (instead
18 .\" of calling .tblcol for every column).
21 .\" Begins column number col for the current row. With an argument of
22 .\" 1, a new row is inserted.
24 .\" .tblmac mac1 mac2 ...
25 .\" Before writing the contents of each column, the corresponding
26 .\" macro in the list of the arguments of this macro is invoked (e.g.,
27 .\" mac2 is called when starting column #2).
30 .\" This macro is called just before switching to new rows and columns
31 .\" and drawing the table. It should reset the indentation (and other
32 .\" variables such as fonts, if necessary).
48 . if "\\$1"0" .nr tblwid1 \\n(.l
50 . if "\\$2"0" .nr tblwid2 \\n(.l-\\n[tblwid1]
52 . if "\\$3"0" .nr tblwid3 \\n(.l-\\n[tblwid1]-\\n[tblwid2]
54 . if "\\$4"0" .nr tblwid4 \\n(.l-\\n[tblwid1]-\\n[tblwid2]-\\n[tblwid3]
55 . nr tblwid \\n[tblwid1]+\\n[tblwid2]+\\n[tblwid3]+\\n[tblwid4]
71 . sp |\\n[tblrow.top]u
75 . if \\$1=2 .in +\\n[tblwid1]u
76 . if \\$1=3 .in +\\n[tblwid1]u+\\n[tblwid2]u
77 . if \\$1=4 .in +\\n[tblwid1]u+\\n[tblwid2]u+\\n[tblwid3]u
78 . ll \\n(.iu+\\n[tblwid\\$1]u
84 . if \\n(.d>\\n[tblrow.bot] .nr tblrow.bot \\n(.d
88 . if (\\n[tblboxall]+\\n[tblboxrow])&(\\n[tblrow.one]) \D'l \\n[tblwid]u 0'
96 . if \\n[tblcol.ok] .tblcolend \\$1
99 . sp |\\n[tblrow.bot]u
100 . nr tblht \\n[tblrow.bot]u-\\n[tblrow.top]u+.5v
102 . if \\n[tblboxall]:\\n[tblboxcol] \{\
103 \h'|0'\D'l 0 -\\n[tblht]u'\v'\\n[tblht]u'\
104 \h'|\\n[tblwid]u'\D'l 0 -\\n[tblht]u'\v'\\n[tblht]u'
107 . if \\n[tblboxcol] \{\
108 \h'|\\n[tblwid1]u'\D'l 0 -\\n[tblht]u'\v'\\n[tblht]u'\
109 \h'|\\n[tblwid1]u+\\n[tblwid2]u'\D'l 0 -\\n[tblht]u'\v'\\n[tblht]u'\
110 \h'|\\n[tblwid1]u+\\n[tblwid2]u+\\n[tblwid3]u'\D'l 0 -\\n[tblht]u'\v'\\n[tblht]u'
113 . if \\n[tblboxrow]:(\\n[tblboxall]&\\$1) \{\
114 \h'|0'\D'l \\n[tblwid]u 0'
121 . if \\n[tblcol.ok] .tblcolend \\$1
122 . if \\$1=1&\\n[tblrowaut] .if \\n[tblrow.ok] .tblrowend 0
123 . if \\$1=1&\\n[tblrowaut] .tblrowbeg
127 . if \\n(.$>=1 .tblcol 1
129 . if \\n(.$>=2 .tblcol 2
131 . if \\n(.$>=3 .tblcol 3
133 . if \\n(.$>=4 .tblcol 4
138 . if \\n[tblcol.ok] .tblcolend
139 . if \\n[tblrow.ok] .tblrowend 1