I have seen Change \ttfamily font for entire document, and this is sort of a follow up to this.
I'd like to use a "palatino" like font (tgpagella
) - but I'd also like to use {lmodern}
's lmtt
as the teletype (typewriter) font. Consider this MWE:
\documentclass[10pt]{book}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{lmodern} % have lmtt loaded; but...
\usepackage{tgpagella} % use "palatino" as main font, ...
\renewcommand{\ttdefault}{lmtt} % and use lmtt for teletype family
\begin{document}
testing %
\makeatletter % must be wrapping outside the \texttt; not just the \typeout inside the \texttt !
\texttt{testing %
\typeout{ttdefault is \ttdefault, \f@size ; \meaning\f@size} %
}
\makeatother %
t\texttt{t}e\texttt{e}s\texttt{s}t\texttt{t}i\texttt{i}n\texttt{n}g\texttt{g}
\end{document}
The output is:
... and it should be visible that lmtt
teletype is just slightly smaller than the tgpagella
roman. Correspondingly, I'd like to increase just the size of the teletype font; which by the \typeout
of \f@size
, I gather, is:
ttdefault is lmtt, 10; macro:->10
... the same as the one, set in the \documentclass
.
So my questions are:
- Am I reading (or rather,
\typeout
-ing) the current font size of the teletype font correctly (i.e. is just the\f@size
inside\texttt
enough)? - How can I change just the size of the teletype font document-wide?
\usepackage{etoolbox} \appto\ttfamily{\fontsize{11pt}{12pt}\selectfont}
? – Manuel Feb 4 '15 at 23:32\ttfamily
? That seems to work for me, except\fontsize{10.5pt}{12.0pt}
seems to be good enough for me (I printed the default the\f@baselineskip
to get at the "12.0pt"; not sure if this is correct either). Feel free to post this as an asnwer - cheers! – sdaau Feb 4 '15 at 23:44