From ba233a63330839f96a92a8001e13f7e1e120f7d5 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Mon, 18 May 2009 14:43:26 +0000 Subject: [PATCH] Den Namen bzw. den Pfad zum LaTeX-Executable konfigurierbar gemacht. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Fix für Bug 942. --- SL/Template.pm | 12 ++++++++++-- config/lx-erp.conf | 5 ++++- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/SL/Template.pm b/SL/Template.pm index 8300458b7..99ca0f8bf 100644 --- a/SL/Template.pm +++ b/SL/Template.pm @@ -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) = @_; diff --git a/config/lx-erp.conf b/config/lx-erp.conf index c133130a4..83e5ebb4f 100644 --- a/config/lx-erp.conf +++ b/config/lx-erp.conf @@ -1,5 +1,6 @@ use Cwd; use vars qw($userspath $spool $memberfile $templates $sendmail $language $sid $latex $eur $webdav $lizenzen $vertreter $pg_dump_exe $pg_restore_exe $watch_form_variables); +use vars qw($latex_bin); # path to user configuration files $userspath = "users"; @@ -72,7 +73,9 @@ $dbcharset = 'UTF-8'; # F $html2ps_bin = "/usr/bin/html2ps"; $ghostscript_bin = "/usr/bin/gs"; - +# Name von bzw. Pfad zu 'pdflatex' oder einer anderen kompatiblen Version +# wie z.B. 'xetex' +$latex_bin = 'pdflatex'; # Datenbankbackups werden mit dem externen Programm "pg_dump" erledigt. # Wenn es nicht im aktuellen Pfad vorhanden ist, so muss hier der vollständige -- 2.20.1