4.5.3 Changing Document Fonts
[Choice of scalable outline fonts]What if you don't want to use the default Computer Modern fonts? Some publishers and institutions insist on a combination of Times Roman (serif), Helvetica (sans-serif) and Courier (typewriter). To do this, you can load the following packages:
- mathptmx
- (Times) Only affects
\rmfamily
and\textrm
. - helvet
- (Helvetica) Only affects
\sffamily
and\textsf
. - courier
- (Courier) Only affects
\ttfamily
and\texttt
.
Notes:
- ⚠Don't be tempted to use the times package. It's obsolete [15]. Use mathptmx instead.
- Although Times and Helvetica are commonly used together, they
don't match, as illustrated below (temporarily switching from this
book's fonts to Times and Helvetica):
Results in:
- Loading helvet or courier doesn't change the
default font family. Consider the following:
\documentclass
{scrartcl}
\usepackage
{helvet}
\begin
{document}
This is a sample document.\end
{document}
\rmfamily
is the default font and helvet only affects\sffamily
, which hasn't been used. (See §8.2. Redefining Commands to find out how to change the default font family.)
Exercise 6: Fonts
Go back to the document you created in Exercise 1 and change the first paragraph to a large bold font and the second paragraph to normal size italic. Emphasize the words “simple” and “short”. (Again, you can download or view the solution.)
If you like, you can try experimenting with loading different font packages, such as mathptmx, to change the default typeface. The LaTeX Font Catalogue [2] provides a useful list of fonts, although you may not have all of them installed.
This book is also available as A4 PDF or 12.8cm x 9.6cm PDF or paperback (ISBN 978-1-909440-00-5).