/* t7.c: control to write table entries */
# define realsplit ((ct=='a'||ct=='n') && table[ldata][c].rcol)
if (boxflg
|| allflg
|| dboxflg
) need();
fprintf(tabout
, ".nr #I \\n(.i\n");
fprintf(tabout
, ".in +(\\n(.lu-\\n(TWu-\\n(.iu)/2u\n");
fprintf(tabout
, ".fc %c %c\n", F1
, F2
);
fprintf(tabout
, ".nr #T 0-1\n");
fprintf(tabout
, ".fc\n");
fprintf(tabout
, ".nr T. 1\n");
fprintf(tabout
, ".T# 1\n");
fprintf(tabout
, ".in \\n(#Iu\n");
for(lf
=prev(lform
); lf
>=0 && vspen(table
[lf
][c
].col
); lf
=prev(lf
))
switch(ct
=ctype(vforml
,c
))
if (table
[ldata
][c
].rcol
)
if (lused
[c
]) /*Zero field width*/
fprintf(tabout
, "\\n(%du ",c
+CMID
);
if (realsplit
? rused
[c
]: (used
[c
]+lused
[c
]))
fprintf(tabout
, "\\n(%du ",c
+CRIGHT
);
fprintf(tabout
, "\\n(%du ", c
+CRIGHT
);
if (s
[0] == '_') return('-');
if (s
[0] == '=') return('=');
for(texlin
=horlin
=i
=0; i
<nlin
; i
++)
fprintf(tabout
, ".ne %dv+%dp\n",texlin
,2*horlin
);
fprintf(tabout
, ".nr #%c 0-1\n", linestop
[i
]+'a'-1);
fprintf(tabout
, ".nr #a 0-1\n");
fprintf(tabout
, ".eo\n");
fprintf(tabout
, ".de T#\n");
fprintf(tabout
, ".ds #d .d\n");
fprintf(tabout
, ".if \\(ts\\n(.z\\(ts\\(ts .ds #d nl\n");
fprintf(tabout
, ".mk ##\n");
fprintf(tabout
, ".nr ## -1v\n");
fprintf(tabout
, ".ls 1\n");
fprintf(tabout
, ".if \\n(#T>=0 .nr #%c \\n(#T\n",linestop
[i
]+'a'-1);
if (boxflg
|| allflg
|| dboxflg
) /* bottom of table line */
fprintf(tabout
, ".if \\n(T. .vs \\n(.vu-\\n(.sp\n");
fprintf(tabout
, ".if \\n(T. ");
drawline(nlin
,0,ncol
, dboxflg
? '=' : '-',1,0);
fprintf(tabout
, "\n.if \\n(T. .vs\n");
/* T. is really an argument to a macro but because of
eqn we don't dare pass it as an argument and reference by $1 */
if ((lf
=left(nlin
-1,c
, &lwid
))>=0)
fprintf(tabout
, ".if \\n(#%c>=0 .sp -1\n",linestop
[lf
]+'a'-1);
fprintf(tabout
, ".if \\n(#%c>=0 ", linestop
[lf
]+'a'-1);
drawvert(lf
, nlin
-1, c
, lwid
);
fprintf(tabout
, "\\h'|\\n(TWu'\n");
if (boxflg
|| allflg
|| dboxflg
) /* right hand line */
fprintf(tabout
, ".if \\n(#a>=0 .sp -1\n");
fprintf(tabout
, ".if \\n(#a>=0 \\h'|\\n(TWu'");
drawvert (0, nlin
-1, ncol
, dboxflg
? 2 : 1);
fprintf(tabout
, ".ls\n");
fprintf(tabout
, ".ec\n");