1 /* tg.c: process included text blocks */
5 gettext(char *sp, int ilin, int icol, char *fn, char *sz)
7 /* get a section of text */
13 error("Too many text block diversions");
15 fprintf(tabout, ".nr %d \\n(.lu\n", SL); /* remember old line length */
18 fprintf(tabout, ".eo\n");
19 fprintf(tabout, ".am %s\n", reg(icol, CRIGHT));
20 fprintf(tabout, ".br\n");
21 fprintf(tabout, ".di %c+\n", texname);
24 fprintf(tabout, ".nr %d \\n(.f\n.ft %s\n", S1, fn);
25 fprintf(tabout, ".ft \\n(.f\n"); /* protect font */
26 vs = vsize[icol][stynum[ilin]];
27 if ((sz && *sz) || (vs && *vs)) {
28 fprintf(tabout, ".nr %d \\n(.v\n", S9);
29 if (vs == 0 || *vs == 0)
32 fprintf(tabout, ".ps %s\n", sz);
33 fprintf(tabout, ".vs %s\n", vs);
34 fprintf(tabout, ".if \\n(%du>\\n(.vu .sp \\n(%du-\\n(.vu\n", S9, S9);
37 fprintf(tabout, ".ll %sn\n", cll[icol]);
39 fprintf(tabout, ".ll \\n(%du*%du/%du\n", SL, ctspan(ilin, icol), ncol + 1);
40 fprintf(tabout, ".if \\n(.l<\\n(%2s .ll \\n(%2su\n", reg(icol, CRIGHT),
42 if (ctype(ilin, icol) == 'a')
43 fprintf(tabout, ".ll -2n\n");
44 fprintf(tabout, ".in 0\n");
45 while (gets1(line, sizeof(line))) {
46 if (line[0] == 'T' && line[1] == '}' && line[2] == tab)
48 if (match("T}", line))
50 fprintf(tabout, "%s\n", line);
53 fprintf(tabout, ".ft \\n(%d\n", S1);
55 fprintf(tabout, ".br\n.ps\n.vs\n");
56 fprintf(tabout, ".br\n");
57 fprintf(tabout, ".di\n");
58 fprintf(tabout, ".nr %c| \\n(dn\n", texname);
59 fprintf(tabout, ".nr %c- \\n(dl\n", texname);
60 fprintf(tabout, "..\n");
61 fprintf(tabout, ".ec \\\n");
62 /* copy remainder of line */
68 texname = texstr[++texct];
77 fprintf(tabout, ".nf\n");
78 fprintf(tabout, ".ll \\n(%du\n", SL);