我试图使用该包幻想VRB。
然而
\usepackage{breqn}
\usepackage{fancyvrb}
\DefineVerbatimEnvironment{code}{Verbatim}{fontsize=\small}
\DefineVerbatimEnvironment{example}{Verbatim}{fontsize=\small}
latex 总是报告
缺失数字,视为零。需重新读取
但如果我交换两部分的顺序,它就会开始起作用:
\usepackage{fancyvrb}
\DefineVerbatimEnvironment{code}{Verbatim}{fontsize=\small}
\DefineVerbatimEnvironment{example}{Verbatim}{fontsize=\small}
\usepackage{breqn}
我想知道为什么会发生这个问题?
感谢致敬!
答案1
摘自 breqn 文档:“由于它突破了 LaTeX2e 环境下的可能性,因此 breqn 包在与其他包结合使用时往往会破坏其他包,或者当存在任何内部重叠区域时,它本身也会出现故障;在某些情况下,成功使用可能取决于包的加载顺序。”
我对 (La)TeX 内部结构一无所知,但我怀疑 breqn 中定义了太多变量,因此首先加载它会破坏其他包之一。
答案2
我对你的第一个代码(TeXLive 2010)没有任何问题:
\listfiles
\documentclass{article}
\usepackage{breqn}
\usepackage{fancyvrb}
\DefineVerbatimEnvironment{code}{Verbatim}{fontsize=\small}
\DefineVerbatimEnvironment{example}{Verbatim}{fontsize=\small}
\begin{document}
\begin{code}
foo
\end{code}
\end{document}
日志文件末尾的文件列表:
*File List*
article.cls 2007/10/19 v1.4h Standard LaTeX document class
size10.clo 2007/10/19 v1.4h Standard LaTeX file (size option)
breqn.sty 2009/08/07 v0.98a Breaking equations
expl3.sty 2010/11/13 v2083 L3 Experimental code bundle wrapper
l3names.sty 2011/01/08 v2122 L3 Experimental Naming Scheme for TeX Primitiv
es
etex.sty 1998/03/26 v2.0 eTeX basic definition package (PEB)
l3basics.sty 2010/10/03 v2063 L3 Experimental basic definitions
l3expan.sty 2010/09/20 v2037 L3 Experimental Argument Expansion module
l3tl.sty 2011/01/26 v2138 L3 Experimental Token Lists
l3int.sty 2011/01/07 v2121 L3 Experimental Integer module
l3quark.sty 2010/09/20 v2036 L3 Experimental Quark Commands
l3seq.sty 2010/03/29 v1879 L3 Experimental sequences and stacks
l3toks.sty 2010/09/20 v2037 L3 Experimental Token Registers
l3prg.sty 2011/01/07 v2121 L3 Experimental control structures
l3clist.sty 2010/10/09 v2071 L3 Experimental comma separated lists
l3token.sty 2010/10/03 v2063 L3 Experimental token investigation and manipu
lation
l3prop.sty 2010/11/23 v2087 L3 Experimental Property Lists
l3msg.sty 2010/10/02 v2052 L3 Experimental LaTeX Messages module
l3io.sty 2010/10/03 v2063 L3 Experimental i/o module
l3skip.sty 2011/01/07 v2121 L3 Experimental skip registers
l3box.sty 2010/09/26 v2048 L3 Experimental Box module
l3keyval.sty 2010/04/11 v1890 L3 Experimental keyval processing
l3keys.sty 2010/11/11 v2082 L3 Experimental key-value support
l3precom.sty 2010/02/09 v1793 L3 Experimental precompilation module
l3xref.sty 2010/02/09 v1786 L3 Experimental cross referencing
l3file.sty 2010/03/21 v1853 L3 Experimental file loading
l3fp.sty 2011/01/10 v2129 L3 Experimental floating-point operations
l3luatex.sty 2010/07/18 v1985 L3 Experimental LuaTeX functions
calc.sty 2007/08/22 v4.3 Infix arithmetic (KKT,FJ)
flexisym.sty 2010/09/17 v0.97b Make math characters macros
cmbase.sym 2007/12/19 v0.92
mathstyle.sty 2010/11/17 v0.89
keyval.sty 1999/03/16 v1.13 key=value parser (DPC)
fancyvrb.sty 2010/05/14
***********