当我fancyvrb
通过包含该包\usepackage{fancyvrb}
或其他使用该包的包(例如minted
)时,出现错误Missing \endscname inserted
(fancyvrb.sty 的第 535 行)和Too many }'s
(fancyvrb.sty 的第 540 行)。
我相信这是因为我运行了系统更新而导致的,尽管我对此不太确定。我目前在计算机上安装的 fancyvrb 版本是 Verison 4.1b。
有人遇到过同样的问题吗?你对如何解决这个问题有什么建议吗?
提前致谢!
部分编译错误:
(/usr/share/texmf-dist/tex/latex/fancyvrb/fancyvrb.sty
/usr/share/texmf-dist/tex/latex/fancyvrb/fancyvrb.sty:535: Missing \endcsname inserted.
<to be read again>
\unhbox
l.535 \define@key{FV}{file_ext}[.tex]
{\def\FancyVerbFileExtension{#1}}
/usr/share/texmf-dist/tex/latex/fancyvrb/fancyvrb.sty:535: Missing \endcsname inserted.
<to be read again>
\unhbox
l.535 \define@key{FV}{file_ext}[.tex]
{\def\FancyVerbFileExtension{#1}}
/usr/share/texmf-dist/tex/latex/fancyvrb/fancyvrb.sty:540: Missing \endcsname inserted.
<to be read again>
\unhbox
l.540 \fvset{defineactive,file_ext=.tex}
/usr/share/texmf-dist/tex/latex/fancyvrb/fancyvrb.sty:540: LaTeX Error: Missing \begin{document}.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...
l.540 \fvset{defineactive,file_ext=.tex}
/usr/share/texmf-dist/tex/latex/fancyvrb/fancyvrb.sty:540: Extra \endcsname.
\KV@split ...csname \KV@prefix \@tempa \endcsname
\ifx \@tempc \relax \KV@er...
l.540 \fvset{defineactive,file_ext=.tex}
/usr/share/texmf-dist/tex/latex/fancyvrb/fancyvrb.sty:540: Use of \@tempc doesn't match its definition.
<recently read> {
l.540 \fvset{defineactive,file_ext=.tex}
/usr/share/texmf-dist/tex/latex/fancyvrb/fancyvrb.sty:540: Too many }'s.
\KV@split ...after \@tempc \expandafter {\@tempb }
\relax \fi \fi \fi
l.540 \fvset{defineactive,file_ext=.tex}
答案1
您显示的错误消息表明存在问题_
,事实上,此测试文档也给出了相同的错误
\documentclass{article}
\catcode`\_\active
\def_{\mbox{}}
\usepackage{fancyvrb}
\begin{document}
\end{document}
制作
! Missing \endcsname inserted.
<to be read again>
\protect
l.535 \define@key{FV}{file_ext}[.tex]
{\def\FancyVerbFileExtension{#1}}
?
最好_
根本不要重新定义,但是如果确实要重新定义,请将重新定义延迟到序言之后,以避免破坏假定标准设置的包。