#!/usr/bin/perl -s -I /home/mp/new_site/mp =head1 NAME ESCRIBA2smallbook - PSbooklets for duplex printers from Scriptorium XML format =head1 SYNOPSIS ESCRIBA2smallbook [-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) =head1 Dependencies This commands need LaTeX smallbook psutils See also Scriptorium transcription tool. =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::ESCRIBA2latex({ output => $f, ($pre ? ( pre => scalar `cat $pre` ):()), ($end ? ( end => scalar `cat $end` ):()), ($single ? ( single => 1 ):()), ($nodest ? ( nodest => 1 ):()), ($a5 ? ( size => "a5" ):()), ($ag ? ( size => "agenda" ):()), ($a6 ? ( size => "a6" ):()), ($a4 ? ( size => "a4" ):()), ($proj ? ( projecto => $proj ):()), ($tit ? ( tit => $tit ):()), ($author||$autor ? ( autor => "$author$autor" ):()),}, @ARGV); if($q) { $q=' -q '} else {$q=''} if ($a5) {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;