diff options
Diffstat (limited to 'scripts/context/lua/mtx-context.lua')
-rw-r--r-- | scripts/context/lua/mtx-context.lua | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/scripts/context/lua/mtx-context.lua b/scripts/context/lua/mtx-context.lua index d2e63640a..5a67f4f2a 100644 --- a/scripts/context/lua/mtx-context.lua +++ b/scripts/context/lua/mtx-context.lua @@ -111,8 +111,10 @@ local engine_new = filenameonly(getargument("engine") or directives.value("syste local engine_old = filenameonly(environment.ownmain) or filenameonly(environment.ownbin) local function restart(engine_old,engine_new) - local ownname = filejoinname(filepathpart(environment.ownname),"mtxrun.lua") - local command = format("%s --luaonly %q %s --redirected",engine_new,ownname,environment.reconstructcommandline()) + local generate = environment.arguments.generate and (engine_new == "luatex" or engine_new == "luajittex") + local arguments = generate and "--generate" or environment.reconstructcommandline() + local ownname = filejoinname(filepathpart(environment.ownname),"mtxrun.lua") + local command = format("%s --luaonly %q %s --redirected",engine_new,ownname,arguments) report(format("redirect %s -> %s: %s",engine_old,engine_new,command)) local result = os.execute(command) os.exit(result == 0 and 0 or 1) @@ -1720,6 +1722,12 @@ end -- getting it done +if getargument("pdftex") then + setargument("engine","pdftex") +elseif getargument("xetex") then + setargument("engine","xetex") +end + if getargument("timedlog") then logs.settimedlog() end |