TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

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

So I am writing a book on AWK and when using listings code highlighting module, I get the fancy quotes “ ” and ‘ ’ instead of the regular ASCII ones " " and ' '. I hate these fancy quotes because when copying code examples from a PDF, they never work in the terminal.

Does anyone know how to make all code examples use only ASCII quotes?

I found out that you can set \lstset{upquote=true} and that fixes the single quotes ' ' but the double ones are still broken.

Any ideas?

share|improve this question
up vote 8 down vote accepted

Use a sensible fontencoding. And make a complete example next time so that nobody has to guess what you are doing wrong.



Btw: Don't rely to much on copying code from a pdf. Spaces can disappear.

share|improve this answer
Perfect! \usepackage[T1]{fontenc} did it. – Peteris Krumins Apr 30 '11 at 11:01

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.