# Using same font for \texttt and \Verb

I would like to configure my document to use exactly the same font for \texttt and \Verb. I got as far as this, which still misses making \ttdefault smaller:

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage{fancyvrb}
\usepackage{relsize}
\fvset{fontfamily=fvm}
\fvset{fontsize=\relsize{-2}}
\renewcommand{\ttdefault}{fvm} % needs to be smaller...
\begin{document}

$\langle$ \Verb!foobar123! $\rangle$

$\langle \texttt{foobar123} \rangle$

\end{document}


So how to I apply the relsize{-2} by default to \texttt?

-

Instead of using low level \fontsize and \fontfamily commands or \relsize, you should load the package beramono that provides a scaled option for deciding the height of the characters.

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[scaled=.75]{beramono}
\usepackage{fancyvrb}

\begin{document}

Some text $\langle$\Verb!foobar123!$\rangle$ end.

Some text $\langle\texttt{foobar123}\rangle$ end.

\end{document}


Change the fraction .75 to what really suits you. In any case, since \texttt and \Verb by default use the same font, this will ensure the same result in both cases.

-
Thanks. I didn't know this font was beramono, but indeed it looks the same. I use it with scaled=0.73 and a baseline stretch of 0.95 which gives me approximately the same line spacing as before, so I don't have to go over the layout of >100 pages again. – Emit Taste Mar 9 '13 at 18:38