I know how I can change the font size of a verbatim text. For example:

My verbatim text is tiny in size

Is there a way to specify that all my verbatim text in the current document should have a tiny font-size so that I avoid enclosing each of my verbatim text in \tiny?



2 Answers 2


Changing \verbatim@font might be the solution, but it would also change the font for inline \verb.

Better adding \scriptsize (or \tiny if you want your readers to hate you) when verbatim starts.


\AtBeginEnvironment{verbatim}{\scriptsize}% or whatever


This is text to show the \verb|font size|
This is smaller
Some other text


enter image description here

With an older LaTeX release you might need \usepackage{etoolbox}.


Adding the below will change the font size of verbatim in the entire document to, for example, \tiny.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .