7

I want to use the minted package to embed Julia code in LaTeX. My computer runs on Windows 10, I have a local installation of MiKTex and use TexStudio. I do have pygments.py 2.8.1 installed, an updated minted.sty package in MiKTeX, and tried to overcome the problem of the “–-shell escape flag” both ways (using PdfLatex and LuaLaTex compilers):

(i) in the config of TexStudio: pdflatex -synctex=1 -interaction=nonstopmode --shell-escape %.tex

(ii) and with the top document in line “magic” comment: %!TeX TXS-program:compile = txs:///pdflatex/[–shell-escape]

The error kept coming back all the time:

Package minted Error: Missing Pygments output; \inputminted wasor may be using frozencache with a missing file. \end{minted}

What am I doing wrong? I checked many Stack forums but did not find another alternative. I checked the minted package documentation and found out that it requires another package: shellesc.sty, which is not part of the MiKTeX distribution anymore, apparently, for security reasons (actually, it says it also requires ifthen.sty, not available in the MiKTeX as well, I find "ifthenx.sty" and "xifthen.sty" installed, but not "ifthen.sty" ). Is this the fundamental reason that precludes the most basic example provided by minted from running on my computer?

MWE:

\documentclass{article}
\usepackage{minted}
\begin{document}
\begin{minted}{c}
int main() {
printf("hello, world");
return 0;
}
\end{minted}
\end{document}

the output of which looks like

1

My LaTeX code is this (with the magic comment for the --shell escape flag):

%!TeX TXS-program:compile = txs:///pdflatex/[--shell-escape]
\documentclass{article}
\usepackage{xcolor}
\usepackage{minted}
\begin{document}
    \begin{minted}{c}
        int main() {
            printf("hello, world");
            return 0;
        }
    \end{minted}
\end{document} 

And the log is:

