39

Possible Duplicate:
How do I use a particular font for a small section of text in my document?

I am looking for changing the font just of a little part of my text, not a section title or anything, just some text in my document. If I use \usepackage{font} in the doc heading, then I change the whole document's font, but I only want to change the font of certain text.

How can I achieve this?

1 Answers1

25

You can set the fontfamily using \fontfamily{<family>}\selectfont:

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage{mathpazo}

\begin{document}
Text in Palatino

{\fontfamily{ptm}\selectfont 
Text in Times%
}

\end{document}
Thorsten
  • 12,872
Martin Heller
  • 11,391
  • ok, I've done it that way, but the problem I have now is:

    using chancery font (which I can select for the whole document with no problems) throws me this message: Font shape T1/chancery/m/sc' undefined, usingT1/cmr/m/n' instead on input line ## ...

    But as I said, I am able to select chancery font at the heading of the document for the whole of it with no problems... Any ideas?

    For the rest of the document I'm using the Iwona font, which also lies in the T1 fontenc package... (or so I guess...)

    – Javier Novoa C. Aug 19 '10 at 19:11
  • sc means small caps: Chancery does not provide this shape. – Stefan Kottwitz Aug 19 '10 at 19:49
  • you are right... I've changed to pzc fontfamily, and all worked as expected! this things of fonts is quite confusing...

    Thank you very much

    – Javier Novoa C. Aug 19 '10 at 20:23
  • Why did you put the % after "Text in Times"? – Zimano Jul 12 '19 at 13:17