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

I want to change the color of all verbatim text in an existing beamer presentation. How do I do this easily?

I know how to use colored verbatim text in general, and I found a lot of suggestions here either for defining colored verbatim environments, but this does not help me: the existing presentation uses plain \verb and verbatim- and semiverbatim-envrionments. It does not use fancyvrb or such. I do not want to go through the entire presentation (a whole lecture) and change every single verbatim command, just to change the color of the presented code fragments.

I would simply like verbatim text to have a different color, just like all math can be defined to have a different color to mark that it is math.

share|improve this question
Welcome to TeX.SX! – mafp May 23 '13 at 9:06
Redefine \verbatim@font. E.g. \makeatletter \renewcommand\verbatim@font{\normalfont\ttfamily\color{blue}} \makeatother – Ulrike Fischer May 23 '13 at 9:06
Thank you a lot! Works perfectly fine! – Steffen May 23 '13 at 9:10
up vote 5 down vote accepted

Redefine \verbatim@font. E.g.

share|improve this answer

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.