TexStudio 与 arara;无法找到 extractbb

TexStudio 与 arara;无法找到 extractbb

先前的问题 TexStudio 和 arara,我能够在 TexStudio 中开始使用 arara(耶!)。但在运行 Xelatex 编译时(刚刚提到的 URL 中的第二个示例代码),我收到此错误消息(它未完成编译):

(/usr/local/texlive/2022/texmf-dist/tex/latex/supertabular/supertabular.sty
))
(/usr/local/texlive/2022/texmf-dist/tex/latex/glossaries/styles/glossary-tree.s
ty
))
(/usr/local/texlive/2022/texmf-dist/tex/latex/l3backend/l3backend-xetex.def
! I can't find file `"|extractbb --version"'.
<to be read again> 
                   \scan_stop: 
l.72     \l__sys_internal_tl
                            
(Press Enter to retry, or Control-D to exit)
Please type another input file name: 
runpopen command not allowed: extractbb

extractbb确实存在,并且(在我的计算机上)它位于/usr/local/texlive/2022/bin/x86_64-linux/extractbb

只是猜测:这是否可能不是路径的问题('I can't find file `"|extractbb --version'),而是 shell 权限的问题(runpopen command not allowed : extractbb)??? 如能提供任何修复建议,我们将不胜感激!

------编辑,遵循 David Carlisle 关于 texmf.cfg 的评论-----

我对“个人” texmf.cfg 的唯一自定义是添加

shell_escape_commands = pagelayoutapi

未改变,“general” texmf.cfg/usr/local/texlive/2022/texmf-dist/web2c/texmf.cnf表示

% The default is true, because we already avoid adding the standard
% extension(s) in the usual cases.  E.g., babel.sty will only look for
% babel.sty, not babel.sty.tex, regardless of this setting.
try_std_extension_first = t

% Enable system commands via \write18{...}.  When enabled fully (set to
% t), obviously insecure.  When enabled partially (set to p), only the
% commands listed in shell_escape_commands are allowed.  Although this
% is not fully secure either, it is much better, and so useful that we
% enable it for everything but bare tex.
shell_escape = p

% No spaces in this command list.
% 
% The programs listed here are as safe as any we know: they either do
% not write any output files, respect openout_any, or have hard-coded
% restrictions similar to or higher than openout_any=p.  They also have
% no features to invoke arbitrary other programs, and no known
% exploitable bugs.  All to the best of our knowledge.  They also have
% practical use for being called from TeX.
% 
shell_escape_commands = \
bibtex,bibtex8,\
extractbb,\
gregorio,\
kpsewhich,\
makeindex,\
repstopdf,\
r-mpost,\
texosquery-jre8,\

编辑 - 回应 egreg 的回答我再次查看了,/usr/local/texlive/2022/texmf.cnf因为虽然 egreg 的更改确实解决了问题,但说明(作为文件内的注释提供)是相反的,它们表明您应该只将更改放入该文件中,而不是所有原始行/usr/local/texlive/2022/texmf-dist/web2c/texmf.cnf

% (Public domain.)
% This texmf.cnf file should contain only your personal changes from the
% original texmf.cnf (for example, as chosen in the installer).
%
% That is, if you need to make changes to texmf.cnf, put your custom
% settings in this file, which is .../texlive/YYYY/texmf.cnf, rather than
% the distributed file (which is .../texlive/YYYY/texmf-dist/web2c/texmf.cnf).
% And include *only* your changed values, *NOT A COPY OF THE WHOLE THING!* [caps added here for emphasis--Birdman]
%

我继续这个谈话是因为我想知道我是否以某种方式误解了这个警告(-->不要复制整个内容),或者这些指导性评论本身是否有缺陷。

答案1

这肯定是你的修改造成的。

shell_escape_commands = pagelayoutapi

你允许仅有的应用程序pagelayoutapi在受限的 shell 转义中。如果您尝试

kpsewhich --var-value shell_escape_commands

从命令行,你应该看到

pagelayoutapi

(刚刚在我的计算机上尝试过)。

修改上层文件时,需要复制整个列表并附加到其中texmf.cnf

shell_escape_commands = \
bibtex,bibtex8,\
extractbb,\
gregorio,\
kpsewhich,\
makeindex,\
repstopdf,\
r-mpost,\
texosquery-jre8,\
pagelayoutapi,\

阅读是如何texmf.cnf起作用的?

TeX 树中通常有两个texmf.cnf文件。一个位于顶层,另一个位于texmf-dist

kpsewhich -a texmf.cnf

在我的机器上

/usr/local/texlive/2022/texmf.cnf
/usr/local/texlive/2022/texmf-dist/web2c/texmf.cnf

可能还有更多这样的文件,但最重要的是要知道它们是按照 显示的顺序读取的kpsewhich -a

文件中设置的变量值为不是被后续文件覆盖。“主”(但最后读取)文件中有一项建议,即

% That is, if you need to make changes to texmf.cnf, put your custom
% settings in this file, which is .../texlive/YYYY/texmf.cnf, rather than
% the distributed file (which is .../texlive/YYYY/texmf-dist/web2c/texmf.cnf).
% And include *only* your changed values, *NOT A COPY OF THE WHOLE THING!* [caps added here for emphasis--Birdman]

“不复制所有内容”是指不添加所有变量,而只添加需要更改值的变量。如果添加所有内容,初始化会更慢,因为需要读取和丢弃许多值。

如果你在顶层texmf.cnf文件中说

shell_escape_commands =

受限制的 shell 中不允许使用任何外部程序。变量不会以增量方式设置:以该值开头的后续行将被忽略。

相关内容