formatting

This commit is contained in:
rsc 2007-08-14 18:42:34 +00:00
parent 29ff8d495c
commit f1f8dd91bc
6 changed files with 63 additions and 4 deletions

43
runoff
View file

@ -35,6 +35,7 @@ pr -e8 -t runoff.list | awk '
close(f)
n=$1
printf("%02d %s\n", n/100, s);
printf("TOC: %04d %s\n", n, s) >"fmt/tocdata"
next
}
{
@ -42,6 +43,48 @@ pr -e8 -t runoff.list | awk '
}' | pr -3 -t >>fmt/toc
cat toc.ftr >>fmt/toc
# check for bad alignments
perl -e '
while(<>){
chomp;
s!#.*!!;
s!\s+! !g;
s! +$!!;
next if /^$/;
if(/TOC: (\d+) (.*)/){
$toc{$2} = $1;
next;
}
if(/even: (.*)/){
$file = $1;
if(!defined($toc{$file})){
print STDERR "Have no toc for $file\n";
next;
}
if($toc{$file} =~ /^\d\d[^0]/){
print STDERR "$file does not start on a fresh page.\n";
}
next;
}
if(/odd: (.*)/){
$file = $1;
if(!defined($toc{$file})){
print STDERR "Have no toc for $file\n";
next;
}
if($toc{$file} =~ /^\d\d[^5]/){
print STDERR "$file does not start on a second half page.\n";
}
next;
}
print STDERR "Unknown spec: $_\n";
}
' fmt/tocdata runoff.spec
# make definition list
cd fmt
perl -e '