From c7ceb71d5757db21a2228ec33bde2f4da1677094 Mon Sep 17 00:00:00 2001 From: Austin Clements Date: Tue, 31 Aug 2010 17:33:04 -0400 Subject: Sheet 1 is a right page now because of the (much) longer cross-ref --- runoff | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'runoff') diff --git a/runoff b/runoff index 21ee8ed..0e0e49e 100755 --- a/runoff +++ b/runoff @@ -89,16 +89,17 @@ perl -e ' print STDERR "Have no toc for $file\n"; next; } - # this assumes that sheet 1 of code is a left page - # double-check the PDF + # this assumes that sheet 1 of code is a right page + # double-check the PDF. swap the two regexps below + # otherwise. if(!$leftwarn++) { - print STDERR "assuming that sheet 1 is a left page. double-check!\n"; + print STDERR "assuming that sheet 1 is a right page. double-check!\n"; } - if($what eq "left" && !($toc{$file} =~ /^\d[13579]0/)){ + if($what eq "left" && !($toc{$file} =~ /^\d[02468]0/)){ print STDERR "$file does not start on a fresh left page [$toc{$file}]\n"; } # why does this not work if I inline $x in the if? - $x = ($toc{$file} =~ /^\d[02468]0/); + $x = ($toc{$file} =~ /^\d[13579]0/); if($what eq "right" && !$x){ print STDERR "$file does not start on a fresh right page [$toc{$file}] [$x]\n"; } -- cgit v1.2.3 From 13b3f4d2e32eee81ba039ad3c6a6c97bfc9d4638 Mon Sep 17 00:00:00 2001 From: Austin Clements Date: Tue, 31 Aug 2010 17:46:30 -0400 Subject: Make it possible to express half-page preferences --- runoff | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'runoff') diff --git a/runoff b/runoff index 0e0e49e..14db252 100755 --- a/runoff +++ b/runoff @@ -82,9 +82,10 @@ perl -e ' next; } - if(/(left|right): (.*)/){ + if(/(left|right)(\+?): (.*)/){ $what = $1; - $file = $2; + $tens = ($2 eq "+" ? "5" : "0"); + $file = $3; if(!defined($toc{$file})){ print STDERR "Have no toc for $file\n"; next; @@ -95,11 +96,11 @@ perl -e ' if(!$leftwarn++) { print STDERR "assuming that sheet 1 is a right page. double-check!\n"; } - if($what eq "left" && !($toc{$file} =~ /^\d[02468]0/)){ + if($what eq "left" && !($toc{$file} =~ /^\d[02468]$tens/)){ print STDERR "$file does not start on a fresh left page [$toc{$file}]\n"; } # why does this not work if I inline $x in the if? - $x = ($toc{$file} =~ /^\d[13579]0/); + $x = ($toc{$file} =~ /^\d[13579]$tens/); if($what eq "right" && !$x){ print STDERR "$file does not start on a fresh right page [$toc{$file}] [$x]\n"; } -- cgit v1.2.3 From 0fa1ab632f6e328321cdec779e66ed07cac89d04 Mon Sep 17 00:00:00 2001 From: Austin Clements Date: Thu, 2 Sep 2010 03:56:36 -0400 Subject: Pack five columns into cross-ref. This saves us an entire page and fixes the single dangling line. --- runoff | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'runoff') diff --git a/runoff b/runoff index 14db252..1435646 100755 --- a/runoff +++ b/runoff @@ -191,7 +191,7 @@ do uses=`egrep -h '([^a-zA-Z_0-9])'$i'($|[^a-zA-Z_0-9])' alltext | awk '{print $1}'` if [ "x$defs" != "x$uses" ]; then echo $i $defs - echo $uses |fmt -24 | sed 's/^/ /' + echo $uses |fmt -29 | sed 's/^/ /' fi done ) >refs -- cgit v1.2.3 From 9d7a63e0734b4c7abe5ae00eda302e7d7a22a482 Mon Sep 17 00:00:00 2001 From: Austin Clements Date: Thu, 2 Sep 2010 03:57:20 -0400 Subject: Specify in runoff.spec which side sheet 1 is on, since it keeps changing --- runoff | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'runoff') diff --git a/runoff b/runoff index 1435646..3dee1cc 100755 --- a/runoff +++ b/runoff @@ -58,6 +58,13 @@ perl -e ' next; } + if(/sheet1: (left|right)$/){ + print STDERR "assuming that sheet 1 is a $1 page. double-check!\n"; + $left = $1 eq "left" ? "13579" : "02468"; + $right = $1 eq "left" ? "02468" : "13579"; + next; + } + if(/even: (.*)/){ $file = $1; if(!defined($toc{$file})){ @@ -90,17 +97,11 @@ perl -e ' print STDERR "Have no toc for $file\n"; next; } - # this assumes that sheet 1 of code is a right page - # double-check the PDF. swap the two regexps below - # otherwise. - if(!$leftwarn++) { - print STDERR "assuming that sheet 1 is a right page. double-check!\n"; - } - if($what eq "left" && !($toc{$file} =~ /^\d[02468]$tens/)){ + if($what eq "left" && !($toc{$file} =~ /^\d[$left]$tens/)){ print STDERR "$file does not start on a fresh left page [$toc{$file}]\n"; } # why does this not work if I inline $x in the if? - $x = ($toc{$file} =~ /^\d[13579]$tens/); + $x = ($toc{$file} =~ /^\d[$right]$tens/); if($what eq "right" && !$x){ print STDERR "$file does not start on a fresh right page [$toc{$file}] [$x]\n"; } -- cgit v1.2.3 From d2c7f6497810f05b961df11db75def7ea79b8ec2 Mon Sep 17 00:00:00 2001 From: Austin Clements Date: Thu, 2 Sep 2010 04:03:42 -0400 Subject: I totally misunderstood the even/odd spec. Add some docs, remove my 'left+' hack, and orthogonalize left/right versus even/odd so you can specify them independently. --- runoff | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'runoff') diff --git a/runoff b/runoff index 3dee1cc..345fb2e 100755 --- a/runoff +++ b/runoff @@ -89,21 +89,20 @@ perl -e ' next; } - if(/(left|right)(\+?): (.*)/){ + if(/(left|right): (.*)/){ $what = $1; - $tens = ($2 eq "+" ? "5" : "0"); - $file = $3; + $file = $2; if(!defined($toc{$file})){ print STDERR "Have no toc for $file\n"; next; } - if($what eq "left" && !($toc{$file} =~ /^\d[$left]$tens/)){ - print STDERR "$file does not start on a fresh left page [$toc{$file}]\n"; + if($what eq "left" && !($toc{$file} =~ /^\d[$left][05]/)){ + print STDERR "$file does not start on a left page [$toc{$file}]\n"; } # why does this not work if I inline $x in the if? - $x = ($toc{$file} =~ /^\d[$right]$tens/); + $x = ($toc{$file} =~ /^\d[$right][05]/); if($what eq "right" && !$x){ - print STDERR "$file does not start on a fresh right page [$toc{$file}] [$x]\n"; + print STDERR "$file does not start on a right page [$toc{$file}] [$x]\n"; } next; } -- cgit v1.2.3 From d599aa2e40fc116d84c609358a9fdc51824b621d Mon Sep 17 00:00:00 2001 From: Austin Clements Date: Thu, 2 Sep 2010 14:08:45 -0400 Subject: Remove unused nop_pause function. --- runoff | 2 ++ 1 file changed, 2 insertions(+) (limited to 'runoff') diff --git a/runoff b/runoff index 345fb2e..2b48cd5 100755 --- a/runoff +++ b/runoff @@ -192,6 +192,8 @@ do if [ "x$defs" != "x$uses" ]; then echo $i $defs echo $uses |fmt -29 | sed 's/^/ /' +# else +# echo $i defined but not used >&2 fi done ) >refs -- cgit v1.2.3