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.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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".

share|improve this question
It might help you to check out the documentation of the package, specifically section 4.14 about escaping to LaTeX. ftp.snt.utwente.nl/pub/software/tex/macros/latex/contrib/… – Mythio Feb 21 '13 at 14:28
Thanks! There's the answer. For future reference, I added an answer to the question. – navige Feb 21 '13 at 14:34
Another example tex.stackexchange.com/a/8860/963 – Yiannis Lazarides Sep 14 '14 at 13:09
up vote 3 down vote accepted

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)

share|improve this answer
You should mark this as the answer (if thats possible for your own posts) – Mythio Feb 21 '13 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 '13 at 15:11

Your Answer


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.