3 BEGIN { n = 0; opts = 0; sep = 0; }
5 /^\.\\\"\* ([0-9]+) (.*)$/ {
8 for (i = 4; i <= NF; i++) name = name " " $i;
11 /^\.\\\"\+opts$/ { opts = 1; lines[n] = lines[n] "\\h'2n'Options:\n.RS\n"; }
12 /^\.\\\"\-opts$/ { opts = 0; lines[n] = lines[n] ".RE\n"; }
13 /^\.\\\"\+sep$/ { sep = 1; }
14 /^\.\\\"\-sep$/ { sep = 0; }
15 /^\.\\\"\-opts$/ { opts = 0; lines[n] = lines[n] ".RE\n"; }
16 /^\.SP/ { print ".TP"; getline; lines[n] = lines[n] $0 "\n"; }
17 /^\.TP/ { if (opts) { print; getline; lines[n] = lines[n] $0 "\n"; } }
18 /^\.SS/ { if (sep) lines[n] = lines[n] ".PP\n"; }
23 for (i = 0; i < 100; i++) {
24 if (!(i in head)) continue;
25 print ".SS \"" head[i] "\"";