]> wagnertech.de Git - mfinanz.git/blobdiff - SL/Template/LaTeX.pm
Auftrags-Controller: js accessor angepasst
[mfinanz.git] / SL / Template / LaTeX.pm
index 31cb28fb3c67057eb4571fb7869326f6d91a3912..352f793e12fc25d6aa81a2a399efc06eebed7a36 100644 (file)
@@ -437,6 +437,8 @@ sub parse {
       $contents = "[% TAGS $self->{tag_start} $self->{tag_end} %]\n" . $contents;
     }
 
+    $form->prepare_global_vars;
+
     $::form->init_template->process(\$contents, $form, \$new_contents) || die $::form->template->error;
   } else {
     $new_contents = $self->parse_block($contents);
@@ -480,8 +482,10 @@ sub convert_to_postscript {
   $ENV{openin_any} = "p";
 
   for (my $run = 1; $run <= 2; $run++) {
-    system("${latex} --interaction=nonstopmode $form->{tmpfile} " .
-           "> $form->{tmpfile}.err");
+    if (system("${latex} --interaction=nonstopmode $form->{tmpfile} " .
+               "> $form->{tmpfile}.err") == -1) {
+      die "system call to $latex failed: $!";
+    }
     if ($?) {
       $ENV{HOME} = $old_home;
       $ENV{openin_any} = $old_openin_any;
@@ -492,12 +496,14 @@ sub convert_to_postscript {
 
   $form->{tmpfile} =~ s/tex$/dvi/;
 
-  system("dvips $form->{tmpfile} -o -q > /dev/null");
+  if (system("dvips $form->{tmpfile} -o -q > /dev/null") == -1) {
+    die "system call to dvips failed: $!";
+  }
   $ENV{HOME} = $old_home;
   $ENV{openin_any} = $old_openin_any;
 
   if ($?) {
-    $self->{"error"} = "dvips : $!";
+    $self->{"error"} = "dvips : $?";
     $self->cleanup('dvips');
     return 0;
   }
@@ -530,8 +536,11 @@ sub convert_to_pdf {
   $ENV{openin_any} = "p";
 
   for (my $run = 1; $run <= 2; $run++) {
-    system("${latex} --interaction=nonstopmode $form->{tmpfile} " .
-           "> $form->{tmpfile}.err");
+    if (system("${latex} --interaction=nonstopmode $form->{tmpfile} " .
+               "> $form->{tmpfile}.err") == -1) {
+      die "system call to $latex failed: $!";
+    }
+
     if ($?) {
       $ENV{HOME}     = $old_home;
       $ENV{openin_any} = $old_openin_any;