summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/scripts/context/ruby/texexec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/scripts/context/ruby/texexec.rb')
-rw-r--r--Master/texmf-dist/scripts/context/ruby/texexec.rb33
1 files changed, 22 insertions, 11 deletions
diff --git a/Master/texmf-dist/scripts/context/ruby/texexec.rb b/Master/texmf-dist/scripts/context/ruby/texexec.rb
index f37cfd8c2b0..a09572c6caa 100644
--- a/Master/texmf-dist/scripts/context/ruby/texexec.rb
+++ b/Master/texmf-dist/scripts/context/ruby/texexec.rb
@@ -111,7 +111,7 @@ class Commands
if job = TEX.new(logger) then
prepare(job)
job.cleanuptemprunfiles
- files = @commandline.arguments.sort
+ files = if @commandline.option('sort') then @commandline.arguments.sort else @commandline.arguments end
if files.length > 0 then
if f = File.open(job.tempfilename('tex'),'w') then
backspace = @commandline.checkedoption('backspace', '1.5cm')
@@ -156,7 +156,7 @@ class Commands
prepare(job)
job.cleanuptemprunfiles
fast = @commandline.option('fast')
- files = @commandline.arguments.sort
+ files = if @commandline.option('sort') then @commandline.arguments.sort else @commandline.arguments end
if fast or (files.length > 0) then
if f = File.open(job.tempfilename('tex'),'w') then
files.delete("texexec.pdf")
@@ -202,7 +202,7 @@ class Commands
if job = TEX.new(logger) then
prepare(job)
job.cleanuptemprunfiles
- files = @commandline.arguments.sort
+ files = if @commandline.option('sort') then @commandline.arguments.sort else @commandline.arguments end
msuffixes = ['tex','mkii','mkiv','mp','pl','pm','rb']
if files.length > 0 then
files.each do |fname|
@@ -242,7 +242,7 @@ class Commands
mod << "\\stoptext\n"
mod.close
job.setvariable('interface','english') # redundant
- job.setvariable('simplerun',true)
+ # job.setvariable('simplerun',true)
# job.setvariable('nooptionfile',true)
job.setvariable('files',[job.tempfilename])
result = File.unsuffixed(File.basename(ffname))
@@ -302,7 +302,7 @@ class Commands
if job = TEX.new(logger) then
prepare(job)
job.cleanuptemprunfiles
- files = @commandline.arguments.sort
+ files = if @commandline.option('sort') then @commandline.arguments.sort else @commandline.arguments end
if files.length > 0 then
if f = File.open(job.tempfilename('tex'),'w') then
emptypages = @commandline.checkedoption('addempty', '')
@@ -355,7 +355,7 @@ class Commands
if job = TEX.new(logger) then
prepare(job)
job.cleanuptemprunfiles
- files = @commandline.arguments.sort
+ files = if @commandline.option('sort') then @commandline.arguments.sort else @commandline.arguments end
if files.length > 0 then
if f = File.open(job.tempfilename('tex'),'w') then
selection = @commandline.checkedoption('selection', '')
@@ -425,15 +425,16 @@ class Commands
if job = TEX.new(logger) then
prepare(job)
job.cleanuptemprunfiles
- files = @commandline.arguments.sort
+ files = if @commandline.option('sort') then @commandline.arguments.sort else @commandline.arguments end
if files.length > 0 then
if f = File.open(job.tempfilename('tex'),'w') then
scale = @commandline.checkedoption('scale')
begin
- scale = (scale.to_i * 1000).to_i if scale.to_i < 10
+ scale = (scale.to_f * 1000.0).to_i if scale.to_i < 10
rescue
scale = 1000
end
+ scale = scale.to_i
paperoffset = @commandline.checkedoption('paperoffset', '0cm')
f << "\\starttext\n"
files.each do |filename|
@@ -491,7 +492,7 @@ class Commands
if job = TEX.new(logger) then
prepare(job)
job.cleanuptemprunfiles
- files = @commandline.arguments.sort
+ files = if @commandline.option('sort') then @commandline.arguments.sort else @commandline.arguments end
if files.length > 0 then
if f = File.open(job.tempfilename('tex'),'w') then
paperoffset = @commandline.checkedoption('paperoffset', '0cm')
@@ -570,16 +571,20 @@ 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('luatex') then
+ job.setvariable('texengine','luatex')
elsif @commandline.oneof('pdfetex','pdftex','pdf') then
job.setvariable('texengine','pdftex')
elsif @commandline.oneof('xetex','xtx') then
job.setvariable('texengine','xetex')
elsif @commandline.oneof('aleph') then
job.setvariable('texengine','aleph')
- elsif @commandline.oneof('luatex') then
- job.setvariable('texengine','luatex')
+ elsif @commandline.oneof('petex') then
+ job.setvariable('texengine','petex')
else
job.setvariable('texengine','standard')
end
@@ -594,6 +599,8 @@ class Commands
job.setvariable('backend','xetex')
elsif @commandline.oneof('aleph') then
job.setvariable('backend','dvipdfmx')
+ elsif @commandline.oneof('petex') then
+ job.setvariable('backend','dvipdfmx')
elsif @commandline.oneof('dvips','ps') then
job.setvariable('backend','dvips')
elsif @commandline.oneof('xdv') then
@@ -604,6 +611,7 @@ class Commands
when 'pdftex' then job.setvariable('backend','pdftex')
when 'luatex' then job.setvariable('backend','pdftex')
when 'xetex' then job.setvariable('backend','xetex')
+ when 'petex' then job.setvariable('backend','dvipdfmx')
when 'aleph' then job.setvariable('backend','dvipdfmx')
else
job.setvariable('backend','standard')
@@ -757,8 +765,11 @@ commandline.registerflag('xdv')
commandline.registerflag('aleph')
+commandline.registerflag('petex')
+
commandline.registerflag('all')
commandline.registerflag('fast')
+commandline.registerflag('sort')
# generic