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
?
Best Answer
Instead of using low level
\fontsize
and\fontfamily
commands or\relsize
, you should load the packageberamono
that provides ascaled
option for deciding the height of the characters.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.