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 f开发者_如何学Goile 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,
Perhaps you could give minted
a try … it basically does the same as texments
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 uses a special control sequence for pdftex to allow shell escapes, needed to call the pygmentize
binary. You need to call it with pdflatex
, and you need to pass pdflatex
the -shell-escape
switch. Cf. the texments documentation.
精彩评论