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 by `cmy0' on input line 1353.
Package xcolor Info: Model `hsb' substituted by `rgb' on input line 1357.
Package xcolor Info: Model `RGB' extended on input line 1369.
Package xcolor Info: Model `HTML' substituted by `rgb' on input line 1371.
Package xcolor Info: Model `Hsb' substituted by `hsb' on input line 1372.
Package xcolor Info: Model `tHsb' substituted by `hsb' on input line 1373.
Package xcolor Info: Model `HSB' substituted by `hsb' on input line 1374.
Package xcolor Info: Model `Gray' substituted by `gray' on input line 1375.
Package xcolor Info: Model `wave' 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)

14
  • 1
    well the error says pygmentize is not installed, is it? what happens if you start a cmd window and type pygmentize -h ? Commented Nov 2, 2022 at 23:26
  • it works with cygwin luatex 1.15.0 Commented Nov 3, 2022 at 0: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
    Commented Nov 3, 2022 at 5: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} Commented Nov 3, 2022 at 9:24
  • 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
    Commented Nov 3, 2022 at 21:31

1 Answer 1

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.

1
  • Thanks, but I don't think this answers the question about shell access
    – mbert
    Commented Nov 14, 2022 at 17:36

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .