context.lua /size: 1274 b    last modification: 2020-07-01 14:35
1-- This file is a companion to "context(.exe)" and is effectively the same
2-- as:
3--
4--     mtxrun -script context ...
5--
6-- which will locate "mtx-context.lua" and load that one. The binary is a
7-- copy of "luametatex(.exe)" aka luatex 2.0 for context lmtx. In a similar
8-- fashion "mtxrun(.exe)" will load the "mtrun.lua" script.
9--
10-- The installation of context should do this on Windows:
11--
12-- luametatex.exe -> tex/texmf-win64/bin/luatex.exe
13-- luametatex.exe -> tex/texmf-win64/bin/mtxrun.exe
14-- luametatex.exe -> tex/texmf-win64/bin/context.exe
15-- mtxrun.lua     -> tex/texmf-win64/bin/mtxrun.lua
16-- context.lua    -> tex/texmf-win64/bin/context.lua
17--
18-- and this on Unix:
19--
20-- luametatex     -> tex/texmf-linux-64/bin/luatex
21-- luametatex     -> tex/texmf-linux-64/bin/mtxrun
22-- luametatex     -> tex/texmf-linux-64/bin/context
23-- mtxrun.lua     -> tex/texmf-linux-64/bin/mtxrun.lua
24-- context.lua    -> tex/texmf-linux-64/bin/context.lua
25--
26-- The static binary is smaller than 3MB so the few copies provide no real
27-- overhead.
28
29local selfpath = os.selfpath
30
31if not arg or not selfpath then
32    print("invalid stub")
33    os.exit()
34end
35
36arg[0] = "mtxrun"
37
38table.insert(arg,1,"mtx-context")
39table.insert(arg,1,"--script")
40
41dofile(selfpath .. "/" .. "mtxrun.lua")
42