使用本地 texlive 设置 lualatex 路径

使用本地 texlive 设置 lualatex 路径

我有两个 texlive 安装:一个由我的发行版(gentoo linux)提供,另一个是安装到 子目录中的“完整” texlive 发行版/home/[user]/

我正在开展一个项目,该项目依赖于.sty在其自己的路径中查找自定义文件,并且取决于我使用系统 lualatex 还是本地 lualatex,我得到了相互冲突的结果,并且都无法成功编译。

在下面的两个代码示例中,[ROOT] 指的是项目基础结构的根子目录,而 [user] 指的是/home/[user]/我在本地安装“完整”texlive 的子目录。开关--target=cantatas.three由项目本地定义,指的是要编译的项目的特定子组。kaysermake.cls是项目本地定义的类文件,可以通过kpsewhich(见下文)找到。

使用“本地” texlive:

[ROOT] $ ~/tex-local/texlive/2017/bin/x86_64-linux/lualatex --shell-escape make.tex --target=cantatas.three
This is LuaTeX, Version 1.07.0 (TeX Live 2018) 
 system commands enabled.
(./make.tex
LaTeX2e <2018-04-01> patch level 4
(using write cache: ~/.texlive2018/texmf-var/luatex-cache/generic)(
using read cache: ~/carrier1/tex-local/texlive/2017/texmf-var/luate
x-cache/generic ~/.texlive2018/texmf-var/luatex-cache/generic)
luaotfload | main : initialization completed in 0.100 seconds

! LaTeX Error: File `kaysermake.cls' not found.

Type X to quit or <RETURN> to proceed,
or enter new name. (Default extension: cls)

Enter file name: x

使用系统 texlive:

 [ROOT] $ lualatex --shell-escape make.tex --target=cantatas.three
This is LuaTeX, Version 1.0.4 (TeX Live 2017) 
 system commands enabled.
(./make.tex
LaTeX2e <2017/01/01> patch level 3
(using write cache: ~/.texlive/texmf-var/luatex-cache/generic)(usin
g read cache: //var/lib/texmf/luatex-cache/generic ~/.texlive/texmf
-var/luatex-cache/generic)sh: all: command not found

luaotfload | main : initialization completed in 0.110 seconds
Babel <3.10> and hyphenation patterns for 1 language(s) loaded.
[SNIP, but it did find kaysermake.cls]
)) (/usr/share/texmf-site/tex/generic/pgf/utilities/pgffor.code.tex
(/usr/share/texmf-site/tex/generic/pgf/math/pgfmath.code.tex)))sh: all: command not found
~/texmf/tex/luatex/latex/kaysermake.lua:56: module '/config/luaconfig.lua' not foun
d:
    no field package.preload['/config/luaconfig.lua']
    [kpse lua searcher] file not found: '/config/luaconfig.lua'
    [kpse C searcher] file not found: '/config/luaconfig.lua'
    no file '/usr/local/lib/lua/5.2//config/luaconfig.so'
    no file '/usr/local/lib/lua/5.2/loadall.so'
    no file './/config/luaconfig.so'
stack traceback:
    [C]: in function 'require'
    ~/texmf/tex/luatex/latex/kaysermake.lua:56: in main chunk
    [C]: in function 'require'
    [\directlua]:1: in main chunk.
l.16 ...ectlua{ kayser = require("kaysermake.lua") }

? x

使用 kpsewhich搜索kaysermake.cls

[ROOT] $ kpsewhich -debug=32 kaysermake.cls
[SNIP]
kdebug:search([kaysermake.cls]) => 
~/texmf/tex/luatex/latex/kaysermake.cls
~/texmf/tex/luatex/latex/kaysermake.cls

那么,我该怎么做才能确保“完整​​”的 texlive 安装能够找到本地.cls文件?是否有.cnf我应该编辑的文件?向文件添加条目的语法是什么.cnf

谢谢您的帮助!

附录:我使用了以下测试文件“lualatex-tester.tex”:

\documentclass{article}
\begin{document}
\directlua{
p = io.popen('/usr/bin/git --version')
result = p:read('*a')
print()
print(result)
p:close()
}
\end{document}

和命令 '[ROOT] $ ~/tex-local/texlive/2017/bin/x86_64-linux/lualatex --shell-escape lualatex-tester.tex',得到以下输出:

$ ~/carrier1/tex-local/texlive/2017/bin/x86_64-linux/lualatex --shell-escape lualatex-tester.tex
This is LuaTeX, Version 1.07.0 (TeX Live 2018) 
 system commands enabled.
(./lualatex-tester.tex
LaTeX2e <2018-04-01> patch level 4
(using write cache: ~/.texlive2018/texmf-var/luatex-cache/generic)(
using read cache: ~/carrier1/tex-local/texlive/2017/texmf-var/luate
x-cache/generic ~/.texlive2018/texmf-var/luatex-cache/generic)
luaotfload | main : initialization completed in 0.099 seconds
(~/carrier1/tex-local/texlive/2017/texmf-dist/tex/latex/base/articl
e.cls
Document Class: article 2014/09/29 v1.4h Standard LaTeX document class

(~/carrier1/tex-local/texlive/2017/texmf-dist/tex/latex/base/size10
.clo(save: ~/.texlive2018/texmf-var/luatex-cache/generic/fonts/otl/
lmroman10-regular.lua)(save: ~/.texlive2018/texmf-var/luatex-cache/
generic/fonts/otl/lmroman10-regular.luc))) (./lualatex-tester.aux)
git version 2.17.0


(./lualatex-tester.aux))
 362 words of node memory still in use:
   2 hlist, 1 vlist, 1 rule, 2 glue, 4 attribute, 45 glue_spec, 4 attribute_lis
t, 2 write nodes
   avail lists: 2:7,3:1,4:1,5:4,7:1,8:1,9:1

warning  (pdf backend): no pages of output.
Transcript written on lualatex-tester.log.

但是,如果我在 popen 语句中将“/usr/bin/git”替换为“git”,则同一命令将失败,并出现上述“sh:all:未找到命令”错误。

据我的同事说,这表现出一些奇怪的行为,除非我指定绝对路径,否则似乎无法找到 git。

这里可能出了什么问题?

相关内容