use strict;
use Cwd;
+use Unicode::Normalize qw();
sub new {
my $type = shift;
my $keyword_pos = $pos - 1 + $tag_start_len;
- if ((substr($text, $keyword_pos, 2) eq 'if') || (substr($text, $keyword_pos, 3) eq 'foreach')) {
+ if ((substr($text, $keyword_pos, 2) eq 'if') || (substr($text, $keyword_pos, 7) eq 'foreach')) {
$depth++;
} elsif ((substr($text, $keyword_pos, 4) eq 'else') && (1 == $depth)) {
return 0;
}
- binmode OUT, ":utf8" if $::locale->is_utf8;
- print(OUT $new_contents);
+ if ($::locale->is_utf8) {
+ binmode OUT, ":utf8";
+ print OUT Unicode::Normalize::normalize('C', $new_contents);
+
+ } else {
+ print OUT $new_contents;
+ }
if ($form->{"format"} =~ /postscript/i) {
return $self->convert_to_postscript();
"> $form->{tmpfile}.err");
if ($?) {
$ENV{HOME} = $old_home;
- $self->{"error"} = $form->cleanup();
- $self->cleanup();
+ $self->{"error"} = $form->cleanup($latex);
return 0;
}
}
if ($?) {
$self->{"error"} = "dvips : $!";
- $self->cleanup();
+ $self->cleanup('dvips');
return 0;
}
$form->{tmpfile} =~ s/dvi$/ps/;
system("${latex} --interaction=nonstopmode $form->{tmpfile} " .
"> $form->{tmpfile}.err");
if ($?) {
- $ENV{HOME} = $old_home;
- $self->{"error"} = $form->cleanup();
- $self->cleanup();
+ $ENV{HOME} = $old_home;
+ $self->{error} = $form->cleanup($latex);
return 0;
}
}
}
sub _get_latex_path {
- return $main::latex_bin || 'pdflatex';
+ return $::lx_office_conf{applications}->{latex} || 'pdflatex';
}
sub get_mime_type() {