我已经在笔记本电脑和 PC 上使用 minted 软件包好几个月了,没有出现任何问题,但最近我重新安装了 Python,结果破坏了 PC 上的 minted 软件包。在我的笔记本电脑上编译得很好的 Tex 文件只要\usepackage{minted}
在序言中,就根本无法工作。
到目前为止,我已经多次重新安装了 MiKTeX 和 Python + Anaconda,将所有内容更新到最新版本,通过在命令提示符中使用 test.py 文件进行测试确认 pygmentize.exe 在我的 PATH 变量中,但仍然出现相同的错误。我也尝试安装 TeXLive,但安装失败了,我也不知道原因。
就上下文而言,我一直在使用 VSCode 来构建我的乳胶项目,但我也尝试在 TeXWorks 中使用,两者都导致了类似的问题。
在 VScode 中,我收到以下错误日志:
This is pdfTeX, Version 3.141592653-2.6-1.40.24 (MiKTeX 22.1) (preloaded format=pdflatex 2022.2.17) 17 FEB 2022 23:30
entering extended mode
\write18 enabled.
file:line:error style messages enabled.
%&-line parsing enabled.
**"c:/Users/User/Documents/Maths/Imperial/Year 4/Optimisation/Coursework/coursework.tex"
(c:/Users/User/Documents/Maths/Imperial/Year 4/Optimisation/Coursework/coursework.tex
LaTeX2e <2021-11-15> patch level 1
L3 programming layer <2022-02-05> (C:\Users\User\AppData\Local\Programs\MiKTeX\tex/latex/base\article.cls
Document Class: article 2021/10/04 v1.4n Standard LaTeX document class
(C:\Users\User\AppData\Local\Programs\MiKTeX\tex/latex/base\size10.clo
File: size10.clo 2021/10/04 v1.4n Standard LaTeX file (size option)
)
\c@part=\count185
\c@section=\count186
\c@subsection=\count187
\c@subsubsection=\count188
\c@paragraph=\count189
\c@subparagraph=\count190
\c@figure=\count191
\c@table=\count192
\abovecaptionskip=\skip47
\belowcaptionskip=\skip48
\bibindent=\dimen138
) (C:\Users\User\AppData\Local\Programs\MiKTeX\tex/latex/amsmath\amsmath.sty
Package: amsmath 2021/10/15 v2.17l AMS math features
\@mathmargin=\skip49
For additional information on amsmath, use the `?' option.
(C:\Users\User\AppData\Local\Programs\MiKTeX\tex/latex/amsmath\amstext.sty
Package: amstext 2021/08/26 v2.01 AMS text
(C:\Users\User\AppData\Local\Programs\MiKTeX\tex/latex/amsmath\amsgen.sty
File: amsgen.sty 1999/11/30 v2.0 generic functions
\@emptytoks=\toks16
\ex@=\dimen139
)) (C:\Users\User\AppData\Local\Programs\MiKTeX\tex/latex/amsmath\amsbsy.sty
Package: amsbsy 1999/11/29 v1.2d Bold Symbols
\pmbraise@=\dimen140
) (C:\Users\User\AppData\Local\Programs\MiKTeX\tex/latex/amsmath\amsopn.sty
Package: amsopn 2021/08/26 v2.02 operator names
)
\inf@bad=\count193
LaTeX Info: Redefining \frac on input line 234.
\uproot@=\count194
\leftroot@=\count195
LaTeX Info: Redefining \overline on input line 399.
\classnum@=\count196
\DOTSCASE@=\count197
LaTeX Info: Redefining \ldots on input line 496.
LaTeX Info: Redefining \dots on input line 499.
LaTeX Info: Redefining \cdots on input line 620.
\Mathstrutbox@=\box50
\strutbox@=\box51
\big@size=\dimen141
LaTeX Font Info: Redeclaring font encoding OML on input line 743.
LaTeX Font Info: Redeclaring font encoding OMS on input line 744.
\macc@depth=\count198
\c@MaxMatrixCols=\count199
\dotsspace@=\muskip16
\c@parentequation=\count266
\dspbrk@lvl=\count267
\tag@help=\toks17
\row@=\count268
\column@=\count269
\maxfields@=\count270
\andhelp@=\toks18
\eqnshift@=\dimen142
\alignsep@=\dimen143
\tagshift@=\dimen144
\tagwidth@=\dimen145
\totwidth@=\dimen146
\lineht@=\dimen147
\@envbody=\toks19
\multlinegap=\skip50
\multlinetaggap=\skip51
\mathdisplay@stack=\toks20
LaTeX Info: Redefining \[ on input line 2938.
LaTeX Info: Redefining \] on input line 2939.
) (C:\Users\User\AppData\Local\Programs\MiKTeX\tex/latex/minted\minted.sty
Package: minted 2021/12/24 v2.6 Yet another Pygments shim for LaTeX
(C:\Users\User\AppData\Local\Programs\MiKTeX\tex/latex/graphics\keyval.sty
Package: keyval 2014/10/28 v1.15 key=value parser (DPC)
\KV@toks@=\toks21
) (C:\Users\User\AppData\Local\Programs\MiKTeX\tex/latex/kvoptions\kvoptions.sty
Package: kvoptions 2020-10-07 v3.14 Key value format for package options (HO)
(C:\Users\User\AppData\Local\Programs\MiKTeX\tex/generic/ltxcmds\ltxcmds.sty
Package: ltxcmds 2020-05-10 v1.25 LaTeX kernel commands for general use (HO)
) (C:\Users\User\AppData\Local\Programs\MiKTeX\tex/generic/kvsetkeys\kvsetkeys.sty
Package: kvsetkeys 2019/12/15 v1.18 Key value parser (HO)
)) (C:\Users\User\AppData\Local\Programs\MiKTeX\tex/latex/fvextra\fvextra.sty
Package: fvextra 2019/02/04 v1.4 fvextra - extensions and patches for fancyvrb
(C:\Users\User\AppData\Local\Programs\MiKTeX\tex/latex/base\ifthen.sty
Package: ifthen 2020/11/24 v1.1c Standard LaTeX ifthen package (DPC)
) (C:\Users\User\AppData\Local\Programs\MiKTeX\tex/latex/etoolbox\etoolbox.sty
Package: etoolbox 2020/10/05 v2.5k e-TeX tools for LaTeX (JAW)
\etb@tempcnta=\count271
) (C:\Users\User\AppData\Local\Programs\MiKTeX\tex/latex/fancyvrb\fancyvrb.sty
Package: fancyvrb 2021/12/21 4.1b verbatim text (tvz,hv)
\FV@CodeLineNo=\count272
\FV@InFile=\read2
\FV@TabBox=\box52
\c@FancyVerbLine=\count273
\FV@StepNumber=\count274
\FV@OutFile=\write3
) (C:\Users\User\AppData\Local\Programs\MiKTeX\tex/latex/upquote\upquote.sty
Package: upquote 2012/04/19 v1.3 upright-quote and grave-accent glyphs in verbatim
) (C:\Users\User\AppData\Local\Programs\MiKTeX\tex/latex/lineno\lineno.sty
Package: lineno 2005/11/02 line numbers on paragraphs v4.41
\linenopenalty=\count275
\output=\toks22
\linenoprevgraf=\count276
\linenumbersep=\dimen148
\linenumberwidth=\dimen149
\c@linenumber=\count277
\c@pagewiselinenumber=\count278
\c@LN@truepage=\count279
\c@internallinenumber=\count280
\c@internallinenumbers=\count281
\quotelinenumbersep=\dimen150
\bframerule=\dimen151
\bframesep=\dimen152
\bframebox=\box53
LaTeX Info: Redefining \\ on input line 3056.
)
\c@FV@TrueTabGroupLevel=\count282
\c@FV@TrueTabCounter=\count283
\FV@TabBox@Group=\box54
\FV@TmpLength=\skip52
\c@FV@HighlightLinesStart=\count284
\c@FV@HighlightLinesStop=\count285
\FV@LoopCount=\count286
\FV@NCharsBox=\box55
\FV@BreakIndent=\dimen153
\FV@BreakIndentNChars=\count287
\FV@BreakSymbolSepLeft=\dimen154
\FV@BreakSymbolSepLeftNChars=\count288
\FV@BreakSymbolSepRight=\dimen155
\FV@BreakSymbolSepRightNChars=\count289
\FV@BreakSymbolIndentLeft=\dimen156
\FV@BreakSymbolIndentLeftNChars=\count290
\FV@BreakSymbolIndentRight=\dimen157
\FV@BreakSymbolIndentRightNChars=\count291
\c@FancyVerbLineBreakLast=\count292
\FV@LineBox=\box56
\FV@LineIndentBox=\box57
\FV@LineWidth=\dimen158
) (C:\Users\User\AppData\Local\Programs\MiKTeX\tex/latex/tools\calc.sty
Package: calc 2017/05/25 v4.3 Infix arithmetic (KKT,FJ)
\calc@Acount=\count293
\calc@Bcount=\count294
\calc@Adimen=\dimen159
\calc@Bdimen=\dimen160
\calc@Askip=\skip53
\calc@Bskip=\skip54
LaTeX Info: Redefining \setlength on input line 80.
LaTeX Info: Redefining \addtolength on input line 81.
\calc@Ccount=\count295
\calc@Cskip=\skip55
) (C:\Users\User\AppData\Local\Programs\MiKTeX\tex/latex/tools\shellesc.sty
Package: shellesc 2019/11/08 v1.0c unified shell escape interface for LaTeX
Package shellesc Info: Unrestricted shell escape enabled on input line 75.
) (C:\Users\User\AppData\Local\Programs\MiKTeX\tex/latex/ifplatform\ifplatform.sty
Package: ifplatform 2017/10/13 v0.4a Testing for the operating system
(C:\Users\User\AppData\Local\Programs\MiKTeX\tex/generic/pdftexcmds\pdftexcmds.sty
Package: pdftexcmds 2020-06-27 v0.33 Utility functions of pdfTeX for LuaTeX (HO)
(C:\Users\User\AppData\Local\Programs\MiKTeX\tex/generic/infwarerr\infwarerr.sty
Package: infwarerr 2019/12/03 v1.5 Providing info/warning/error messages (HO)
) (C:\Users\User\AppData\Local\Programs\MiKTeX\tex/generic/iftex\iftex.sty
Package: iftex 2022/02/03 v1.0f TeX engine tests
)
Package pdftexcmds Info: \pdf@primitive is available.
Package pdftexcmds Info: \pdf@ifprimitive is available.
Package pdftexcmds Info: \pdfdraftmode found.
) (C:\Users\User\AppData\Local\Programs\MiKTeX\tex/generic/catchfile\catchfile.sty
Package: catchfile 2019/12/09 v1.8 Catch the contents of a file (HO)
(C:\Users\User\AppData\Local\Programs\MiKTeX\tex/generic/etexcmds\etexcmds.sty
Package: etexcmds 2019/12/15 v1.7 Avoid name clashes with e-TeX commands (HO)
)) (C:\Users\User\AppData\Local\Programs\MiKTeX\tex/generic/iftex\ifluatex.sty
Package: ifluatex 2019/10/25 v1.5 ifluatex legacy package. Use iftex instead.
)) (C:\Users\User\AppData\Local\Programs\MiKTeX\tex/latex/xstring\xstring.sty (C:\Users\User\AppData\Local\Programs\MiKTeX\tex/generic/xstring\xstring.tex
\integerpart=\count296
\decimalpart=\count297
)
Package: xstring 2021/07/21 v1.84 String manipulations (CT)
) (C:\Users\User\AppData\Local\Programs\MiKTeX\tex/latex/framed\framed.sty
Package: framed 2011/10/22 v 0.96: framed or shaded text with page breaks
\OuterFrameSep=\skip56
\fb@frw=\dimen161
\fb@frh=\dimen162
\FrameRule=\dimen163
\FrameSep=\dimen164
) (C:\Users\User\AppData\Local\Programs\MiKTeX\tex/latex/float\float.sty
Package: float 2001/11/08 v1.3d Float enhancements (AL)
\c@float@type=\count298
\float@exts=\toks23
\float@box=\box58
\@float@everytoks=\toks24
\@floatcapt=\box59
)
\minted@appexistsfile=\read3
\minted@bgbox=\box60
\minted@code=\write4
\c@minted@FancyVerbLineTemp=\count299
\c@minted@pygmentizecounter=\count300
\@float@every@listing=\toks25
\c@listing=\count301
)
runsystem(if not exist _minted-coursework mkdir _minted-coursework)...executed.
(C:\Users\User\AppData\Local\Programs\MiKTeX\tex/latex/fancyhdr\fancyhdr.sty
Package: fancyhdr 2021/01/28 v4.0.1 Extensive control of page headers and footers
\f@nch@headwidth=\skip57
\f@nch@O@elh=\skip58
\f@nch@O@erh=\skip59
\f@nch@O@olh=\skip60
\f@nch@O@orh=\skip61
\f@nch@O@elf=\skip62
\f@nch@O@erf=\skip63
\f@nch@O@olf=\skip64
\f@nch@O@orf=\skip65
) (C:\Users\User\AppData\Local\Programs\MiKTeX\tex/latex/xcolor\xcolor.sty
Package: xcolor 2021/10/31 v2.13 LaTeX color extensions (UK)
(C:\Users\User\AppData\Local\Programs\MiKTeX\tex/latex/graphics-cfg\color.cfg
File: color.cfg 2016/01/02 v1.6 sample color configuration
)
Package xcolor Info: Driver file: pdftex.def on input line 227.
(C:\Users\User\AppData\Local\Programs\MiKTeX\tex/latex/graphics-def\pdftex.def
File: pdftex.def 2020/10/05 v1.2a Graphics/color driver for pdftex
)
Package xcolor Info: Model `cmy' substituted by `cmy0' on input line 1352.
Package xcolor Info: Model `hsb' substituted by `rgb' on input line 1356.
Package xcolor Info: Model `RGB' extended on input line 1368.
Package xcolor Info: Model `HTML' substituted by `rgb' on input line 1370.
Package xcolor Info: Model `Hsb' substituted by `hsb' on input line 1371.
Package xcolor Info: Model `tHsb' substituted by `hsb' on input line 1372.
Package xcolor Info: Model `HSB' substituted by `hsb' on input line 1373.
Package xcolor Info: Model `Gray' substituted by `gray' on input line 1374.
Package xcolor Info: Model `wave' substituted by `hsb' on input line 1375.
)
runsystem(for ^%i in (pygmentize.exe pygmentize.bat pygmentize.cmd) do set > coursework.aex <nul: /p x=^%~$PATH:i>> coursework.aex)...executed.
c:/Users/User/Documents/Maths/Imperial/Year 4/Optimisation/Coursework/coursework.tex:16: Emergency stop.
<read 3>
l.16 \begin{document}
*** (cannot \read from terminal in nonstop modes)
Here is how much of TeX's memory you used:
5519 strings out of 478584
103496 string characters out of 2844873
440716 words of memory out of 3000000
23669 multiletter control sequences out of 15000+600000
469259 words of font info for 28 fonts, out of 8000000 for 9000
1141 hyphenation exceptions out of 8191
74i,0n,77p,349b,42s stack positions out of 5000i,500n,10000p,200000b,80000s
c:/Users/User/Documents/Maths/Imperial/Year 4/Optimisation/Coursework/coursework.tex:16: ==> Fatal error occurred, no output PDF file produced!
在 TeXWorks 中,控制台似乎在\minted@apppathifexists=
打印最后一行时挂起。
我完全不知道该如何解决这个问题——我的笔记本电脑一切正常,但 PC 却不行。如果能帮助我解决这个问题,我将不胜感激。
编辑:我设法通过重置我的电脑并安装 MiKTeX 和 TeXLive 解决了这个问题。我原本计划只再次安装 MiKTeX,但这导致了同样的错误,安装 TeXLive 后很快就解决了这些问题,尽管我仍然不确定为什么 minted 突然停止工作。无论如何,希望这个编辑对某些人有帮助。