From f1f8dd91bc4e8b58972f17416b664f3a950092cd Mon Sep 17 00:00:00 2001 From: rsc Date: Tue, 14 Aug 2007 18:42:34 +0000 Subject: formatting --- runoff | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) (limited to 'runoff') diff --git a/runoff b/runoff index 919d837..092c8b6 100755 --- a/runoff +++ b/runoff @@ -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 ' -- cgit v1.2.3