I want to vary the font family in my document, as demonstrated in this example from the LaTeX wikibook. I built and compiled an mwe using that same code, but in the document I generated, the font does not change.
\documentclass{article}
%% wikibooks example
%% https://en.wikibooks.org/wiki/LaTeX/Fonts#cite_ref-1
\begin{document}
% Default font (\familydefault = \rmdefault = Computer Modern Roman)
Lorem ipsum dolor sit amet, consectitur adipiscing elit.
% Palatino font (ppl must be installed).
\renewcommand*\rmdefault{ppl}
Lorem ipsum dolor sit amet, consectitur adipiscing elit.
% Iwona font (iwona must be installed).
\renewcommand*\rmdefault{iwona}
Lorem ipsum dolor sit amet, consectitur adipiscing elit.
\end{document}
I saw the admonition that those fonts must be installed, but I believe they are. I got no warnings or errors during compilation; the only seemingly suspicious and related output in the log
file was the following:
LaTeX Font Info: Checking defaults for OML/cmm/m/it on input line 5.
LaTeX Font Info: ... okay on input line 5.
LaTeX Font Info: Checking defaults for T1/cmr/m/n on input line 5.
LaTeX Font Info: ... okay on input line 5.
LaTeX Font Info: Checking defaults for OT1/cmr/m/n on input line 5.
LaTeX Font Info: ... okay on input line 5.
LaTeX Font Info: Checking defaults for OMS/cmsy/m/n on input line 5.
LaTeX Font Info: ... okay on input line 5.
LaTeX Font Info: Checking defaults for OMX/cmex/m/n on input line 5.
LaTeX Font Info: ... okay on input line 5.
LaTeX Font Info: Checking defaults for U/cmr/m/n on input line 5.
LaTeX Font Info: ... okay on input line 5.
LaTeX Font Info: Try loading font information for OT1+iwona on input line 18
.
(/usr/local/texlive/2017/texmf-dist/tex/latex/iwona/ot1iwona.fd
File: ot1iwona.fd 2008/07/22 v0.995 font definition file for OT1/iwona (MW)
) [1
{/usr/local/texlive/2017/texmf-var/fonts/map/pdftex/updmap/pdftex.map}] (./mwe.
aux) )
However, that to me doesn't indicate a problem. I have tried using fonts other than those listed in the examples, with no better results. I can add \usepackage{iwona}
to the prelude, and this changes the font from the default, but for the entire document. To be clear, I'm hoping to see a change in font each time I redefine rmdefault
, as in the wikibooks example. Any suggestions?
\rmdefault
only works in the preamble, and therefore, you can use effectively only one time.