1 /* t7.c: control to write table entries */
3 # define realsplit ((ct=='a'||ct=='n') && table[ldata][c].rcol)
10 if (boxflg || allflg || dboxflg)
13 Bprint(&tabout, ".nr #I \\n(.i\n");
14 Bprint(&tabout, ".in +(\\n(.lu-\\n(TWu-\\n(.iu)/2u\n");
16 Bprint(&tabout, ".fc %c %c\n", F1, F2);
17 Bprint(&tabout, ".nr #T 0-1\n");
19 for (i = 0; i < nlin; i++)
23 Bprint(&tabout, ".fc\n");
24 Bprint(&tabout, ".nr T. 1\n");
25 Bprint(&tabout, ".T# 1\n");
27 Bprint(&tabout, ".in \\n(#Iu\n");
32 runtabs(int lform, int ldata)
34 int c, ct, vforml, lf;
36 Bprint(&tabout, ".ta ");
37 for (c = 0; c < ncol; c++) {
39 for (lf = prev(lform); lf >= 0 && vspen(table[lf][c].col); lf = prev(lf))
43 switch (ct = ctype(vforml, c)) {
46 if (table[ldata][c].rcol)
47 if (lused[c]) /*Zero field width*/
48 Bprint(&tabout, "\\n(%2su ", reg(c, CMID));
52 if (realsplit ? rused[c] : (used[c] + lused[c]))
53 Bprint(&tabout, "\\n(%2su ", reg(c, CRIGHT));
57 Bprint(&tabout, "\\n(%2su ", reg(c, CRIGHT));
61 Bprint(&tabout, "\n");
85 int texlin, horlin, i;
87 for (texlin = horlin = i = 0; i < nlin; i++) {
90 else if (instead[i] != 0)
95 Bprint(&tabout, ".ne %dv+%dp\n", texlin, 2 * horlin);
104 for (i = 0; i < MAXHEAD; i++)
106 Bprint(&tabout, ".nr #%c 0-1\n", linestop[i] + 'a' - 1);
107 Bprint(&tabout, ".nr #a 0-1\n");
108 Bprint(&tabout, ".eo\n");
109 Bprint(&tabout, ".de T#\n");
110 Bprint(&tabout, ".nr 35 1m\n");
111 Bprint(&tabout, ".ds #d .d\n");
112 Bprint(&tabout, ".if \\(ts\\n(.z\\(ts\\(ts .ds #d nl\n");
113 Bprint(&tabout, ".mk ##\n");
114 Bprint(&tabout, ".nr ## -1v\n");
115 Bprint(&tabout, ".ls 1\n");
116 for (i = 0; i < MAXHEAD; i++)
118 Bprint(&tabout, ".if \\n(#T>=0 .nr #%c \\n(#T\n",
119 linestop[i] + 'a' - 1);
120 if (boxflg || allflg || dboxflg) /* bottom of table line */
121 if (fullbot[nlin-1] == 0) {
123 Bprint(&tabout, ".if \\n(T. .vs \\n(.vu-\\n(.sp\n");
124 Bprint(&tabout, ".if \\n(T. ");
125 drawline(nlin, 0, ncol, dboxflg ? '=' : '-', 1, 0);
126 Bprint(&tabout, "\n.if \\n(T. .vs\n");
127 /* T. is really an argument to a macro but because of
128 eqn we don't dare pass it as an argument and reference by $1 */
130 for (c = 0; c < ncol; c++) {
131 if ((lf = left(nlin - 1, c, &lwid)) >= 0) {
132 Bprint(&tabout, ".if \\n(#%c>=0 .sp -1\n", linestop[lf] + 'a' - 1);
133 Bprint(&tabout, ".if \\n(#%c>=0 ", linestop[lf] + 'a' - 1);
135 drawvert(lf, nlin - 1, c, lwid);
136 Bprint(&tabout, "\\h'|\\n(TWu'\n");
139 if (boxflg || allflg || dboxflg) /* right hand line */ {
140 Bprint(&tabout, ".if \\n(#a>=0 .sp -1\n");
141 Bprint(&tabout, ".if \\n(#a>=0 \\h'|\\n(TWu'");
142 drawvert (0, nlin - 1, ncol, dboxflg ? 2 : 1);
143 Bprint(&tabout, "\n");
145 Bprint(&tabout, ".ls\n");
146 Bprint(&tabout, "..\n");
147 Bprint(&tabout, ".ec\n");