Skip to content

Commit 5b622d2

Browse files
committed
🐛 Use kpse to search modules
1 parent 403864b commit 5b622d2

File tree

3 files changed

+33
-0
lines changed

3 files changed

+33
-0
lines changed

README.md

+31
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,37 @@ Refer [luatex](#luatex).
9999

100100
![texluap](https://github.com/wakatime/prompt-style.lua/assets/32936898/96d9f4c1-55fc-4ae3-87b8-7afd29f4ba0e)
101101

102+
luatex use `kpse` to search lua modules and binary lua modules.
103+
104+
```sh
105+
kpsewhich -progname=luatex -var-value=LUAINPUTS
106+
kpsewhich -progname=luatex -var-value=CLUAINPUTS
107+
kpsewhich -progname=luajittex -var-value=LUAINPUTS
108+
kpsewhich -progname=luajittex -var-value=CLUAINPUTS
109+
```
110+
111+
You can edit web2c config to modify its default values. Such as, default config
112+
is:
113+
114+
`/usr/share/texmf-dist/web2c/texmf.cnf`:
115+
116+
```texmf
117+
LUAINPUTS = $TEXMFDOTDIR;$TEXMF/scripts/{$progname,$engine,}/{lua,}//;$TEXMF/tex/{luatex,plain,generic,latex,}//
118+
CLUAINPUTS = $TEXMFDOTDIR;$SELFAUTOLOC/lib/{$progname,$engine,}/lua//
119+
```
120+
121+
Add your changes to `/usr/share/texmf.cnf`. Or use environment variables.
122+
Assume this project is installed to `~/.local/share/lua/5.1`.
123+
124+
```sh
125+
# for -progname=luajitex
126+
export LUAINPUTS_luajittex="$HOME/.local/share/lua/5.1"
127+
export CLUAINPUTS_luajittex="$HOME/.local/lib/lua/5.1"
128+
# for any -progname=
129+
export LUAINPUTS="$HOME/.local/share/lua/5.3"
130+
export CLUAINPUTS="$HOME/.local/lib/lua/5.3"
131+
```
132+
102133
#### [neomutt](https://neomutt.org)
103134

104135
Broken in [upstream](https://github.com/neomutt/neomutt/issues/4328)

bin/texluajitp

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#!/usr/bin/env -S luajittex --luaonly
2+
kpse.set_program_name('luajittex')
23
local utils = require "prompt.utils"
34

45
utils.init()

bin/texluap

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#!/usr/bin/env -S luatex --luaonly
2+
kpse.set_program_name('luatex')
23
local utils = require "prompt.utils"
34

45
utils.init()

0 commit comments

Comments
 (0)