version 1.17, 2004/09/14 21:18:44
|
version 1.20, 2018/11/01 03:31:21
|
Line 27
|
Line 27
|
|
|
use strict; |
use strict; |
use Fcntl; |
use Fcntl; |
use POSIX qw(tmpnam); |
use File::Temp; |
|
|
if ( scalar(@ARGV) < 2 ) |
if ( scalar(@ARGV) < 2 ) |
{ |
{ |
Line 57 USAGE
|
Line 57 USAGE
|
exit(); |
exit(); |
} |
} |
|
|
my $tmpdir = tmpnam(); |
my $tmpdir = File::Temp::tempdir(); |
my $fileroot = $ARGV[1]; |
my $fileroot = $ARGV[1]; |
|
|
if (substr($fileroot, -7) eq ".texxml") |
if (substr($fileroot, -7) eq ".texxml") |
Line 76 if ( $ARGV[2] eq '--with-filenames' || $
|
Line 76 if ( $ARGV[2] eq '--with-filenames' || $
|
$include_filenames='--with-filenames'; |
$include_filenames='--with-filenames'; |
} |
} |
|
|
my $redir = ">& /dev/null"; # empty this for easier debugging |
#my $redir = ">& /dev/null"; # empty this for easier debugging |
#my $redir = ">> /home/albertel/error_log.txt"; |
my $redir = "~/error_log.txt"; |
|
system("rm -f $redir"); |
|
$redir=">> $redir"; |
|
|
mkdir $tmpdir, 0755; |
mkdir $tmpdir, 0755; |
|
|
Line 102 system ( "cp $tmpdir/$fileroot.ps .");
|
Line 104 system ( "cp $tmpdir/$fileroot.ps .");
|
print "Converting to PDF (may take a bit)...\n"; |
print "Converting to PDF (may take a bit)...\n"; |
system ( "ps2pdf $fileroot.ps $fileroot.pdf" ); |
system ( "ps2pdf $fileroot.ps $fileroot.pdf" ); |
|
|
|
print "Rescuing log and tex file for debugging ...\n"; |
|
system ("cp $tmpdir/$fileroot.log ."); |
|
system ("cp $tmpdir/$fileroot.tex ."); |
|
|
print "Clearing temp directory...\n"; |
print "Clearing temp directory...\n"; |
system ( "rm -rf $tmpdir" ); |
system ( "rm -rf $tmpdir" ); |
|
|
Line 111 if ( -e $fileroot . ".ps" )
|
Line 117 if ( -e $fileroot . ".ps" )
|
} |
} |
else |
else |
{ |
{ |
print "Generationr of $fileroot.ps failed.\n"; |
print "Generation of $fileroot.ps failed.\n"; |
} |
} |