Den Namen bzw. den Pfad zum LaTeX-Executable konfigurierbar gemacht.
[kivitendo-erp.git] / SL / Template.pm
index 8300458..99ca0f8 100644 (file)
@@ -523,8 +523,10 @@ sub convert_to_postscript {
 
   $form->{tmpfile} =~ s/\Q$userspath\E\///g;
 
+  my $latex = $self->_get_latex_path();
+
   for (my $run = 1; $run <= 2; $run++) {
-    system("latex --interaction=nonstopmode $form->{tmpfile} " .
+    system("${latex} --interaction=nonstopmode $form->{tmpfile} " .
            "> $form->{tmpfile}.err");
     if ($?) {
       $self->{"error"} = $form->cleanup();
@@ -562,8 +564,10 @@ sub convert_to_pdf {
 
   $form->{tmpfile} =~ s/\Q$userspath\E\///g;
 
+  my $latex = $self->_get_latex_path();
+
   for (my $run = 1; $run <= 2; $run++) {
-    system("pdflatex --interaction=nonstopmode $form->{tmpfile} " .
+    system("${latex} --interaction=nonstopmode $form->{tmpfile} " .
            "> $form->{tmpfile}.err");
     if ($?) {
       $self->{"error"} = $form->cleanup();
@@ -577,6 +581,10 @@ sub convert_to_pdf {
   $self->cleanup();
 }
 
+sub _get_latex_path {
+  return $main::latex_bin || 'pdflatex';
+}
+
 sub get_mime_type() {
   my ($self) = @_;