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.

I usually use minted to display highlighted source code. But it seems as if minted would not support Java bytecode (see list of supported languages).

How can I insert highlighted java bytecode?

(Is there perhaps another "language" that has a similar instruction set? Does listings have an option for bytecode? Has somebody manually created a highlighting file for minted/listings?)

share|improve this question
1  
Creating a style using listings is easier than writing a new lexer for pygments. It is a matter of adding the appropriate keywords on different lists: \keywords=[1]{iconst,iload,iconst}, \keywords[2]={goto,return}, etc... Each keyword type can be highlighted differently using keywordstyle=[1]{\color{blue}} and so on. –  guillem Nov 9 '12 at 7:09
    
I know this question is old, but if it still stand, could you specify the type of syntax highlighting you're trying to achieve? –  Jubobs Jan 17 at 17:41

1 Answer 1

Since, AFAICS, no one has done this already, you need to write a JVM lexer for Pygments. That involves some not quite trivial Python programming: see the official instructions for several approaches to constructing a lexer, but you will likely find that the RegexLexer suffices for your needs.

share|improve this answer

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.