I would like to use lmodern
as my default teletype font, while using other fonts for sans etc.
So far I have
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[defaultsans]{cantarell}
\usepackage{lmodern}
\renewcommand*\ttdefault{???}
\begin{document}
{\ttfamily Hello in lmodern }
\end{document}
What do I have to replace the ???
with in order for the lmodern to be used as the default teletype?
Best Answer
The
cantarell
package with thedefaultsans
option sets the sans serif font to Cantarell by redefining\sfdefault
. However,lmodern
doesso loading it after
cantarell
will override the specification made by this package. Thelmodern
package sets\ttdefault
tolmtt
(Latin Modern Typewriter), so you get served bywithout doing anything for
\ttdefault
.