Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I'm having a problem with the minted package. When I try to add line numbering to the minted command, I get the following error:

! Package keyval Error: stepnumber undefined.

See the keyval package documentation for explanation.
Type H <return> for immediate help.
 ...
l.1 ...,numbers=left,firstnumber=1,stepnumber=1 ]

Minimal example:

\documentclass[12pt]{article}
\usepackage{minted}

\begin{document}

\inputminted[linenos=true]{java}{file_with_code}

\end{document}

Without the lineos=true property, it works fine.

Does someone know how to fix that?

The file_with_code contains just some lines of Java code, which is being highlighted absolutely correctly.

Now when I just ignore the error and press Enter after I get the message in the command line, it proceeds and produced an output with numbered lines (beginning with 2, though).

Here is the log file:

This is pdfTeX, Version 3.1415926-1.40.10 (MiKTeX 2.8) (preloaded format=pdflatex 2011.5.22)  29 MAY 2011 15:35
entering extended mode
**minex.tex
(C:\minimalexample\minex.tex
LaTeX2e <2009/09/24>
Babel <v3.8l> and hyphenation patterns for english, dumylang, nohyphenation, ge
rman, ngerman, german-x-2009-06-19, ngerman-x-2009-06-19, french, russian, load
ed.
("C:\Program Files (x86)\MiKTeX 2.8\tex\latex\base\article.cls"
Document Class: article 2007/10/19 v1.4h Standard LaTeX document class
("C:\Program Files (x86)\MiKTeX 2.8\tex\latex\base\size12.clo"
File: size12.clo 2007/10/19 v1.4h Standard LaTeX file (size option)
)
\c@part=\count79
\c@section=\count80
\c@subsection=\count81
\c@subsubsection=\count82
\c@paragraph=\count83
\c@subparagraph=\count84
\c@figure=\count85
\c@table=\count86
\abovecaptionskip=\skip41
\belowcaptionskip=\skip42
\bibindent=\dimen102
)
("C:\Program Files (x86)\MiKTeX 2.8\tex\latex\minted\minted.sty"
Package: minted 2010/03/16 v1.7 Yet another Pygments shim for LaTeX

("C:\Program Files (x86)\MiKTeX 2.8\tex\latex\graphics\keyval.sty"
Package: keyval 1999/03/16 v1.13 key=value parser (DPC)
\KV@toks@=\toks14
)
("C:\Program Files (x86)\MiKTeX 2.8\tex\latex\minted\fancyvrb.sty"
Package: fancyvrb 1996/10/05

Style option: `fancyvrb' v2.0-beta, with DG/SPQR fixes <1996/10/05> (tvz)
\FV@CodeLineNo=\count87
\FV@InFile=\read1
\FV@TabBox=\box26
\c@FancyVerbLine=\count88
\FV@OutFile=\write3
No file fancyvrb.rc.
) ("C:\Program Files (x86)\MiKTeX 2.8\tex\latex\graphics\color.sty"
Package: color 2005/11/14 v1.0j Standard LaTeX Color (DPC)

("C:\Program Files (x86)\MiKTeX 2.8\tex\latex\00miktex\color.cfg"
File: color.cfg 2007/01/18 v1.5 color configuration of teTeX/TeXLive
)
Package color Info: Driver file: pdftex.def on input line 130.

("C:\Program Files (x86)\MiKTeX 2.8\tex\latex\pdftex-def\pdftex.def"
File: pdftex.def 2010/02/14 v0.04n Graphics/color for pdfTeX
\Gread@gobject=\count89
))
("C:\Program Files (x86)\MiKTeX 2.8\tex\latex\float\float.sty"
Package: float 2001/11/08 v1.3d Float enhancements (AL)
\c@float@type=\count90
\float@exts=\toks15
\float@box=\box27
\@float@everytoks=\toks16
\@floatcapt=\box28
)
("C:\Program Files (x86)\MiKTeX 2.8\tex\latex\base\ifthen.sty"
Package: ifthen 2001/05/26 v1.1c Standard LaTeX ifthen package (DPC)
)
("C:\Program Files (x86)\MiKTeX 2.8\tex\latex\tools\calc.sty"
Package: calc 2007/08/22 v4.3 Infix arithmetic (KKT,FJ)
\calc@Acount=\count91
\calc@Bcount=\count92
\calc@Adimen=\dimen103
\calc@Bdimen=\dimen104
\calc@Askip=\skip43
\calc@Bskip=\skip44
LaTeX Info: Redefining \setlength on input line 76.
LaTeX Info: Redefining \addtolength on input line 77.
\calc@Ccount=\count93
\calc@Cskip=\skip45
)
("C:\Program Files (x86)\MiKTeX 2.8\tex\latex\minted\ifplatform.sty"
Package: ifplatform 2007/11/18 v0.2 Testing for the operating system
runsystem(echo 'write18-test-2011529935'>"minex.w18")...executed.

\instream=\read2
runsystem(del "minex.w18")...executed.

)
\minted@bgbox=\box29
\minted@code=\write4
\@float@every@listing=\toks17
\c@listing=\count94
)
runsystem(del minex.aex)...executed.

runsystem(for ^%i in (pygmentize.exe pygmentize.bat pygmentize.cmd) do set >min
ex.aex <nul: /p x=^%~$PATH:i>>minex.aex)...executed.

\@appexistsfile=\read3
runsystem(del minex.aex)...executed.


file deleted
No file minex.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 T1/cmr/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 OMS/cmsy/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:\Program Files (x86)\MiKTeX 2.8\tex\context\base\supp-pdf.tex"
[Loading MPS to PDF converter (version 2006.09.02).]
\scratchcounter=\count95
\scratchdimen=\dimen105
\scratchbox=\box30
\nofMPsegments=\count96
\nofMParguments=\count97
\everyMPshowfont=\toks18
\MPscratchCnt=\count98
\MPscratchDim=\dimen106
\MPnumerator=\count99
\everyMPtoPDFconversion=\toks19
)
runsystem(pygmentize -S default -f latex > minex.pyg)...executed.

 (C:\minimalexample\minex.pyg)
runsystem(pygmentize -l java -f latex -F tokenmerge            -P linenos -P "v
erboptions= " -o minex.out.pyg file_with_code)...executed.

 (C:\minimalexample\minex.out.pyg

! Package keyval Error: stepnumber undefined.

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

l.1 ...,numbers=left,firstnumber=1,stepnumber=1, ]

? 
LaTeX Font Info:    Font shape `OT1/cmtt/bx/n' in size <12> not available
(Font)              Font shape `OT1/cmtt/m/n' tried instead on input line 2.
)
runsystem(del minex.out.pyg)...executed.

 [1

{C:/Users/amaurremi/AppData/Local/MiKTeX/2.8/pdftex/config/pdftex.map}]
(C:\minimalexample\minex.aux) ) 
Here is how much of TeX's memory you used:
 1545 strings out of 495059
 21205 string characters out of 3176779
 72218 words of memory out of 3000000
 4800 multiletter control sequences out of 15000+200000
 4408 words of font info for 17 fonts, out of 3000000 for 9000
 198 hyphenation exceptions out of 8191
 28i,5n,21p,194b,248s stack positions out of 5000i,500n,10000p,200000b,50000s
<C:/Program Files (x86)/MiKTeX 2.8/fonts/type1/p
ublic/amsfonts/cm/cmr12.pfb><C:/Program Files (x86)/MiKTeX 2.8/fonts/type1/publ
ic/amsfonts/cm/cmr6.pfb><C:/Program Files (x86)/MiKTeX 2.8/fonts/type1/public/a
msfonts/cm/cmtt12.pfb>
Output written on minex.pdf (1 page, 24857 bytes).
PDF statistics:
 18 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)
share|improve this question
1  
I just did a test using some simple file_with_code and couldn't reproduce your problem. Could you please add to your question the contents of a simple file_with_code file allowing us to reproduce the error? Another possibility is that you are using some outdated package(s)... –  Gonzalo Medina May 28 '11 at 22:27
add comment

migrated from stackoverflow.com May 28 '11 at 21:49

This question came from our site for professional and enthusiast programmers.

closed as too localized by Alan Munn, lockstep, Stefan Kottwitz Aug 7 '11 at 22:19

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

1 Answer

This 'works for me' with the test file

\documentclass[12pt]{article}
\listfiles
\usepackage{minted}

\begin{document}

\inputminted[linenos=true]{tex}{test.tex}

\end{document}

which gives

 *File List*
 article.cls    2007/10/19 v1.4h Standard LaTeX document class
  size12.clo    2007/10/19 v1.4h Standard LaTeX file (size option)
  minted.sty    2010/01/27 v1.6 Yet another Pygments shim for LaTeX
  keyval.sty    1999/03/16 v1.13 key=value parser (DPC)
fancyvrb.sty    2008/02/07
   color.sty    2005/11/14 v1.0j Standard LaTeX Color (DPC)
   color.cfg    2007/01/18 v1.5 color configuration of teTeX/TeXLive
  pdftex.def    2011/05/18 v0.06c Graphics/color for pdfTeX
infwarerr.sty    2010/04/08 v1.3 Providing info/warning/message (HO)
 ltxcmds.sty    2011/04/18 v1.20 LaTeX kernel commands for general use (HO)
   float.sty    2001/11/08 v1.3d Float enhancements (AL)
  ifthen.sty    2001/05/26 v1.1c Standard LaTeX ifthen package (DPC)
    calc.sty    2007/08/22 v4.3 Infix arithmetic (KKT,FJ)
ifplatform.sty    2010/10/22 v0.4 Testing for the operating system
pdftexcmds.sty    2011/04/22 v0.16 Utilities of pdfTeX for LuaTeX (HO)
ifluatex.sty    2010/03/01 v1.3 Provides the ifluatex switch (HO)
   ifpdf.sty    2011/01/30 v2.3 Provides the ifpdf switch (HO)
catchfile.sty    2011/03/01 v1.6 Catches the contents of a file (HO)
etexcmds.sty    2011/02/16 v1.5 Prefix for e-TeX command names (HO)
    test.w18
supp-pdf.mkii
    test.pyg
    test.out.pyg
 ***********

I get Pygments version 1.4, (c) 2006-2008 by Georg Brandl. for pygmentize -V.

share|improve this answer
    
This is sort-of an extended comment. If others see the same, I'd suggest we close the question as 'too localized' or 'not a real question', as it seems to work for both me and Gonzalo. –  Joseph Wright Jul 16 '11 at 5:10
add comment