LaTeX 铸造包:编号行不起作用

LaTeX 铸造包:编号行不起作用

我遇到了一个问题铸造包。当我尝试向 minted 命令添加行号时,出现以下错误:

! 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 ]

最小示例:

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

\begin{document}

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

\end{document}

即使没有该lineos=true属性,它也能正常工作。

有人知道如何解决这个问题吗?

file_with_code 仅包含几行 Java 代码,这些代码被完全正确地突出显示。

现在,当我忽略错误并在命令行中收到消息后按 Enter 键时,它会继续并生成带有编号行的输出(但从 2 开始)。

这是日志文件:

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)

答案1

这对我很有效,因为它有测试文件

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

\begin{document}

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

\end{document}

这使

 *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
 ***********

我明白Pygments version 1.4, (c) 2006-2008 by Georg Brandl.pygmentize -V

相关内容