I just installed the minted package to type prettier code in my university reports, I'm trying it out but I keep getting the same messages when compiling:

This is the source:

  int i,j,k,n;

I compile it with:

pdflatex --shell-escape source.tex

This is pdfTeX, Version 3.1415926-1.40.10 (TeX Live 2009/Debian)
 \write18 enabled.
entering extended mode
LaTeX2e <2009/09/24>
Babel <v3.8l> and hyphenation patterns for english, usenglishmax, dumylang, noh
yphenation, spanish, galician, catalan, loaded.
Document Class: article 2007/10/19 v1.4h Standard LaTeX document class
(/usr/share/texmf-texlive/tex/latex/base/size10.clo)) (./minted.sty
Style option: `fancyvrb' v2.7a, with DG/SPQR fixes, and firstline=lastline fix 
<2008/02/07> (tvz)) (/usr/share/texmf/tex/latex/xcolor/xcolor.sty
(/usr/share/texmf-texlive/tex/latex/tools/calc.sty) (./ifplatform.sty))
! Undefined control sequence.
\minted.sty-h@@k ...elax  \ifnum \pdf@shellescape 
                                                  =1\relax \else \PackageErr...

? ! Missing number, treated as zero.
<to be read again> 

! Package minted Error: You must invoke LaTeX with the -shell-escape flag.

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


? /usr/bin/pygmentize
(./source.aux) (/usr/share/texmf-texlive/tex/context/base/supp-pdf.mkii
[Loading MPS to PDF converter (version 2006.09.02).]
) (./source.pyg) (./source.out.pyg) [1{/var/lib/texmf/fonts/map/pdftex/updmap/p
dftex.map}] (./source.aux) )</usr/share/texmf-texlive/fonts/type1/public/amsfon
Output written on source.pdf (1 page, 18733 bytes).
Transcript written on source.log.

The output looks as expected but why does all of these messages appear?

  • Works fine for me... Looks like something is wrong with either catcodes for = or perhgaps the ifthen package... Have a look in your source.log file for any extra info. – codebeard Aug 8 '12 at 4:53
  • 1
    Beware that you are using an outdated TeXLive (from your log: This is pdfTeX, Version 3.1415926-1.40.10 (TeX Live 2009/Debian)). I recommend to install the newest version (see How to install vanilla TeXLive on Debian or Ubuntu). – Claudio Fiandrino Aug 8 '12 at 5:55
  • When I posted the question I was starting to install the 2012 version just in case that was the problem :) – cherry Aug 8 '12 at 16:43

Command \pdf@shellescape is defined in package pdftexcmds (part of bundle oberdiek), if the TeX compiler supports the status query of the write18/shell escape feature.

Therefore just add \usepackage{pdftexcmds} before \usepackage{minted}.

| improve this answer | |
  • The package author of minted is notified and he wants to make a new revision of the Google Code version soon. – Heiko Oberdiek Aug 8 '12 at 10:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.