2

The following document test.tex compiles with both pdflatex --shell-escape test.tex and xelatex --shell-escape test.tex, but not lualatex --shell-escape test.tex (from a fully updated MikTeX distribution on Windows).

\documentclass{article}
\usepackage{minted}

\begin{document}

\begin{minted}{python} def f(x): return x**2 \end{minted}

\end{document}

The error given is ! Package minted Error: Cannot find Pygments style default.

The lualatex version is 1.15.1. The document does however compile with lualatex under an Ubuntu texlive that has lualatex version 1.14.0. A similar issue was reported in this question related to \write18, but that was from 2016 and should be fixed by minted automatically loading shellesc. I don't know if updates to the kernel, lualatex, or minted are at fault (or if it is my system). Any help finding the issue would be appreciated. Log file is below.

This is LuaHBTeX, Version 1.15.1 (MiKTeX 22.10) (format=lualatex 2022.11.2)  2 NOV 2022 13:07
 system commands enabled.
**test.tex
(./test.tex
LaTeX2e <2022-06-01> patch level 5
Lua module: luaotfload 2022-10-03 3.23 Lua based OpenType font support
Lua module: lualibs 2022-10-04 2.75 ConTeXt Lua standard libraries.
Lua module: lualibs-extended 2022-10-04 2.75 ConTeXt Lua libraries -- extended c
ollection.
luaotfload | conf : Root cache directory is "C:/Users/saint/AppData/Local/MiKTeX
/luatex-cache/generic/names".
luaotfload | init : Loading fontloader "fontloader-2022-10-03.lua" from kpse-res
olved path "C:/Users/saint/AppData/Local/Programs/MiKTeX/tex/luatex/luaotfload/f
ontloader-2022-10-03.lua".
Lua-only attribute luaotfload@noligature = 1
luaotfload | init : Context OpenType loader version 3.120
Inserting `luaotfload.node_processor' at position 1 in `pre_linebreak_filter'.
Inserting `luaotfload.node_processor' at position 1 in `hpack_filter'.
Inserting `luaotfload.glyph_stream' at position 1 in `glyph_stream_provider'.
Inserting `luaotfload.define_font' at position 1 in `define_font'.
Lua-only attribute luaotfload_color_attribute = 2
luaotfload | conf : Root cache directory is "C:/Users/saint/AppData/Local/MiKTeX
/luatex-cache/generic/names".
Inserting `luaotfload.harf.strip_prefix' at position 1 in `find_opentype_file'.
Inserting `luaotfload.harf.strip_prefix' at position 1 in `find_truetype_file'.
Removing  `luaotfload.glyph_stream' from `glyph_stream_provider'.
Inserting `luaotfload.harf.glyphstream' at position 1 in `glyph_stream_provider'
.
Inserting `luaotfload.harf.finalize_vlist' at position 1 in `post_linebreak_filt
er'.
Inserting `luaotfload.harf.finalize_hlist' at position 2 in `hpack_filter'.
Inserting `luaotfload.cleanup_files' at position 1 in `wrapup_run'.
Inserting `luaotfload.harf.finalize_unicode' at position 1 in `finish_pdffile'.
Inserting `luaotfload.glyphinfo' at position 1 in `glyph_info'.
Lua-only attribute luaotfload.letterspace_done = 3
Inserting `luaotfload.aux.set_sscale_dimens' at position 1 in `luaotfload.patch_
font'.
Inserting `luaotfload.aux.set_font_index' at position 2 in `luaotfload.patch_fon
t'.
Inserting `luaotfload.aux.patch_cambria_domh' at position 3 in `luaotfload.patch
_font'.
Inserting `luaotfload.aux.fixup_fontdata' at position 1 in `luaotfload.patch_fon
t_unsafe'.
Inserting `luaotfload.aux.set_capheight' at position 4 in `luaotfload.patch_font
'.
Inserting `luaotfload.aux.set_xheight' at position 5 in `luaotfload.patch_font'.
Inserting `luaotfload.rewrite_fontname' at position 6 in `luaotfload.patch_font'
. L3 programming layer <2022-10-26>
Inserting `tracingstacklevels' at position 1 in `input_level_string'.
(C:/Users/saint/AppData/Local/Programs/MiKTeX/tex/latex/base/article.cls
Document Class: article 2021/10/04 v1.4n Standard LaTeX document class
(C:/Users/saint/AppData/Local/Programs/MiKTeX/tex/latex/base/size10.clo
File: size10.clo 2021/10/04 v1.4n Standard LaTeX file (size option)
luaotfload | db : Font names database loaded from C:/Users/saint/AppData/Local/M
iKTeX/luatex-cache/generic/names/luaotfload-names.luc.gz)
\c@part=\count183
\c@section=\count184
\c@subsection=\count185
\c@subsubsection=\count186
\c@paragraph=\count187
\c@subparagraph=\count188
\c@figure=\count189
\c@table=\count190
\abovecaptionskip=\skip47
\belowcaptionskip=\skip48
\bibindent=\dimen137
)
(C:/Users/saint/AppData/Local/Programs/MiKTeX/tex/latex/minted/minted.sty
Package: minted 2021/12/24 v2.6 Yet another Pygments shim for LaTeX

(C:/Users/saint/AppData/Local/Programs/MiKTeX/tex/latex/graphics/keyval.sty Package: keyval 2022/05/29 v1.15 key=value parser (DPC) \KV@toks@=\toks16 ) (C:/Users/saint/AppData/Local/Programs/MiKTeX/tex/latex/kvoptions/kvoptions.sty Package: kvoptions 2022-06-15 v3.15 Key value format for package options (HO) (C:/Users/saint/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/saint/AppData/Local/Programs/MiKTeX/tex/latex/kvsetkeys/kvsetkeys.sty Package: kvsetkeys 2022-10-05 v1.19 Key value parser (HO) )) (C:/Users/saint/AppData/Local/Programs/MiKTeX/tex/latex/fvextra/fvextra.sty Package: fvextra 2019/02/04 v1.4 fvextra - extensions and patches for fancyvrb

(C:/Users/saint/AppData/Local/Programs/MiKTeX/tex/latex/base/ifthen.sty Package: ifthen 2022/04/13 v1.1d Standard LaTeX ifthen package (DPC) ) (C:/Users/saint/AppData/Local/Programs/MiKTeX/tex/latex/etoolbox/etoolbox.sty Package: etoolbox 2020/10/05 v2.5k e-TeX tools for LaTeX (JAW) \etb@tempcnta=\count191 ) (C:/Users/saint/AppData/Local/Programs/MiKTeX/tex/latex/fancyvrb/fancyvrb.sty Package: fancyvrb 2022/06/06 4.5 verbatim text (tvz,hv) \FV@CodeLineNo=\count192 \FV@InFile=\read2 \FV@TabBox=\box51 \c@FancyVerbLine=\count193 \FV@StepNumber=\count194 \FV@OutFile=\write3 ) (C:/Users/saint/AppData/Local/Programs/MiKTeX/tex/latex/upquote/upquote.sty Package: upquote 2012/04/19 v1.3 upright-quote and grave-accent glyphs in verba tim

(C:/Users/saint/AppData/Local/Programs/MiKTeX/tex/latex/base/textcomp.sty Package: textcomp 2020/02/02 v2.0n Standard LaTeX package )) (C:/Users/saint/AppData/Local/Programs/MiKTeX/tex/latex/lineno/lineno.sty Package: lineno 2005/11/02 line numbers on paragraphs v4.41 \linenopenalty=\count195 \output=\toks17 \linenoprevgraf=\count196 \linenumbersep=\dimen138 \linenumberwidth=\dimen139 \c@linenumber=\count197 \c@pagewiselinenumber=\count198 \c@LN@truepage=\count199 \c@internallinenumber=\count266 \c@internallinenumbers=\count267 \quotelinenumbersep=\dimen140 \bframerule=\dimen141 \bframesep=\dimen142 \bframebox=\box52 LaTeX Info: Redefining \ on input line 3056. ) \c@FV@TrueTabGroupLevel=\count268 \c@FV@TrueTabCounter=\count269 \FV@TabBox@Group=\box53 \FV@TmpLength=\skip49 \c@FV@HighlightLinesStart=\count270 \c@FV@HighlightLinesStop=\count271 \FV@LoopCount=\count272 \FV@NCharsBox=\box54 \FV@BreakIndent=\dimen143 \FV@BreakIndentNChars=\count273 \FV@BreakSymbolSepLeft=\dimen144 \FV@BreakSymbolSepLeftNChars=\count274 \FV@BreakSymbolSepRight=\dimen145 \FV@BreakSymbolSepRightNChars=\count275 \FV@BreakSymbolIndentLeft=\dimen146 \FV@BreakSymbolIndentLeftNChars=\count276 \FV@BreakSymbolIndentRight=\dimen147 \FV@BreakSymbolIndentRightNChars=\count277 \c@FancyVerbLineBreakLast=\count278 \FV@LineBox=\box55 \FV@LineIndentBox=\box56 \FV@LineWidth=\dimen148 ) (C:/Users/saint/AppData/Local/Programs/MiKTeX/tex/latex/tools/calc.sty Package: calc 2017/05/25 v4.3 Infix arithmetic (KKT,FJ) \calc@Acount=\count279 \calc@Bcount=\count280 \calc@Adimen=\dimen149 \calc@Bdimen=\dimen150 \calc@Askip=\skip50 \calc@Bskip=\skip51 LaTeX Info: Redefining \setlength on input line 80. LaTeX Info: Redefining \addtolength on input line 81. \calc@Ccount=\count281 \calc@Cskip=\skip52 ) (C:/Users/saint/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/saint/AppData/Local/Programs/MiKTeX/tex/latex/ifplatform/ifplatform.s ty Package: ifplatform 2017/10/13 v0.4a Testing for the operating system

(C:/Users/saint/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/saint/AppData/Local/Programs/MiKTeX/tex/generic/infwarerr/infwarerr.s ty Package: infwarerr 2019/12/03 v1.5 Providing info/warning/error messages (HO) ) (C:/Users/saint/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. \pdftexcmds@toks=\toks18 ) (C:/Users/saint/AppData/Local/Programs/MiKTeX/tex/generic/catchfile/catchfile.s ty Package: catchfile 2019/12/09 v1.8 Catch the contents of a file (HO)

(C:/Users/saint/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/saint/AppData/Local/Programs/MiKTeX/tex/generic/iftex/ifluatex.sty Package: ifluatex 2019/10/25 v1.5 ifluatex legacy package. Use iftex instead. )) (C:/Users/saint/AppData/Local/Programs/MiKTeX/tex/latex/xstring/xstring.sty (C:/Users/saint/AppData/Local/Programs/MiKTeX/tex/generic/xstring/xstring.tex \integerpart=\count282 \decimalpart=\count283 ) Package: xstring 2021/07/21 v1.84 String manipulations (CT) ) (C:/Users/saint/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=\skip53 \fb@frw=\dimen151 \fb@frh=\dimen152 \FrameRule=\dimen153 \FrameSep=\dimen154 ) (C:/Users/saint/AppData/Local/Programs/MiKTeX/tex/latex/float/float.sty Package: float 2001/11/08 v1.3d Float enhancements (AL) \c@float@type=\count284 \float@exts=\toks19 \float@box=\box57 @float@everytoks=\toks20 @floatcapt=\box58 ) \minted@appexistsfile=\read3 \minted@bgbox=\box59 \minted@code=\write4 \c@minted@FancyVerbLineTemp=\count285 \c@minted@pygmentizecounter=\count286 @float@every@listing=\toks21 \c@listing=\count287 ) runsystem(if not exist _minted-test mkdir _minted-test)...executed

(C:/Users/saint/AppData/Local/Programs/MiKTeX/tex/latex/xcolor/xcolor.sty Package: xcolor 2022/06/12 v2.14 LaTeX color extensions (UK)

(C:/Users/saint/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: luatex.def on input line 227.

(C:/Users/saint/AppData/Local/Programs/MiKTeX/tex/latex/graphics-def/luatex.def File: luatex.def 2022/09/22 v1.2d Graphics/color driver for luatex ) (C:/Users/saint/AppData/Local/Programs/MiKTeX/tex/latex/graphics/mathcolor.ltx) Package xcolor Info: Model cmy' substituted bycmy0' on input line 1353. Package xcolor Info: Model hsb' substituted byrgb' on input line 1357. Package xcolor Info: Model RGB' extended on input line 1369. Package xcolor Info: ModelHTML' substituted by rgb' on input line 1371. Package xcolor Info: ModelHsb' substituted by hsb' on input line 1372. Package xcolor Info: ModeltHsb' substituted by hsb' on input line 1373. Package xcolor Info: ModelHSB' substituted by hsb' on input line 1374. Package xcolor Info: ModelGray' substituted by gray' on input line 1375. Package xcolor Info: Modelwave' substituted by `hsb' on input line 1376. ) runsystem(for ^%i in (pygmentize.exe pygmentize.bat pygmentize.cmd) do set > tes t.aex <nul: /p x=^%~$PATH:i>> test.aex)...failed runsystem(del test.aex)...executed

! Package minted Error: You must have `pygmentize' installed to use this packag e.

See the minted package documentation for explanation. Type H <return> for immediate help. ...

l.4 \begin{document}

?

(C:/Users/saint/AppData/Local/Programs/MiKTeX/tex/latex/l3backend/l3backend-lua tex.def File: l3backend-luatex.def 2022-10-26 L3 backend support: PDF output (LuaTeX) \l__color_backend_stack_int=\count288 \l__pdf_internal_box=\box60 ) No file test.aux.

\openout1 = test.aux LaTeX Font Info: Checking defaults for OML/cmm/m/it on input line 4. LaTeX Font Info: ... okay on input line 4. LaTeX Font Info: Checking defaults for OMS/cmsy/m/n on input line 4. LaTeX Font Info: ... okay on input line 4. LaTeX Font Info: Checking defaults for OT1/cmr/m/n on input line 4. LaTeX Font Info: ... okay on input line 4. LaTeX Font Info: Checking defaults for T1/cmr/m/n on input line 4. LaTeX Font Info: ... okay on input line 4. LaTeX Font Info: Checking defaults for TS1/cmr/m/n on input line 4. LaTeX Font Info: Trying to load font information for TS1+cmr on input line 4 . (C:/Users/saint/AppData/Local/Programs/MiKTeX/tex/latex/base/ts1cmr.fd File: ts1cmr.fd 2019/12/16 v2.5j Standard LaTeX font definitions ) LaTeX Font Info: ... okay on input line 4. LaTeX Font Info: Checking defaults for TU/lmr/m/n on input line 4. LaTeX Font Info: ... okay on input line 4. LaTeX Font Info: Checking defaults for OMX/cmex/m/n on input line 4. LaTeX Font Info: ... okay on input line 4. LaTeX Font Info: Checking defaults for U/cmr/m/n on input line 4. LaTeX Font Info: ... okay on input line 4.

(C:/Users/saint/AppData/Local/Programs/MiKTeX/tex/context/base/mkii/supp-pdf.mk ii [Loading MPS to PDF converter (version 2006.09.02).] \scratchcounter=\count289 \scratchdimen=\dimen155 \scratchbox=\box61 \nofMPsegments=\count290 \nofMParguments=\count291 \everyMPshowfont=\toks22 \MPscratchCnt=\count292 \MPscratchDim=\dimen156 \MPnumerator=\count293 \makeMPintoPDFobject=\count294 \everyMPtoPDFconversion=\toks23 ) \openout3 = test.pyg

runsystem(pygmentize -S default -f latex -P commandprefix=PYG > _minted-test\def ault.pygstyle)...failed (./_minted-test/default.pygstyle) runsystem(pygmentize -S default -f latex -P commandprefix=PYG > _minted-test\def ault.pygstyle)...failed (./_minted-test/default.pygstyle)

! Package minted Error: Cannot find Pygments style default.

See the minted package documentation for explanation. Type H <return> for immediate help. ...

l.9 \end{minted}

? runsystem(pygmentize -l python -f latex -P commandprefix=PYG -F tokenmerge -P st ripnl=False -o _minted-test/189EEE06CBA6C86622D59B8F650FBEB15337DF326E54B7D240B7 6C5FB32DA588.pygtex test.pyg)...failed

! Package minted Error: Missing Pygments output; \inputminted was probably given a file that does not exist--otherwise, you may need the outputdir package option, or may be using an incompatible build tool, or may be using frozencache with a missing file.

See the minted package documentation for explanation. Type H <return> for immediate help. ...

l.9 \end{minted}

? (./test.aux) runsystem(del test.pyg)...executed )

Here is how much of LuaTeX's memory you used: 5472 strings out of 477345 100000,552014 words of node,token memory allocated 426 words of node memory still in use: 3 hlist, 1 vlist, 1 rule, 2 glue, 3 kern, 1 glyph, 6 attribute, 49 glue_spec, 6 attribute_list, 2 write, 1 pdf_colorstack nodes avail lists: 2:11,3:1,4:1,5:4,7:1,9:1 26391 multiletter control sequences out of 65536+600000 15 fonts using 723367 bytes 75i,1n,77p,249b,121s stack positions out of 10000i,1000n,20000p,200000b,80000s

warning (pdf backend): no pages of output.

PDF statistics: 0 PDF objects out of 1000 (max. 8388607) 0 named destinations out of 1000 (max. 131072) 1 words of extra memory for PDF output out of 10000 (max. 100000000)

mbert
  • 4,171
  • well the error says pygmentize is not installed, is it? what happens if you start a cmd window and type pygmentize -h ? – David Carlisle Nov 02 '22 at 23:26
  • it works with cygwin luatex 1.15.0 – David Carlisle Nov 03 '22 at 00:16
  • pygmentize -h gives the help info as expected. Like I mentioned it compiles fine with pdflatex and xelatex so pygments is definitely installed, only lualatex has issues. Just for reference I've now tried this on two updated windows/miktex systems and get the same error – mbert Nov 03 '22 at 05:36
  • hmm it may be an error in the windows call, I don't have miktex so can't test, I'm sure a miktex user will pass by and confirm whether the problem is reproducible can you confirm if shellesc works at all, does this give a directory listing with lualatex --shell-escape ? \documentclass{article} \usepackage{shellesc} \begin{document} \ShellEscape{dir} \end{document} – David Carlisle Nov 03 '22 at 09:24
  • I tried that on win10 and win11 with a current miktex and have no problems. I see no relevant differences in the package or versions in the log. Do you have some security software or setting (virus scanner or similar) that could interfere? – Ulrike Fischer Nov 03 '22 at 09:48
  • @DavidCarlisle That document runs fine with lualatex --shell-escape. I did recently switch to Python 3.11.0, at the risk of being off topic is there any chance that could play a role? Also just in case it's relevant it is Pygments version 2.13.0 – mbert Nov 03 '22 at 13:47
  • @UlrikeFischer There is no virus scanner software beside the microsoft defaults – mbert Nov 03 '22 at 13:48
  • @mbert hard to know what is happening. Is your commandline classic cmd (msdos box) or have you gone all modern with powershell or some such? my dir example would work in either case but the minted log is failing on a for loop... I would not have expected luatex to pick up a different shell but not impossible – David Carlisle Nov 03 '22 at 13:57
  • @DavidCarlisle I was using powershell :-) But the classic cmd prompt gives the same outcome. I do understand this is difficult to test so thanks for trying to help regardless – mbert Nov 03 '22 at 14:11
  • My gut feeling that this is a shell issue, not python/pygments, perhaps start with my dir example and change it to print more environment and/or a simple dos loop as in the the log you show, find where luatex differs from pdftex – David Carlisle Nov 03 '22 at 14:34
  • 1
    Thanks for the idea. Basic things like echo and mkdir work with luatex but e.g. \ShellEsc{python --version} fails with luatex while succeeding with pdftex and xetex. The message is 'python' is not recognized as an internal or external command, operable program or batch file. So I guess luatex can't find my python executable? – mbert Nov 03 '22 at 21:31
  • @mbert I have the same issue as you describe using the MikTeX updated distribution and TeXStudio as LuaLatex editor. When I use the line \ShellEscape{path > path.txt} in PDFLaTeX I get a complete path statement in path.txt - as it should be. However when I use LuaLaTeX path.txt contains only one line: PATH=C:\Open Source\MikTeX\miktex\bin\x64\ which obviously isn't correct. So LuaLaTeX somehow purges the correct Windows path statement and replaces it with the MikTeX location. – alchemist Mar 03 '23 at 15:07
  • @alchemist good to know it's not just me :) I opened an issue in the miktex tracker but Christian couldn't reproduce so it was closed. Btw the editor (texstudio) shouldn't matter – mbert Mar 03 '23 at 15:50
  • Well ... that is a bit arrogant of Christian then. You provided all the info in your issue and he should have taken that seriously. Not just stating "It works for me, so I close the issue". Somehow there is a difference in our installation and that of for example Christian or Ulrike Fisher. IMHO it's worthwhile investigating what that difference is. But then, I am a former ITIL Service Manager and Problem Management Officer ... ;-P – alchemist Mar 03 '23 at 16:53

1 Answers1

0

I am also able to reproduce the problem.

Fresh install of MiKTeX, Python 3.11 (added to path and usable from shell.

Tried with TeXMaker and TeXStudio, fresh installed also.

It works with pdflatex and Xelatex.

As a workaround, I'm using latexmk with -lualatex option and it works.

Mane32
  • 1,252