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 would like to change my verbatim throughout a beamer presentation in the preamble.

Actually I would like to have it more or less like on slide no. 9 here.

enter image description here

I am using verbatim usually with \verb!...! rather than the environment because for longer codes I use listings. As far as I can tell the fancyvrb only allows customization in packages.

share|improve this question
Is your question about the blue part? Because the rest is, as far as I can tell, simply \verb output. – percusse Jun 13 '12 at 23:44
No its about the black. The verbatim output is much smaller than the rest of the text. How do you for instance manage to do that? What is the command so to change the size and perhaps font of all \verb!...! elements in your document. – MCB Jun 14 '12 at 0:52
You can study the sources – Ignasi Aug 20 '14 at 17:12

To change the font for the standard \verb command (and verbatim environment) you can redefine \verbatim@font as I did in my example code below; however, since you are already using the listings package, you can use \lstinline for short texts and the lstlisting environment for longer verbatim texts and use \lstset to give the same appearance to both short and long texts.




\setbeamertemplate{itemize items}[square]
\setbeamercolor{itemize item}{fg=red!60!black}


\item \lstinline{amsmath}, \lstinline{amssymb} and \lstinline{amsthm} for mathematics.
\item \lstinline{geometry} for easy management of document margins.
\item  \verb+graphicx+ for managing external images.


enter image description here

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.