mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-25 10:58:52 +00:00
03f0392849
This fixes the following tests: export/examples/ja/Modules/Rnw_%28knitr%29_lyx22 export/examples/ja/Modules/Rnw_%28knitr%29_lyx23 export/examples/ja/Modules/Sweave_lyx22 export/examples/ja/Modules/Sweave_lyx23
61 lines
1.2 KiB
Perl
61 lines
1.2 KiB
Perl
#! /usr/bin/env perl
|
|
# -*- mode: perl; -*-
|
|
|
|
#
|
|
use strict;
|
|
|
|
my $useNonTexFonts = undef;
|
|
my $outputFormat = undef;
|
|
my $outputFormat = undef;
|
|
my $language = undef;
|
|
if (-e "$ARGV[0]") {
|
|
if (open(FI, "$ARGV[0]")) {
|
|
while (my $l = <FI>) {
|
|
chomp($l);
|
|
if ($l =~ /^\\use_non_tex_fonts\s+([a-z]+)/) {
|
|
$useNonTexFonts = ($1 eq "true");
|
|
}
|
|
elsif ($l =~ /^\\default_output_format\s+([a-z0-9]+)/) {
|
|
$outputFormat = $1;
|
|
}
|
|
elsif ($l =~ /\\language\s+([\-a-z_]+)/) {
|
|
$language = $1;
|
|
}
|
|
last if (defined($useNonTexFonts) && defined($outputFormat) && defined($language));
|
|
}
|
|
close(FI);
|
|
}
|
|
}
|
|
if (defined($useNonTexFonts) && defined($outputFormat)) {
|
|
if ($useNonTexFonts) {
|
|
if ($outputFormat eq "default") {
|
|
if ($language eq "japanese") {
|
|
$outputFormat = "pdf4";
|
|
}
|
|
else {
|
|
$outputFormat = "pdf5";
|
|
}
|
|
}
|
|
}
|
|
elsif ($outputFormat eq "default") {
|
|
if ($language eq "japanese") {
|
|
$outputFormat = "pdf3";
|
|
}
|
|
else {
|
|
$outputFormat = "pdf2";
|
|
}
|
|
}
|
|
if ($outputFormat !~ /^pdf/) {
|
|
$outputFormat = undef;
|
|
}
|
|
}
|
|
|
|
if (defined($outputFormat)) {
|
|
print "$outputFormat";
|
|
}
|
|
else {
|
|
print "undefined_output_format";
|
|
}
|
|
|
|
exit(0);
|