简体   繁体   English

无法声明乳胶环境

[英]Unable to declare a latex environment

I tried using this code 我尝试使用此代码

\newenvironment{bashcommands}{\ttfamily\color[RGB]{22,22,22}\begin{Verbatim}}{\end{Verbatim}}

But ended up spitting out an error. 但最终吐出一个错误。 The error however was not related to this command, but related to another command that I put earlier. 但是,该错误与该命令无关,而与我之前放置的另一个命令有关。 I have verified that command to be correct on this site. 我已验证该命令在此站点上正确无误。

This is the error I get in case anyone wants to look at it. 如果有人要看的话,这就是我得到的错误。

Runaway argument?
! File ended while scanning use of \FancyVerbGetLine.
<inserted text> 
                \par 
l.136 \include{chapters/chapter2}

Any help with solving this would be greatly appreciated. 任何解决此问题的帮助将不胜感激。

Thank you 谢谢

使用Verbatim环境存在限制,您应使用“ fancyvrb ”包中提供的\\CustomVerbatimEnvironment定义您自己的逐字环境。

First, I'd comment out all of your include statements and just test the usage of this environment in a simple context. 首先,我将注释掉所有的include语句,仅在简单的上下文中测试此环境的用法。 If you just keep hitting enter, or force it into quiet mode as it compiles, it will produce lots of errors, but it will give you a readable dvi or pdf (depending on your latex call). 如果您只是继续按下Enter键,或者在编译时将其强制设为安静模式,则会产生很多错误,但会为您提供可读的dvi或pdf(取决于您的乳胶调用)。 Examining exactly what it spit out along with the log file should give you an idea of what is happening. 仔细检查它与日志文件一起吐出的内容,应该使您对正在发生的事情有所了解。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM