路径为 \RequirePackage 的程序无法找到 Latex 样式文件

路径为 \RequirePackage 的程序无法找到 Latex 样式文件

我在用

\RequirePackage{./expkv/expkv-opt,./expkv/expkv-def}

But getting 

/home/Opstk/texlive/2022/bin/x86_64-linux/pdflatex fredholm.tex
This is pdfTeX, Version 3.141592653-2.6-1.40.24 (TeX Live 2022) (preloaded format=pdflatex)
 restricted \write18 enabled.
entering extended mode
(./fredholm.tex
LaTeX2e <2021-11-15> patch level 1
L3 programming layer <2022-04-20>
(/home/Opstk/texlive/2022/texmf-dist/tex/latex/base/book.cls
Document Class: book 2021/10/04 v1.4n Standard LaTeX document class
(/home/Opstk/texlive/2022/texmf-dist/tex/latex/base/bk10.clo))
(./gungadin.sty (./expkv/expkv-opt.sty

LaTeX Warning: You have requested package `./expkv/expkv-opt',
               but the package provides `expkv-opt'.

答案1

这不是一个错误。正如您引用的文本中所说,这是一个警告。该文件已被读取。

也就是说,警告旨在阻止您在此处使用路径,参数应该是名称而不是文件路径。\usepackage{expkv-opt}删除本地./expkv目录并使用 texlive 中的标准版本包。使用本地版本会屏蔽标准版本,因此您将不会获得任何错误修复或更新。

无关,但你应该确保你的路径正确,然后使用

pdflatex fredholm.tex

不是

/home/Opstk/texlive/2022/bin/x86_64-linux/pdflatex fredholm.tex

如果您使用可执行文件的完整路径,那么一切似乎都会正常,但在更复杂的软件包上,您将遇到奇怪的版本不匹配故障。例如,如果 pdflatex 调用 epstopdf、makindex 或任何其他内部系统调用,它将拾取路径中的命令,如果您像这里一样通过完整路径名调用它,该命令可能与您使用的 pdftex 版本不匹配。

相关内容