diff options
author | Hans Hagen <pragma@wxs.nl> | 2021-07-09 19:19:20 +0200 |
---|---|---|
committer | Context Git Mirror Bot <phg@phi-gamma.net> | 2021-07-09 19:19:20 +0200 |
commit | ba4875d8c328257fa3cb4d140d07ced41b8a576c (patch) | |
tree | 4bb65d6c46a72b995bc9e0641b80b1fd80fb3aac /scripts | |
parent | 8d02589abdbd8d4f476ac951d99d4081319fce35 (diff) | |
download | context-ba4875d8c328257fa3cb4d140d07ced41b8a576c.tar.gz |
2021-07-09 18:16:00
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/context/lua/mtx-context.lua | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/scripts/context/lua/mtx-context.lua b/scripts/context/lua/mtx-context.lua index 72d20d384..c3454309f 100644 --- a/scripts/context/lua/mtx-context.lua +++ b/scripts/context/lua/mtx-context.lua @@ -712,9 +712,13 @@ function scripts.context.run(ctxdata,filename) local basename = filebasename(filename) -- use splitter local pathname = filepathpart(filename) -- + if not filesuffix(filename) then + filename = addsuffix(filename,"tex") + end + -- if pathname == "" and not a_global and filename ~= usedfiles.nop then filename = "./" .. filename - if not validfile(filename) and not validfile(filename..".tex") then + if not validfile(filename) then report("warning: no (local) file %a, proceeding",filename) end end @@ -836,6 +840,14 @@ function scripts.context.run(ctxdata,filename) -- -- todo: --output-file=... in luatex -- + local usedname = jobname + local engine = analysis.engine or "luametatex" + if lmtx and (mainfile == usedfiles.yes or mainfile == usedfiles.nop) and not getargument("redirected") then + mainfile = "" -- we don't need that + usedname = fulljobname + end + -- + -- local l_flags = { ["interaction"] = a_batchmode, -- ["synctex"] = false, -- context has its own way @@ -845,7 +857,8 @@ function scripts.context.run(ctxdata,filename) -- ["file-line-error-style"] = true, -- ["fmt"] = formatfile, -- ["lua"] = scriptfile, - ["jobname"] = jobname, +-- ["jobname"] = jobname, + ["jobname"] = usedname, ["jithash"] = a_jithash, ["permitloadlib"] = a_permitloadlib, } @@ -874,11 +887,6 @@ function scripts.context.run(ctxdata,filename) -- -- kindofrun: 1:first run, 2:successive run, 3:once, 4:last of maxruns -- - local engine = analysis.engine or "luametatex" - if engine == "luametatex" and (mainfile == usedfiles.yes or mainfile == usedfiles.nop) and not getargument("redirected") then - mainfile = "" -- we don't need that - end - -- -- can be used to include pages from a previous run, --keeppdf or "% keeppdf" on first-line -- multipass_copypdffile(jobname,a_keeppdf or analysis.keeppdf) |