Texments 包无法在 Ubuntu 上运行
我正在尝试在 Ubuntu 上使用 Texments Latex 包来进行语法突出显示。 Texments 是 Pygments 的包装。 我安装了 Texments 并按照步骤将样式文件添加到路径中。 但是当我尝试编译 .tex 文件时,出现错误。
!未定义的控制序列
,然后它打印出一堆奇怪的字符并放置 ?迅速的。 有人面临这个错误吗?决议是什么?
如果有其他更好的方法来提供源代码的语法突出显示,我很乐意接受。
我知道有一种叫做“列表”的东西,但坦率地说,我没有发现它的颜色那么好。
谢谢,
I am trying to use the Texments Latex package on Ubuntu to do syntax highlighting.
Texments is a wrapper around Pygments.
I installed Texments and followed the steps to add the style file to the path.
But when I try to compile the .tex file, I get the error.
!Undefined Control Sequence
and then it prints out a bunch of wierd characters and places the ? prompt.
Anybody facing this error? What is the resolution?
If there is any other better way to provide syntax highlighting of source code I would be glad to accept it.
I know there is something called "listings" but frankly, i did not find the colors so good in it.
Thanks,
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
也许你可以给
minted
尝试一下……它基本上与texments
相同,但具有更多功能,并且在面对错误时更加稳健。此外,作为
minted
的维护者,我总是很高兴收到错误报告。 ;-)Perhaps you could give
minted
a try … it basically does the same astexments
but has more features and is a little more robust in the face of errors.Furthermore, as the maintainer of
minted
I’m always glad of error reports. ;-)Texments 使用 pdftex 的特殊控制序列来允许 shell 转义,这是调用 pygmentize 二进制文件所需的。您需要使用
pdflatex
调用它,并且需要传递pdflatex
-shell-escape
开关。比照。 文本文档。Texments uses a special control sequence for pdftex to allow shell escapes, needed to call the
pygmentize
binary. You need to call it withpdflatex
, and you need to passpdflatex
the-shell-escape
switch. Cf. the texments documentation.