#!/usr/bin/perl -s -I /home/mp/new_site/mp =head1 NAME hv2smallbook - a perl script to make booklets for duplex printers =head1 SYNOPSIS livro2smallbook [-comp] [-a6|-a5|-a4] [-q] [-nodest] doc.xml =head1 DESCRIPTION This command accepts a set of documents following C and makes a smallbook with them (including, frontpage, table of contents, etc). Output is sent to C. Option C<-nodest> to ignore C tag. Option C<-q> is used to run in nonstop mode. Option C<-comp> has less newages... =head1 Dependencies This commands need LaTeX smallbook psutils =head1 AUTHOR José João Almeida Museu da Pessoa (http://alfarrabio.di.uminho.pt/mp) =cut use mp; my $f2 = "$ARGV[0].ps"; $f = "_hv_$$"; mp::livro2latex({ output => $f, ($nodest ? ( nodest => 1 ):()), ($a5 ? ( size => "a5" ):()), ($a5s ? ( size => "a5s" ):()), ($ag ? ( size => "agenda" ):()), ($a6 ? ( size => "a6" ):()), ($a4 ? ( size => "a4" ):()), ($comp ? ( compact => "compact" ):())}, @ARGV); if($q) { $q=' -q '} else {$q=''} if ($a5 || $a5s) {system ("smallbook $q -a5 $f.tex $f2");} elsif ($a6) {system ("smallbook $q -a6 $f.tex $f2");} elsif ($a4) {system ("latex $f"); system ("dvips -o $f2 $f");} else {system ("smallbook $q -ag $f.tex $f2");} $remove = "_hv_$$.*"; system( "rm $remove" ) unless $dontrm;