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 fprintf(tabout
, ".nr #I \\n(.i\n");
14 fprintf(tabout
, ".in +(\\n(.lu-\\n(TWu-\\n(.iu)/2u\n");
16 fprintf(tabout
, ".fc %c %c\n", F1
, F2
);
17 fprintf(tabout
, ".nr #T 0-1\n");
19 for (i
= 0; i
< nlin
; i
++)
23 fprintf(tabout
, ".fc\n");
24 fprintf(tabout
, ".nr T. 1\n");
25 fprintf(tabout
, ".T# 1\n");
27 fprintf(tabout
, ".in \\n(#Iu\n");
32 runtabs(int lform
, int ldata
)
34 int c
, ct
, vforml
, lf
;
36 fprintf(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 fprintf(tabout
, "\\n(%2su ", reg(c
, CMID
));
52 if (realsplit
? rused
[c
] : (used
[c
] + lused
[c
]))
53 fprintf(tabout
, "\\n(%2su ", reg(c
, CRIGHT
));
57 fprintf(tabout
, "\\n(%2su ", reg(c
, CRIGHT
));
61 fprintf(tabout
, "\n");
85 int texlin
, horlin
, i
;
87 for (texlin
= horlin
= i
= 0; i
< nlin
; i
++) {
90 else if (instead
[i
] != 0)
95 fprintf(tabout
, ".ne %dv+%dp\n", texlin
, 2 * horlin
);
104 for (i
= 0; i
< MAXHEAD
; i
++)
106 fprintf(tabout
, ".nr #%c 0-1\n", linestop
[i
] + 'a' - 1);
107 fprintf(tabout
, ".nr #a 0-1\n");
108 fprintf(tabout
, ".eo\n");
109 fprintf(tabout
, ".de T#\n");
110 fprintf(tabout
, ".nr 35 1m\n");
111 fprintf(tabout
, ".ds #d .d\n");
112 fprintf(tabout
, ".if \\(ts\\n(.z\\(ts\\(ts .ds #d nl\n");
113 fprintf(tabout
, ".mk ##\n");
114 fprintf(tabout
, ".nr ## -1v\n");
115 fprintf(tabout
, ".ls 1\n");
116 for (i
= 0; i
< MAXHEAD
; i
++)
118 fprintf(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 fprintf(tabout
, ".if \\n(T. .vs \\n(.vu-\\n(.sp\n");
124 fprintf(tabout
, ".if \\n(T. ");
125 drawline(nlin
, 0, ncol
, dboxflg
? '=' : '-', 1, 0);
126 fprintf(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 fprintf(tabout
, ".if \\n(#%c>=0 .sp -1\n", linestop
[lf
] + 'a' - 1);
133 fprintf(tabout
, ".if \\n(#%c>=0 ", linestop
[lf
] + 'a' - 1);
135 drawvert(lf
, nlin
- 1, c
, lwid
);
136 fprintf(tabout
, "\\h'|\\n(TWu'\n");
139 if (boxflg
|| allflg
|| dboxflg
) /* right hand line */ {
140 fprintf(tabout
, ".if \\n(#a>=0 .sp -1\n");
141 fprintf(tabout
, ".if \\n(#a>=0 \\h'|\\n(TWu'");
142 drawvert (0, nlin
- 1, ncol
, dboxflg
? 2 : 1);
143 fprintf(tabout
, "\n");
145 fprintf(tabout
, ".ls\n");
146 fprintf(tabout
, "..\n");
147 fprintf(tabout
, ".ec\n");