Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Well like the title says I am asking if there is an alternative to the listings package. With more programming language definitions and the likes, and updated definitions for the current languages.

share|improve this question
add comment

2 Answers 2

up vote 7 down vote accepted

Try the minted package. It uses the external Pygments python syntax highlighter and is therefore quite powerful. You need to use the -shell-escape option to allow it to call the required external executables.

share|improve this answer
    
While I like minted (its output is also significantly nicer), it's worth noting that it does slow down compilation noticeably. –  Antal S-Z Feb 23 '11 at 9:32
    
@Antal: There should be, at least in theory, the possibility to cache the formatted output generated by Pygments. The author of the minted package should include that in some future version. However, the project web site states that the package is currently not really maintained. –  Martin Scharrer Feb 23 '11 at 9:41
1  
In t-vim (ConTeXt module), I cache the results by creating an md5 hash of each file, and calling the formatter only if the file has changed. So, subsequent runs are relatively fast. The functionality is actually part of the mtxrun (the lua script that runs ConTeXt), and t-vim only provides an interface to that. –  Aditya Feb 23 '11 at 22:01
add comment

And there are GNU Source-highlight:
http://www.gnu.org/software/src-highlite/
and hightlight:
http://www.andre-simon.de/

They can export LaTeX code.


PS.
In ConTeXt, there is a t-vim module, which calls VIM to highlighting the program code.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.