How do you change the font size globally for the \texttt environment?
I can do it for the verbatim environment with the following pair of commands
\newcommand{\verbatimfont}[1]{\renewcommand{\verbatim@font}{\ttfamily#1}}
\verbatimfont{\small}
How do I accomplish the same thing for the \texttt environment?
Best Answer
You can use the
fancyvrb
package that offers many other customizations (you can also check thefvextra
package that adds many features).In order to change the size of the monospaced font, there is a “nasty” trick. Modify the value in the definition of
\ttscale
to suit your need.Compare with the original: