![XeLaTeX 和 ifplatform/catchfile (由“minted”加载):编译时出现错误](https://linux22.com/image/319411/XeLaTeX%20%E5%92%8C%20ifplatform%2Fcatchfile%20(%E7%94%B1%E2%80%9Cminted%E2%80%9D%E5%8A%A0%E8%BD%BD)%EF%BC%9A%E7%BC%96%E8%AF%91%E6%97%B6%E5%87%BA%E7%8E%B0%E9%94%99%E8%AF%AF%20.png)
作为记录
我无法测试提供的任何解决方案,因为我去年更换了主系统。此后,没有出现任何问题。我怀疑旧系统的硬盘有问题。要么是这个原因,要么是操作系统出现故障。
我正在使用minted
,XeLaTeX
但最近遇到了一些奇怪的问题。为了说明我的意思,请考虑以下 MWE(文件名为main.tex
):
\documentclass{minimal}
\usepackage{minted}
\begin{document}
\begin{minted}[autogobble]{c}
#include <stdio.h>
int main() {
printf("Hello World!\n");
return 0;
}
\end{minted}
\end{document}
使用 编译可以pdflatex --shell-escape
正确生成文档。使用 则不行xelatex --shell-escape
,会输出以下错误:
! Package catchfile Error: File `main.w18' not found.
See the catchfile package documentation for explanation.
Type H <return> for immediate help.
...
l.93 \CatchFileDef\@tempa{\ip@file}{}
我是否遗漏了一些XeLaTeX
使minted
工作按预期进行的特定内容?
提前致谢!
编辑:我发现注销或重新启动计算机暂时地解决了问题。我附上了有关我目前正在使用的系统的一般信息,并在此处提供了更多详细信息的日志:
This is XeTeX, Version 3.14159265-2.6-0.99992 (TeX Live 2015) (preloaded format=xelatex 2015.8.10) 22 SEP 2015 19:01
entering extended mode
\write18 enabled.
%&-line parsing enabled.
**proba.tex
(./proba.tex
LaTeX2e <2015/01/01> patch level 2
Babel <3.9m> and hyphenation patterns for 79 languages loaded.
(/usr/local/texlive/2015/texmf-dist/tex/latex/base/minimal.cls
Document Class: minimal 2001/05/25 Standard LaTeX minimal class
) (/usr/local/texlive/2015/texmf-dist/tex/latex/minted/minted.sty
Package: minted 2015/09/09 v2.1 Yet another Pygments shim for LaTeX
(/usr/local/texlive/2015/texmf-dist/tex/latex/graphics/keyval.sty
Package: keyval 2014/10/28 v1.15 key=value parser (DPC)
\KV@toks@=\toks14
)
(/usr/local/texlive/2015/texmf-dist/tex/latex/oberdiek/kvoptions.sty
Package: kvoptions 2011/06/30 v3.11 Key value format for package options (HO)
(/usr/local/texlive/2015/texmf-dist/tex/generic/oberdiek/ltxcmds.sty
Package: ltxcmds 2011/11/09 v1.22 LaTeX kernel commands for general use (HO)
)
(/usr/local/texlive/2015/texmf-dist/tex/generic/oberdiek/kvsetkeys.sty
Package: kvsetkeys 2012/04/25 v1.16 Key value parser (HO)
(/usr/local/texlive/2015/texmf-dist/tex/generic/oberdiek/infwarerr.sty
Package: infwarerr 2010/04/08 v1.3 Providing info/warning/error messages (HO)
)
(/usr/local/texlive/2015/texmf-dist/tex/generic/oberdiek/etexcmds.sty
Package: etexcmds 2011/02/16 v1.5 Avoid name clashes with e-TeX commands (HO)
(/usr/local/texlive/2015/texmf-dist/tex/generic/oberdiek/ifluatex.sty
Package: ifluatex 2010/03/01 v1.3 Provides the ifluatex switch (HO)
Package ifluatex Info: LuaTeX not detected.
)
Package etexcmds Info: Could not find \expanded.
(etexcmds) That can mean that you are not using pdfTeX 1.50 or
(etexcmds) that some package has redefined \expanded.
(etexcmds) In the latter case, load this package earlier.
)))
(/usr/local/texlive/2015/texmf-dist/tex/latex/fancyvrb/fancyvrb.sty
Package: fancyvrb 2008/02/07
Style option: `fancyvrb' v2.7a, with DG/SPQR fixes, and firstline=lastline fix
<2008/02/07> (tvz)
\FV@CodeLineNo=\count79
\FV@InFile=\read1
\FV@TabBox=\box26
\c@FancyVerbLine=\count80
\FV@StepNumber=\count81
\FV@OutFile=\write3
)
(/usr/local/texlive/2015/texmf-dist/tex/latex/float/float.sty
Package: float 2001/11/08 v1.3d Float enhancements (AL)
\c@float@type=\count82
\float@exts=\toks15
\float@box=\box27
\@float@everytoks=\toks16
\@floatcapt=\box28
)
(/usr/local/texlive/2015/texmf-dist/tex/latex/base/ifthen.sty
Package: ifthen 2014/09/29 v1.1c Standard LaTeX ifthen package (DPC)
)
(/usr/local/texlive/2015/texmf-dist/tex/latex/tools/calc.sty
Package: calc 2014/10/28 v4.3 Infix arithmetic (KKT,FJ)
\calc@Acount=\count83
\calc@Bcount=\count84
\calc@Adimen=\dimen102
\calc@Bdimen=\dimen103
\calc@Askip=\skip41
\calc@Bskip=\skip42
LaTeX Info: Redefining \setlength on input line 80.
LaTeX Info: Redefining \addtolength on input line 81.
\calc@Ccount=\count85
\calc@Cskip=\skip43
)
(/usr/local/texlive/2015/texmf-dist/tex/latex/ifplatform/ifplatform.sty
Package: ifplatform 2010/10/22 v0.4 Testing for the operating system
(/usr/local/texlive/2015/texmf-dist/tex/generic/oberdiek/pdftexcmds.sty
Package: pdftexcmds 2011/11/29 v0.20 Utility functions of pdfTeX for LuaTeX (HO
)
(/usr/local/texlive/2015/texmf-dist/tex/generic/oberdiek/ifpdf.sty
Package: ifpdf 2011/01/30 v2.3 Provides the ifpdf switch (HO)
Package ifpdf Info: pdfTeX in PDF mode is not detected.
)
Package pdftexcmds Info: LuaTeX not detected.
Package pdftexcmds Info: pdfTeX >= 1.30 not detected.
Package pdftexcmds Info: \pdf@primitive is available.
Package pdftexcmds Info: \pdf@ifprimitive is available.
Package pdftexcmds Info: \pdfdraftmode not found.
)
(/usr/local/texlive/2015/texmf-dist/tex/generic/oberdiek/catchfile.sty
Package: catchfile 2011/03/01 v1.6 Catch the contents of a file (HO)
)
runsystem(uname -s > "proba.w18")...executed.
! Package catchfile Error: File `proba.w18' not found.
See the catchfile package documentation for explanation.
Type H <return> for immediate help.
...
l.93 \CatchFileDef\@tempa{\ip@file}{}
? x
Here is how much of TeX's memory you used:
1071 strings out of 493708
17078 string characters out of 6145891
71205 words of memory out of 5000000
4449 multiletter control sequences out of 15000+600000
3640 words of font info for 14 fonts, out of 8000000 for 9000
1328 hyphenation exceptions out of 8191
37i,0n,19p,243b,18s stack positions out of 5000i,500n,10000p,200000b,80000s
No pages of output.
- Xubuntu 15.04
- TeXLive 2015
minted
2.1
编辑2:我可以诱使自己xelatex
认为main.w18
这是通过事先执行创建的uname -s > main.w18
。但是,出现了这个新错误:
! Package minted Error: You must have `pygmentize' installed to use this package.
当然,我已经pygmentize
安装了,因为有时我可以编译。
编辑3:经过一番折腾,似乎XeLaTeX
无法将文件写入文件系统。我尝试重新安装 TeXLive,但没有成功。
答案1
\usepackage{shellesc}
在main.tex之前添加\usepackage{minted}