void untext(void) { rstofill(); Bprint(&tabout.Biobufhdr, ".nf\n"); Bprint(&tabout.Biobufhdr, ".ll \\n(%du\n", SL); }
void untext(void) { rstofill(); fprintf(tabout, ".nf\n"); fprintf(tabout, ".ll \\n(%du\n", SL); }
tableput() { saveline(); savefill(); ifdivert(); cleanfc(); getcomm(); getspec(); gettbl(); getstop(); checkuse(); choochar(); maktab(); runout(); release(); rstofill(); endoff(); restline(); }
/* get_text was originally gettext and was renamed */ char * get_text(char *sp, int ilin, int icol, char *fn, char *sz) { /* get a section of text */ char *line = NULL; size_t linesize = 0; char *oname; const char *vs; if (texname==0) texct2 = texname = 300; if (texct2>0 && point(texct2)) { error("Too many text block diversions"); return (char *)-1; } if (textflg==0) { fprintf(tabout, ".nr %d \\n(.lu\n", SL); /* remember old line length */ textflg=1; } fprintf(tabout, ".eo\n"); fprintf(tabout, ".am %02d 00\n", icol+80); fprintf(tabout, ".br\n"); if (texct2 < 0) fprintf(tabout, ".di %c+\n", (int)texname); else fprintf(tabout, ".do di %d+\n", texct2); rstofill(); if (fn && *fn) fprintf(tabout, ".nr %d \\n(.f\n.ft %s\n", S1, fn); fprintf(tabout, ".ft \\n(.f\n"); /* protect font */ vs = vsize[stynum[ilin]][icol]; if ((sz && *sz) || (vs && *vs)) { fprintf(tabout, ".nr %d \\n(.v\n", S2); if (vs==0 || *vs==0) vs= "\\n(.s+2"; if (sz && *sz) fprintf(tabout, ".ps %s\n",sz); fprintf(tabout, ".vs %s\n",vs); fprintf(tabout, ".if \\n(%du>\\n(.vu .sp \\n(%du-\\n(.vu\n", S2,S2); } if (cll[icol][0]) fprintf(tabout, ".ll %sn\n", cll[icol]); else fprintf(tabout, ".ll \\n(%du*%du/%du\n",SL,ctspan(ilin,icol),ncol+1); fprintf(tabout,".if \\n(.l<\\n(%d .ll \\n(%du\n", icol+CRIGHT, icol+CRIGHT); if (ctype(ilin,icol)=='a') fprintf(tabout, ".ll -2n\n"); fprintf(tabout, ".in 0\n"); while (gets1(&line, &line, &linesize)) { if (line[0]=='T' && line[1]=='}' && line[2]== tab) break; if (strcmp("T}", line) == 0) break; fprintf(tabout, "%s\n", line); } if (fn && *fn) fprintf(tabout, ".ft \\n(%d\n", S1); if (sz && *sz) fprintf(tabout, ".br\n.ps\n.vs\n"); fprintf(tabout, ".br\n"); fprintf(tabout, ".di\n"); if (texct2 < 0) { fprintf(tabout, ".nr %c| \\n(dn\n", (int)texname); fprintf(tabout, ".nr %c- \\n(dl\n", (int)texname); } else { fprintf(tabout, ".do nr %d| \\n(dn\n", texct2); fprintf(tabout, ".do nr %d- \\n(dl\n", texct2); } fprintf(tabout, ".00\n"); fprintf(tabout, ".ec \\\n"); /* copy remainder of line */ if (line[2]) tcopy (sp, line+3); else *sp=0; oname = (char *)texname; if (texct2 < 0) texname = texstr[++texct]; else texname = ++texct2; free(line); return oname; }
int gettext9(char *sp, int ilin, int icol, char *fn, char *sz) { /* get a section of text */ char line[4096]; int oname, startline; char *vs; startline = iline; if (texname == 0) error("Too many text block diversions"); if (textflg == 0) { Bprint(&tabout.Biobufhdr, ".nr %d \\n(.lu\n", SL); /* remember old line length */ textflg = 1; } Bprint(&tabout.Biobufhdr, ".eo\n"); Bprint(&tabout.Biobufhdr, ".am %s\n", reg(icol, CRIGHT)); Bprint(&tabout.Biobufhdr, ".br\n"); Bprint(&tabout.Biobufhdr, ".di %c+\n", texname); rstofill(); if (fn && *fn) Bprint(&tabout.Biobufhdr, ".nr %d \\n(.f\n.ft %s\n", S1, fn); Bprint(&tabout.Biobufhdr, ".ft \\n(.f\n"); /* protect font */ vs = vsize[icol][stynum[ilin]]; if ((sz && *sz) || (vs && *vs)) { Bprint(&tabout.Biobufhdr, ".nr %d \\n(.v\n", S9); if (vs == 0 || *vs == 0) vs = "\\n(.s+2"; if (sz && *sz) Bprint(&tabout.Biobufhdr, ".ps %s\n", sz); Bprint(&tabout.Biobufhdr, ".vs %s\n", vs); Bprint(&tabout.Biobufhdr, ".if \\n(%du>\\n(.vu .sp \\n(%du-\\n(.vu\n", S9, S9); } if (cll[icol][0]) Bprint(&tabout.Biobufhdr, ".ll %sn\n", cll[icol]); else Bprint(&tabout.Biobufhdr, ".ll \\n(%du*%du/%du\n", SL, ctspan(ilin, icol), ncol + 1); Bprint(&tabout.Biobufhdr, ".if \\n(.l<\\n(%2s .ll \\n(%2su\n", reg(icol, CRIGHT), reg(icol, CRIGHT)); if (ctype(ilin, icol) == 'a') Bprint(&tabout.Biobufhdr, ".ll -2n\n"); Bprint(&tabout.Biobufhdr, ".in 0\n"); for (;;) { if (gets1(line, sizeof(line)) == nil) { iline = startline; error("missing closing T}"); } if (line[0] == 'T' && line[1] == '}' && line[2] == tab) break; if (match("T}", line)) break; Bprint(&tabout.Biobufhdr, "%s\n", line); } if (fn && *fn) Bprint(&tabout.Biobufhdr, ".ft \\n(%d\n", S1); if (sz && *sz) Bprint(&tabout.Biobufhdr, ".br\n.ps\n.vs\n"); Bprint(&tabout.Biobufhdr, ".br\n"); Bprint(&tabout.Biobufhdr, ".di\n"); Bprint(&tabout.Biobufhdr, ".nr %c| \\n(dn\n", texname); Bprint(&tabout.Biobufhdr, ".nr %c- \\n(dl\n", texname); Bprint(&tabout.Biobufhdr, "..\n"); Bprint(&tabout.Biobufhdr, ".ec \\\n"); /* copy remainder of line */ if (line[2]) tcopy (sp, line + 3); else *sp = 0; oname = texname; texname = texstr[++texct]; return(oname); }