使用 fancyvrb LaTeX 环境时出错
嗨,我正在尝试寻找 vrb 环境。我正在使用完全升级的 Ubuntu 9.04。
例如,如果我发出一个简单的 Verbatim 环境:
\begin{Verbatim}
foobar
\end{Verbatim}
它可以工作。但是,如果我尝试传入参数,例如设置字体大小:
\begin{Verbatim}[fontsize=8]
foobar
\end{Verbatim}
这将被忽略。如果我尝试设置颜色:
\begin{Verbatim}[formatcom=\color{red}]
foobar
\end{Verbatim}
我收到以下错误:
Running `LaTeX' on `test' with ``latex -interaction=nonstopmode "\input" test.tex''
This is pdfTeXk, Version 3.141592-1.40.3 (Web2C 7.5.6)
%&-line parsing enabled.
entering extended mode
LaTeX2e <2005/12/01>
Babel <v3.8h> and hyphenation patterns for english, usenglishmax, dumylang, noh
yphenation, loaded.
(./test.tex (/usr/share/texmf-texlive/tex/latex/base/article.cls
Document Class: article 2005/09/16 v1.4f Standard LaTeX document class
(/usr/share/texmf-texlive/tex/latex/base/size10.clo))
(/usr/share/texmf-texlive/tex/latex/fancyvrb/fancyvrb.sty
Style option: `fancyvrb' v2.6, with DG/SPQR fixes <1998/07/17> (tvz)
(/usr/share/texmf-texlive/tex/latex/graphics/keyval.sty)
No file fancyvrb.cfg.
) (./test.aux)
! Undefined control sequence.
\FancyVerbFormatCom ->\color
{red}\relax
l.20 \begin{Verbatim}[formatcom=\color{red}]
[1] (./test.aux) )
(see the transcript file for additional information)
Output written on test.dvi (1 page, 644 bytes).
Transcript written on test.log.
LaTeX exited abnormally with code 1 at Mon Sep 7 15:19:05
我正在开始使用 LaTeX,但我不确定我是否误用了它,或者我是否安装了不正确的东西。
Hi I'm trying to fancyvrb environment. I'm using a fully upgraded Ubuntu 9.04.
If I issue a simple Verbatim environment, for example:
\begin{Verbatim}
foobar
\end{Verbatim}
it works. However, if I try to pass in a parameter, for example, setting the font size:
\begin{Verbatim}[fontsize=8]
foobar
\end{Verbatim}
This is ignored. If I try to set the color:
\begin{Verbatim}[formatcom=\color{red}]
foobar
\end{Verbatim}
I get the following error:
Running `LaTeX' on `test' with ``latex -interaction=nonstopmode "\input" test.tex''
This is pdfTeXk, Version 3.141592-1.40.3 (Web2C 7.5.6)
%&-line parsing enabled.
entering extended mode
LaTeX2e <2005/12/01>
Babel <v3.8h> and hyphenation patterns for english, usenglishmax, dumylang, noh
yphenation, loaded.
(./test.tex (/usr/share/texmf-texlive/tex/latex/base/article.cls
Document Class: article 2005/09/16 v1.4f Standard LaTeX document class
(/usr/share/texmf-texlive/tex/latex/base/size10.clo))
(/usr/share/texmf-texlive/tex/latex/fancyvrb/fancyvrb.sty
Style option: `fancyvrb' v2.6, with DG/SPQR fixes <1998/07/17> (tvz)
(/usr/share/texmf-texlive/tex/latex/graphics/keyval.sty)
No file fancyvrb.cfg.
) (./test.aux)
! Undefined control sequence.
\FancyVerbFormatCom ->\color
{red}\relax
l.20 \begin{Verbatim}[formatcom=\color{red}]
[1] (./test.aux) )
(see the transcript file for additional information)
Output written on test.dvi (1 page, 644 bytes).
Transcript written on test.log.
LaTeX exited abnormally with code 1 at Mon Sep 7 15:19:05
I'm starting my way with LaTeX, and I'm not sure if I'm misusing it, or if I have something installed incorrectly.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您的问题有两个部分:
fontsize
选项仅接受 LaTeX 字体大小,例如\small
和\large
这是一个有效的示例:
Two parts to your problem:
fontsize
option only accepts LaTeX font sizes such as\small
and\large
Here's an example that works:
颜色由颜色包提供。尝试添加
\usepackage{color}
Colors are provided by the color package. Try adding
\usepackage{color}