#!/usr/bin/perl -s -I /home/mp/new_site/mp =encoding utf8 =head1 NAME hv2smallbook - a perl script to make booklets for duplex printers =head1 SYNOPSIS hv2smallbook [-a6|-a5|-a4] [-tit=...] [-autor=...] [-pre=preambulp] [-end=endings] [-q] [-single] [-proj=....] [-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). Default title (Histórias de vida) can be changed with C<-tit="...">. Default author (Museu da pessoa) can be changed with C<-autor="..."> Output is sent to C. Option C<-nodest> to ignore C tag. Option C<-q> is used to run in nonstop mode. Option C<-single> -- single story (title and project extrated from the story) Option C<-dontrm> -- keep auxiliar files for debug =head1 Dependencies This commands need LaTeX psmallbook psutils =head1 AUTHOR José João Almeida Museu da Pessoa (http://alfarrabio.di.uminho.pt/mp) =cut use mp; my $f2 = "$ARGV[0].pdf"; $f = "_hv_$$"; mp::hv2latex({ output => $f, ($pre ? ( pre => scalar `cat $pre` ):()), ($end ? ( end => scalar `cat $end` ):()), ($single ? ( single => 1 ):()), ($nodest ? ( nodest => 1 ):()), ($a5 ? ( size => "a5" ):()), ($ag ? ( size => "agbook" ):()), ($a6 ? ( size => "a6" ):()), ($a4 ? ( size => "a4" ):()), ($proj ? ( projecto => $proj ):()), ($tit ? ( tit => $tit ):()), ($author||$autor ? ( autor => "$author$autor" ):()),}, @ARGV); if($q) { $q=' -q '} else {$q=''} system ("pdflatex $f"); if ($a5) {system ("psmallbook $q -a5 -o=$f2 $f.tex");} elsif ($a6) {system ("psmallbook $q -a6 -o=$f2 $f.tex");} elsif ($a4) {system ("pdflatex $f");} else {system ("psmallbook $q -ag -o=$f2 $f.tex");} $remove = "_hv_$$.*"; system( "rm $remove" ) unless $dontrm;