Skip to content

Commit c8cf8f5

Browse files
committed
🔨 Add environment variables for lualatex
1 parent 2a0863c commit c8cf8f5

File tree

3 files changed

+28
-14
lines changed

3 files changed

+28
-14
lines changed

examples/lualatex.tex

+5-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
\title{lualatex}
44
\begin{document}
55

6-
\directlua{require'prompt.tex'}
6+
\directlua{
7+
% FIXME: lualatex needs it to search prompt.tex
8+
kpse.set_program_name(status.list().luatex_engine)
9+
require'prompt.tex'
10+
}
711

812
\end{document}

lua/prompt/tex.lua

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
-- luacheck: ignore 111 113
22
---@diagnostic disable: undefined-global
3+
-- FIXME: for security if you forget add it to `\directlua{}` for lualatex
34
kpse.set_program_name(status.list().luatex_engine)
45
local prompt = require 'prompt'
56
local utils = require "prompt.utils"

shell.nix

+22-13
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,34 @@
33
}:
44

55
with pkgs;
6+
let
7+
packages = (
8+
p: with p; [
9+
ansicolors
10+
argparse
11+
luafilesystem
12+
luaprompt
13+
14+
busted
15+
ldoc
16+
]
17+
);
18+
in
619
mkShell rec {
720
name = "prompt-style.lua";
821
buildInputs = [
9-
(lua5_3.withPackages (
10-
p: with p; [
11-
ansicolors
12-
argparse
13-
luafilesystem
14-
luaprompt
15-
16-
busted
17-
ldoc
18-
]
19-
))
22+
(lua5_3.withPackages packages)
23+
(luajit.withPackages packages)
2024
];
2125
shellHook = ''
22-
export LUAINPUTS_luatex='lua;${builtins.elemAt buildInputs 0}/share/lua/5.3'
23-
export CLUAINPUTS_luatex='${builtins.elemAt buildInputs 0}/lib/lua/5.3'
26+
export LUAINPUTS_luatex="lua;${builtins.elemAt buildInputs 0}/share/lua/5.3"
27+
export CLUAINPUTS_luatex="${builtins.elemAt buildInputs 0}/lib/lua/5.3"
28+
export LUAINPUTS_luajittex="lua;${builtins.elemAt buildInputs 1}/share/lua/5.1"
29+
export CLUAINPUTS_luajittex="${builtins.elemAt buildInputs 1}/lib/lua/5.1"
30+
2431
export LUAINPUTS_luahbtex="$LUAINPUTS_luatex"
2532
export CLUAINPUTS_luahbtex="$CLUAINPUTS_luatex"
33+
export LUAINPUTS_luajithbtex="$LUAINPUTS_luajittex"
34+
export CLUAINPUTS_luajithbtex="$CLUAINPUTS_luajittex"
2635
'';
2736
}

0 commit comments

Comments
 (0)