trap "rm $tmp ; exit" 2 3 15
: create toc input file for one section only
&& < $file grep '^\.TH' | grep local >/dev/null \
|| < $file sed -n '1p' | grep '^\.so' >/dev/null \
-e "s/^/`basename $file | sed 's/\.\([^\.]*\)\$/(\1)/'` /" \
: tocx files for all sections and everything else
: permuted index and toc files
echo "tocx? files missing; must run tocrc all first"
ptx -r -t -b break -f -w 108 -i ignore cattoc man0/ptxx
cd man0; troff -g ptx.in >t.ptx ; cd ..
< man0/tocx$x grep '^intro' >$tmp
cd man0; troff -g toc.in >t.toc ; cd ..