6

I want to use minted for syntax highlighting in my LATEX document. But it does not appear to work.

I installed minted through MiKTeX and added pygments to my python installation. evrything is correctly added to path variables: I can launch python and pygmentize -L lexers from cmd and I get correct output.

I tried example from Minted manual:

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

with a command:

pdflatex -shell-escape minimal

and it gives the flowing output:

C:\Users\User\Desktop\New folder>pdflatex -shell-escape minimal
This is pdfTeX, Version 3.14159265-2.6-1.40.17 (MiKTeX 2.9)
entering extended mode
(minimal.tex
LaTeX2e <2016/03/31> patch level 1
Babel <3.9r> and hyphenation patterns for 75 language(s) loaded.

("D:\Users\User\AppData\Local\Programs\MiKTeX 2.9\tex\latex\base\article.cl
s"
Document Class: article 2014/09/29 v1.4h Standard LaTeX document class
("D:\Users\User\AppData\Local\Programs\MiKTeX 2.9\tex\latex\base\size10.clo
"))
("D:\Users\User\AppData\Local\Programs\MiKTeX 2.9\tex\latex\minted\minted.s
ty"
("D:\Users\User\AppData\Local\Programs\MiKTeX 2.9\tex\latex\graphics\keyval
.sty")
("D:\Users\User\AppData\Local\Programs\MiKTeX 2.9\tex\latex\oberdiek\kvopti
ons.sty"
("D:\Users\User\AppData\Local\Programs\MiKTeX 2.9\tex\generic\oberdiek\ltxc
mds.sty")
("D:\Users\User\AppData\Local\Programs\MiKTeX 2.9\tex\generic\oberdiek\kvse
tkeys.sty"
("D:\Users\User\AppData\Local\Programs\MiKTeX 2.9\tex\generic\oberdiek\infw
arerr.sty")
("D:\Users\User\AppData\Local\Programs\MiKTeX 2.9\tex\generic\oberdiek\etex
cmds.sty"
("D:\Users\User\AppData\Local\Programs\MiKTeX 2.9\tex\generic\oberdiek\iflu
atex.sty"))))
("D:\Users\User\AppData\Local\Programs\MiKTeX 2.9\tex\latex\fvextra\fvextra
.sty"
("D:\Users\User\AppData\Local\Programs\MiKTeX 2.9\tex\latex\base\ifthen.sty
")
("D:\Users\User\AppData\Local\Programs\MiKTeX 2.9\tex\latex\etoolbox\etoolb
ox.sty")
("D:\Users\User\AppData\Local\Programs\MiKTeX 2.9\tex\latex\fancyvrb\fancyv
rb.sty"
Style option: `fancyvrb' v2.7a, with DG/SPQR fixes, and firstline=lastline fix
<2008/02/07> (tvz))
("D:\Users\User\AppData\Local\Programs\MiKTeX 2.9\tex\latex\upquote\upquote
.sty")
("D:\Users\User\AppData\Local\Programs\MiKTeX 2.9\tex\latex\lineno\lineno.s
ty"))
("D:\Users\User\AppData\Local\Programs\MiKTeX 2.9\tex\latex\float\float.sty
")
("D:\Users\User\AppData\Local\Programs\MiKTeX 2.9\tex\latex\tools\calc.sty"
)
("D:\Users\User\AppData\Local\Programs\MiKTeX 2.9\tex\latex\tools\shellesc.
sty")
("D:\Users\User\AppData\Local\Programs\MiKTeX 2.9\tex\latex\ifplatform\ifpl
atform.sty"
("D:\Users\User\AppData\Local\Programs\MiKTeX 2.9\tex\generic\oberdiek\pdft
excmds.sty"
("D:\Users\User\AppData\Local\Programs\MiKTeX 2.9\tex\generic\oberdiek\ifpd
f.sty"))
("D:\Users\User\AppData\Local\Programs\MiKTeX 2.9\tex\generic\oberdiek\catc
hfile.sty"))
("D:\Users\User\AppData\Local\Programs\MiKTeX 2.9\tex\latex\xstring\xstring
.sty"
("D:\Users\User\AppData\Local\Programs\MiKTeX 2.9\tex\generic\xstring\xstri
ng.tex"))
("D:\Users\User\AppData\Local\Programs\MiKTeX 2.9\tex\latex\framed\framed.s
ty"))
("D:\Users\User\AppData\Local\Programs\MiKTeX 2.9\tex\latex\xcolor\xcolor.s
ty"
("D:\Users\User\AppData\Local\Programs\MiKTeX 2.9\tex\latex\00miktex\color.
cfg")
("D:\Users\User\AppData\Local\Programs\MiKTeX 2.9\tex\latex\pdftex-def\pdft
ex.def"))
C:\Users\User\Desktop\New folder>set  /p x=C:\Users\User\AppData\Local\Enthought\Canopy\User\Scripts\pygmentize.exe 0<nul: 1>>minimal.aex

C:\Users\User\Desktop\New folder>set  /p x= 0<nul: 1>>minimal.aex

C:\Users\User\Desktop\New folder>set  /p x= 0<nul: 1>>minimal.aex

No file minimal.aux.

("D:\Users\User\AppData\Local\Programs\MiKTeX 2.9\tex\context\base\supp-pdf
.mkii"
[Loading MPS to PDF converter (version 2006.09.02).]
) (_minted-minimal/default-pyg-prefix.pygstyle)
(_minted-minimal/default.pygstyle)
! Undefined control sequence.
\minted@inputpyg ...}\endcsname \VerbatimPygments
                                                  {\PYG }{\minted@PYGstyle }...
l.9 \end{minted}

?

Any ideas what is wrong with my set up, maybe I missed something? I am quite new to LATEX.

1 Answer 1

6

This is due to a bug in MiKTeX's package manager. minted version 2.4 (most recent version) requires fvextra version 1.2, but the MiKTeX package manager is incorrectly distributing fvextra 1.1 as 1.2. I've reported the bug and it will be fixed in the next MiKTeX update (more details). Until then, you can download the correct fvextra 1.2 from CTAN or GitHub.

0

You must log in to answer this question.

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