#! /usr/bin/perl use Getopt::Long; use warnings; use strict; Getopt::Long::Configure ("bundling"); my $remote = 'graal'; my $pdf2ps = 'pdftops'; my $ps2pdf = 'ps2pdf'; my $pscrop = 'psnup2.pl -s1 -l1'; my $psnup = 'psnup'; my $psbook = 'psbook'; my ($zip,$zcat) = ('bzip2','bzcat'); open(PAPERSIZE, "/etc/papersize") or die "Couldn't read `/etc/papersize'"; my $papersize = ; chomp $papersize or die "Couldn't read papersize"; close PAPERSIZE; my $nup = 1; my $margin = 1; #TODO: units my $crop; my $book; GetOptions( "nup|n=i" => \$nup, "1" => sub { $nup = 1 }, "2" => sub { $nup = 2 }, "4" => sub { $nup = 4 }, "8" => sub { $nup = 8 }, "crop|c" => \$crop, "book|b" => \$book, "margin|m=s" => \$margin ); for (my $n = $nup; $n > 1; $n /= 2) { die "nup should be a power of two" unless $n % 2 == 0; } print $nup, "\n";