}
# Prototypes
-sub initLyxStack($$);
+sub initLyxStack($$$);
sub diestack($);
sub closeLyxStack();
sub setMatching($);
my @stack = (); # list of HASH-Arrays
my $rFont = {};
my $useNonTexFont = "true";
+my $inputEncoding = undef;
# The elements are:
# type (layout, inset, header, preamble, ...)
# but first set the modified value into $result->[$fileidx]
# numerical value will be replaced with appropriate matching group value
-sub initLyxStack($$)
+sub initLyxStack($$$)
{
$rFont = $_[0];
if ($_[1] eq "systemF") {
}
else {
$useNonTexFont = "false";
+ $inputEncoding = $_[2];
}
$stack[0] = { type => "Starting"};
}
"filetype" => "replace_only",
"result" => ["\\use_non_tex_fonts $useNonTexFont"]);
push(@rElems, $elemntf);
+ if (defined($inputEncoding)) {
+ my $inputenc = newMatch("search" => '^\\\\inputencoding\s+(' . $inputEncoding->{search} . ')',
+ "filetype" => "replace_only",
+ "result" => ["\\inputencoding " . $inputEncoding->{out}]);
+ push(@rElems, $inputenc);
+ }
setMatching(\@rElems);
return(1);
}
export/templates/DocBook_article_(dvi3_|pdf2|pdf[45]_).*
export/templates/JSS-article_(dvi|dvi3_.*|pdf3?)
export/templates/attic/latex8_(dvi|dvi3_.*)
-export/templates/ctex_pdf[23]?
+export/templates/ctex_(pdf[23]?|pdf4_texF)
export/templates/ja_.*(pdf[245]|dvi3).*
#
# The following exports worked with TeX Live 2013, but not in 2014.
$lang = $1;
}
+my $inputEncoding = undef;
if ($fontT eq "systemF") {
if ($lang =~ /^(ru|uk|sk)$/) {
$font{roman} = "DejaVu Serif";
}
else {
# use tex font here
+ if ($format =~ /^(pdf4)$/) { # xelatex
+ # set input encoding to 'ascii' always
+ $inputEncoding = {
+ "search" => '.*', # this will be substituted from '\inputencoding'-line
+ "out" => "ascii",
+ };
+ }
+ elsif ($format =~ /^(dvi3|pdf5)$/) { # (dvi)?lualatex
+ # when to set input encoding to 'ascii'?
+ #$inputEncoding = {
+ # "search" => 'auto|default', # this will be substituted from '\inputencoding'-line
+ # "out" => "ascii",
+ #};
+ }
}
my $sourcedir = dirname($source);
diestack("could not read \"$source\"") if (!open(FI, $source));
diestack("could not write \"$dest\"") if (! open(FO, '>', $dest));
- initLyxStack(\%font, $fontT);
+ initLyxStack(\%font, $fontT, $inputEncoding);
while (my $l = <FI>) {
chomp($l);