This is pdfTeX, Version 3.141592653-2.6-1.40.22 (MiKTeX 21.3) (preloaded format=pdflatex 2021.3.18)  19 MAR 2021 18:59
entering extended mode
**./Minted_Experience_3.tex
(Minted_Experience_3.tex
LaTeX2e <2020-10-01> patch level 4
L3 programming layer <2021-02-18>
(C:\Program Files\MiKTeX 2.9\tex/latex/base\article.cls
Document Class: article 2020/04/10 v1.4m Standard LaTeX document class
(C:\Program Files\MiKTeX 2.9\tex/latex/base\size10.clo
File: size10.clo 2020/04/10 v1.4m Standard LaTeX file (size option)
)
\c@part=\count179
\c@section=\count180
\c@subsection=\count181
\c@subsubsection=\count182
\c@paragraph=\count183
\c@subparagraph=\count184
\c@figure=\count185
\c@table=\count186
\abovecaptionskip=\skip47
\belowcaptionskip=\skip48
\bibindent=\dimen138
)
(C:\Program Files\MiKTeX 2.9\tex/latex/xcolor\xcolor.sty
Package: xcolor 2016/05/11 v2.12 LaTeX color extensions (UK)

(C:\Program Files\MiKTeX 2.9\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 225.

(C:\Program Files\MiKTeX 2.9\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 1348.
Package xcolor Info: Model `hsb' substituted by `rgb' on input line 1352.
Package xcolor Info: Model `RGB' extended on input line 1364.
Package xcolor Info: Model `HTML' substituted by `rgb' on input line 1366.
Package xcolor Info: Model `Hsb' substituted by `hsb' on input line 1367.
Package xcolor Info: Model `tHsb' substituted by `hsb' on input line 1368.
Package xcolor Info: Model `HSB' substituted by `hsb' on input line 1369.
Package xcolor Info: Model `Gray' substituted by `gray' on input line 1370.
Package xcolor Info: Model `wave' substituted by `hsb' on input line 1371.
) (minted.sty
Package: minted 2017/09/03 v2.5.1dev Yet another Pygments shim for LaTeX

(C:\Program Files\MiKTeX 2.9\tex/latex/graphics\keyval.sty
Package: keyval 2014/10/28 v1.15 key=value parser (DPC)
\KV@toks@=\toks15
)
(C:\Program Files\MiKTeX 2.9\tex/latex/kvoptions\kvoptions.sty
Package: kvoptions 2020-10-07 v3.14 Key value format for package options (HO)

(C:\Program Files\MiKTeX 2.9\tex/generic/ltxcmds\ltxcmds.sty
Package: ltxcmds 2020-05-10 v1.25 LaTeX kernel commands for general use (HO)
)
(C:\Program Files\MiKTeX 2.9\tex/generic/kvsetkeys\kvsetkeys.sty
Package: kvsetkeys 2019/12/15 v1.18 Key value parser (HO)
))
(C:\Program Files\MiKTeX 2.9\tex/latex/fvextra\fvextra.sty
Package: fvextra 2019/02/04 v1.4 fvextra - extensions and patches for fancyvrb

(C:\Program Files\MiKTeX 2.9\tex/latex/base\ifthen.sty
Package: ifthen 2014/09/29 v1.1c Standard LaTeX ifthen package (DPC)
)
(C:\Program Files\MiKTeX 2.9\tex/latex/etoolbox\etoolbox.sty
Package: etoolbox 2020/10/05 v2.5k e-TeX tools for LaTeX (JAW)
\etb@tempcnta=\count187
)
(C:\Program Files\MiKTeX 2.9\tex/latex/fancyvrb\fancyvrb.sty
Package: fancyvrb 2021/01/20 v3.7 verbatim text (tvz,hv)
\FV@CodeLineNo=\count188
\FV@InFile=\read2
\FV@TabBox=\box47
\c@FancyVerbLine=\count189
\FV@StepNumber=\count190
\FV@OutFile=\write3
)
(C:\Program Files\MiKTeX 2.9\tex/latex/upquote\upquote.sty
Package: upquote 2012/04/19 v1.3 upright-quote and grave-accent glyphs in verba
tim
)
(C:\Program Files\MiKTeX 2.9\tex/latex/lineno\lineno.sty
Package: lineno 2005/11/02 line numbers on paragraphs v4.41
\linenopenalty=\count191
\output=\toks16
\linenoprevgraf=\count192
\linenumbersep=\dimen139
\linenumberwidth=\dimen140
\c@linenumber=\count193
\c@pagewiselinenumber=\count194
\c@LN@truepage=\count195
\c@internallinenumber=\count196
\c@internallinenumbers=\count197
\quotelinenumbersep=\dimen141
\bframerule=\dimen142
\bframesep=\dimen143
\bframebox=\box48
LaTeX Info: Redefining \\ on input line 3056.
)
\c@FV@TrueTabGroupLevel=\count198
\c@FV@TrueTabCounter=\count199
\FV@TabBox@Group=\box49
\FV@TmpLength=\skip49
\c@FV@HighlightLinesStart=\count266
\c@FV@HighlightLinesStop=\count267
\FV@LoopCount=\count268
\FV@NCharsBox=\box50
\FV@BreakIndent=\dimen144
\FV@BreakIndentNChars=\count269
\FV@BreakSymbolSepLeft=\dimen145
\FV@BreakSymbolSepLeftNChars=\count270
\FV@BreakSymbolSepRight=\dimen146
\FV@BreakSymbolSepRightNChars=\count271
\FV@BreakSymbolIndentLeft=\dimen147
\FV@BreakSymbolIndentLeftNChars=\count272
\FV@BreakSymbolIndentRight=\dimen148
\FV@BreakSymbolIndentRightNChars=\count273
\c@FancyVerbLineBreakLast=\count274
\FV@LineBox=\box51
\FV@LineIndentBox=\box52
\FV@LineWidth=\dimen149
)
(C:\Program Files\MiKTeX 2.9\tex/latex/latex-tools\calc.sty
Package: calc 2017/05/25 v4.3 Infix arithmetic (KKT,FJ)
\calc@Acount=\count275
\calc@Bcount=\count276
\calc@Adimen=\dimen150
\calc@Bdimen=\dimen151
\calc@Askip=\skip50
\calc@Bskip=\skip51
LaTeX Info: Redefining \setlength on input line 80.
LaTeX Info: Redefining \addtolength on input line 81.
\calc@Ccount=\count277
\calc@Cskip=\skip52
)
(C:\Program Files\MiKTeX 2.9\tex/latex/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:\Program Files\MiKTeX 2.9\tex/latex/ifplatform\ifplatform.sty
Package: ifplatform 2017/10/13 v0.4a Testing for the operating system

(C:\Program Files\MiKTeX 2.9\tex/generic/pdftexcmds\pdftexcmds.sty
Package: pdftexcmds 2020-06-27 v0.33 Utility functions of pdfTeX for LuaTeX (HO
)

(C:\Program Files\MiKTeX 2.9\tex/generic/infwarerr\infwarerr.sty
Package: infwarerr 2019/12/03 v1.5 Providing info/warning/error messages (HO)
)
(C:\Program Files\MiKTeX 2.9\tex/generic/iftex\iftex.sty
Package: iftex 2020/03/06 v1.0d TeX engine tests
)
Package pdftexcmds Info: \pdf@primitive is available.
Package pdftexcmds Info: \pdf@ifprimitive is available.
Package pdftexcmds Info: \pdfdraftmode found.
)
(C:\Program Files\MiKTeX 2.9\tex/generic/catchfile\catchfile.sty
Package: catchfile 2019/12/09 v1.8 Catch the contents of a file (HO)

(C:\Program Files\MiKTeX 2.9\tex/generic/etexcmds\etexcmds.sty
Package: etexcmds 2019/12/15 v1.7 Avoid name clashes with e-TeX commands (HO)
))
(C:\Program Files\MiKTeX 2.9\tex/generic/iftex\ifluatex.sty
Package: ifluatex 2019/10/25 v1.5 ifluatex legacy package. Use iftex instead.
))
(C:\Program Files\MiKTeX 2.9\tex/latex/xstring\xstring.sty
(C:\Program Files\MiKTeX 2.9\tex/generic/xstring\xstring.tex
\integerpart=\count278
\decimalpart=\count279
)
Package: xstring 2019/02/06 v1.83 String manipulations (CT)
)
(C:\Program Files\MiKTeX 2.9\tex/latex/framed\framed.sty
Package: framed 2011/10/22 v 0.96: framed or shaded text with page breaks
\OuterFrameSep=\skip53
\fb@frw=\dimen152
\fb@frh=\dimen153
\FrameRule=\dimen154
\FrameSep=\dimen155
)
(C:\Program Files\MiKTeX 2.9\tex/latex/float\float.sty
Package: float 2001/11/08 v1.3d Float enhancements (AL)
\c@float@type=\count280
\float@exts=\toks17
\float@box=\box53
\@float@everytoks=\toks18
\@floatcapt=\box54
)
\minted@appexistsfile=\read3
\minted@bgbox=\box55
\minted@code=\write4
\c@minted@FancyVerbLineTemp=\count281
\c@minted@pygmentizecounter=\count282
\@float@every@listing=\toks19
\c@listing=\count283
)
runsystem(if not exist _minted-Minted_Experience_3 mkdir _minted-Minted_Experie
nce_3)...executed.

runsystem(for ^%i in (pygmentize.exe pygmentize.bat pygmentize.cmd) do set > Mi
nted_Experience_3.aex <nul: /p x=^%~$PATH:i>> Minted_Experience_3.aex)...execut
ed.

runsystem(del Minted_Experience_3.aex)...executed.


(C:\Program Files\MiKTeX 2.9\tex/latex/l3backend\l3backend-pdftex.def
File: l3backend-pdftex.def 2021-03-02 L3 backend support: PDF output (pdfTeX)
\l__color_backend_stack_int=\count284
\l__pdf_internal_box=\box56
)
(Minted_Experience_3.aux)
\openout1 = `Minted_Experience_3.aux'.

LaTeX Font Info:    Checking defaults for OML/cmm/m/it on input line 5.
LaTeX Font Info:    ... okay on input line 5.
LaTeX Font Info:    Checking defaults for OMS/cmsy/m/n on input line 5.
LaTeX Font Info:    ... okay on input line 5.
LaTeX Font Info:    Checking defaults for OT1/cmr/m/n on input line 5.
LaTeX Font Info:    ... okay on input line 5.
LaTeX Font Info:    Checking defaults for T1/cmr/m/n on input line 5.
LaTeX Font Info:    ... okay on input line 5.
LaTeX Font Info:    Checking defaults for TS1/cmr/m/n on input line 5.
LaTeX Font Info:    ... okay on input line 5.
LaTeX Font Info:    Checking defaults for OMX/cmex/m/n on input line 5.
LaTeX Font Info:    ... okay on input line 5.
LaTeX Font Info:    Checking defaults for U/cmr/m/n on input line 5.
LaTeX Font Info:    ... okay on input line 5.

(C:\Program Files\MiKTeX 2.9\tex/context/base/mkii\supp-pdf.mkii
[Loading MPS to PDF converter (version 2006.09.02).]
\scratchcounter=\count285
\scratchdimen=\dimen156
\scratchbox=\box57
\nofMPsegments=\count286
\nofMParguments=\count287
\everyMPshowfont=\toks20
\MPscratchCnt=\count288
\MPscratchDim=\dimen157
\MPnumerator=\count289
\makeMPintoPDFobject=\count290
\everyMPtoPDFconversion=\toks21
)
\openout3 = `Minted_Experience_3.pyg'.

 (_minted-Minted_Experience_3/default-pyg-prefix.pygstyle)
(_minted-Minted_Experience_3/default.pygstyle)
runsystem(pygmentize -l c -f latex -P commandprefix=PYG -F tokenmerge -o _minte
d-Minted_Experience_3/916909323916480C99F1AA97E621BB15C4F7931A617C79475C856E513
2212F69.pygtex Minted_Experience_3.pyg)...executed.



! 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.11    \end{minted}
                  
This could be caused by using -output-directory or -aux-directory 
without setting minted's outputdir, or by using a build tool that 
changes paths in ways minted cannot detect, 
or using frozencache with a missing file.

(Minted_Experience_3.aux)
runsystem(del Minted_Experience_3.pyg)...executed.

 ) 
Here is how much of TeX's memory you used:
 4810 strings out of 479291
 88815 string characters out of 2863489
 423495 words of memory out of 3000000
 22250 multiletter control sequences out of 15000+200000
 403430 words of font info for 27 fonts, out of 3000000 for 9000
 1141 hyphenation exceptions out of 8191
 85i,1n,88p,284b,142s stack positions out of 5000i,500n,10000p,200000b,50000s

No pages of output.
PDF statistics:
 0 PDF objects out of 1000 (max. 8388607)
 0 named destinations out of 1000 (max. 500000)
 1 words of extra memory for PDF output out of 10000 (max. 10000000)

9
  • shellesc is part of the core latex distribution (tools package) you will have it if you have latex at all. Commented Mar 18, 2021 at 23:48
  • minted uses ifthen.sty not xifthen and again you should have that, go to the miktex console and check you have the latex-tools package installed that contains both ifthen and shellesc Commented Mar 18, 2021 at 23:55
  • I have MiKTeX 2.9 installed on my computer. I have just updated the packages. I checked carefully in the Packages window and found none of those three packages I mentioned above. Unfortunately, I do not know where to find latex-tools in the MiKTeX Console.
    – VivMendes
    Commented Mar 19, 2021 at 0:05
  • Yes, I have a latex-tools package installed: "The LaTeX tools bundle".
    – VivMendes
    Commented Mar 19, 2021 at 0:08
  • so you have shellesc and ifthen packages they will not be listed separately in the miktex download thing as they are part of tools. Commented Mar 19, 2021 at 0:29

2 Answers 2

1

For me the problem was that for some reason miktex was no longer in my user PATH variable. If you open MikTex console, there appears a red box warning you of this issue and you can fix it by clicking on "Fix now":

enter image description here

0

For me I resolved the problem by not using pdflatex, instead I used latexmk with the following configuration:

Default compiler

Compiler command

However, that alone was not enough. I also had to disable the cache in the minted package.

\usepackage[cache=false]{minted}

Overall, this might be a Windows issue, posting my solution in case if it is to any help for anyone

3
  • Welcome to TeX.SX! This does seem to answer a different question than the OP because OP already uses shell escape. And in general: using shell escape on your default compiler is actively dangerous and is definitely not good practice.
    – TeXnician
    Commented Mar 17, 2022 at 15:00
  • I can retract, my answer, I suppose the difference with the one and the previous answers was that I disabled the cache of the minted package to get it to run. Otherwise, my settings and operating systems was very much the same as OP
    – JKRT
    Commented Mar 17, 2022 at 15:05
  • You can leave it here (it appeared in the low-quality review queue, so others will judge and delete if they deem it necessary). Disabling caching without a relation to the question is an interesting solution though not well-explained (usually you want caching to avoid exploding compile times). So as I said, others in the review process will probably make their judgement and if there are things that really bother enough for the answer to be deleted, they will do so. My main message was that having shell escape in the default compiler is a very bad idea ;)
    – TeXnician
    Commented Mar 17, 2022 at 16:30

You must log in to answer this question.

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