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'm using the listings package in a LaTeX document. It works great, but it doesn't allow me to put LaTeX commands inside of the listing. I would like to use a counter to enumerate some of the interesting parts in the source code.

Is there a way to enable LaTeX commands in source listings?

share|improve this question

migrated from stackoverflow.com Aug 26 '11 at 11:54

This question came from our site for professional and enthusiast programmers.

1 Answer 1

up vote 11 down vote accepted

Ok found the answer. You can use escapechar=<char> to set a character that will escape you to the latex mode. See The Listings Package, 4.14 Escaping to LATEX.

share|improve this answer
    
Is there a default? I couldn't find it quickly. From what I understand there is no default. –  Sam Stoelinga Oct 23 '13 at 9:13

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.