Is it possible (and if yes, of course how) to use Greek letters within lstlisting (of the listings package)? However, \epsilon, for instance, puts of course exactly that and not a Greek epsilon.

I have read in the documentation that it is possible to write e.g. Greek comments, but that is not what I want to do. I'm using lstlisting to write EBNF and would like to use an \epsilon for "empty".


1 Answer 1


Thanks to Mythio, I found the answer:

Use texcl=<true|false> or mathescape=<true|false> to use the inline math-evironment $\epsilon$ (see section 4.14 of the documentation)

  • You should mark this as the answer (if thats possible for your own posts)
    – Mythio
    Feb 21, 2013 at 15:10
  • Yes, I tried. But I can only do so in 2 days it says. But I will as soon as the system let's me to.
    – navige
    Feb 21, 2013 at 15:11
  • This doesn't work for me. Could you update the answer to be more explicit? e.g. where do I write texcl=<true|false>?
    – Tom
    May 27, 2021 at 15:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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