
在一些幫助下先前的問題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 at/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
作用?
texmf.cnf
TeX 樹中通常有兩個檔案。一個位於頂層,另一個位於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 中不允許使用任何外部程式。變數不是增量設定的:以該值開頭的後續行將被忽略。