summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--scripts/context/perl/mptopdf.pl14
-rw-r--r--scripts/context/ruby/base/tex.rb16
-rw-r--r--scripts/context/ruby/base/texutil.rb10
-rw-r--r--scripts/context/ruby/rlxtools.rb1
-rw-r--r--scripts/context/ruby/texexec.rb2
5 files changed, 27 insertions, 16 deletions
diff --git a/scripts/context/perl/mptopdf.pl b/scripts/context/perl/mptopdf.pl
index b1589a9d3..a6b946baa 100644
--- a/scripts/context/perl/mptopdf.pl
+++ b/scripts/context/perl/mptopdf.pl
@@ -37,12 +37,11 @@ my $PassOn = '' ;
"passon" => \$PassOn,
"latex" => \$Latex ) ;
-my $program = "MPtoPDF 1.3.2" ;
+my $program = "MPtoPDF 1.3.3" ;
my $pattern = "@ARGV" ; # was $ARGV[0]
my $miktex = 0 ;
my $done = 0 ;
my $report = '' ;
-my $texlatexswitch = " --tex=latex --format=latex " ;
my $mplatexswitch = " --tex=latex " ;
my $dosish = ($Config{'osname'} =~/^(ms)?dos|^os\/2|^mswin/i) ;
@@ -94,12 +93,15 @@ if (($pattern eq '')||($Help)) {
}
} else {
if ($Latex) {
- $rest .= " $texlatexswitch" ;
+ $rest .= " $mplatexswitch" ;
+ $mpbin = "mpost --mem=mpost" ;
+ } else {
+ $mpbin = "texexec --mptex $PassOn " ;
}
- $mpbin = "texexec --mptex $PassOn" ;
}
- print "\n$program : running '$mpbin'\n" ;
- my $error = system ("$mpbin $rest $pattern") ;
+ my $runner = "$mpbin $rest $pattern" ;
+ print "\n$program : running '$runner'\n" ;
+ my $error = system ($runner) ;
if ($error) {
print "\n$program : error while processing mp file\n" ;
exit ;
diff --git a/scripts/context/ruby/base/tex.rb b/scripts/context/ruby/base/tex.rb
index bb961111c..6c77ab059 100644
--- a/scripts/context/ruby/base/tex.rb
+++ b/scripts/context/ruby/base/tex.rb
@@ -153,11 +153,12 @@ class TEX
['pdftex','pdfetex','aleph','omega',
'xetex','luatex'] .each do |p| @@prognames[p] = 'context' end
['mpost'] .each do |p| @@prognames[p] = 'metafun' end
+ ['latex','pdflatex'] .each do |p| @@prognames[p] = 'latex' end
['plain','default','standard','mptopdf'] .each do |f| @@texmethods[f] = 'plain' end
['cont-en','cont-nl','cont-de','cont-it',
'cont-fr','cont-cz','cont-ro','cont-uk'] .each do |f| @@texmethods[f] = 'context' end
- ['latex'] .each do |f| @@texmethods[f] = 'latex' end
+ ['latex','pdflatex'] .each do |f| @@texmethods[f] = 'latex' end
['plain','default','standard'] .each do |f| @@mpsmethods[f] = 'plain' end
['metafun'] .each do |f| @@mpsmethods[f] = 'metafun' end
@@ -479,8 +480,10 @@ class TEX
def validprogname(str)
if str then
[str].flatten.each do |s|
+ s = s.sub(/\.\S*/,"")
return @@prognames[s] if @@prognames.key?(s)
end
+ return str[0].sub(/\.\S*/,"")
else
return nil
end
@@ -496,11 +499,7 @@ class TEX
else return ""
end
if format then
- # if engine then
- # "#{prefix}=#{engine}/#{format}"
- # else
- "#{prefix}=#{format}"
- # end
+ "#{prefix}=#{format.sub(/\.\S+$/,"")}"
else
prefix
end
@@ -910,9 +909,14 @@ class TEX
end
if ok then
# we have a valid line
+
@@preamblekeys.each do |v|
setvariable(v[1],vars[v[0]]) if vars.key?(v[0]) && vars[v[0]]
end
+
+if getvariable('given.backend') == "standard" or getvariable('given.backend') == "" then
+ setvariable('backend',@@backends[getvariable('texengine')] || 'standard')
+end
break
end
else
diff --git a/scripts/context/ruby/base/texutil.rb b/scripts/context/ruby/base/texutil.rb
index 7c402b98f..31f0efb51 100644
--- a/scripts/context/ruby/base/texutil.rb
+++ b/scripts/context/ruby/base/texutil.rb
@@ -447,10 +447,12 @@ class TeXUtil
end
def MyExtras::finalizer(logger)
- @@programs.each do |p|
- cmd = @@programs[p.to_i]
- logger.report("running #{cmd}")
- system(cmd)
+unless (ENV["CTX.TEXUTIL.EXTRAS"] =~ /^(no|off|false|0)$/io) || (ENV["CTX_TEXUTIL_EXTRAS"] =~ /^(no|off|false|0)$/io) then
+ @@programs.each do |p|
+ cmd = @@programs[p.to_i]
+ logger.report("running #{cmd}")
+ system(cmd)
+end
end
end
diff --git a/scripts/context/ruby/rlxtools.rb b/scripts/context/ruby/rlxtools.rb
index ea065612f..1617fcad4 100644
--- a/scripts/context/ruby/rlxtools.rb
+++ b/scripts/context/ruby/rlxtools.rb
@@ -300,6 +300,7 @@ class Commands
begin
str = nil
if FileTest.file?(filename) then
+ # todo: use pdfinto for pdf files, identify is bugged
if centimeters then
result = `identify -units PixelsPerCentimeter -format \"x=%x,y=%y,w=%w,h=%h,b=%b\" #{filename}`.chomp.split(',')
else
diff --git a/scripts/context/ruby/texexec.rb b/scripts/context/ruby/texexec.rb
index 9b79369d8..568bbee1c 100644
--- a/scripts/context/ruby/texexec.rb
+++ b/scripts/context/ruby/texexec.rb
@@ -570,6 +570,8 @@ class Commands
job.setvariable(k,@commandline.option(k)) unless @commandline.option(k).empty?
end
+job.setvariable('given.backend',job.getvariable('backend'))
+
if (str = @commandline.option('engine')) && ! str.standard? && ! str.empty? then
job.setvariable('texengine',str)
elsif @commandline.oneof('pdfetex','pdftex','pdf') then