About
Shop
LaTeX
Software
Books
Gallery
News
Contact
Blog
Settings
Account
Smile for the Camera: a new cybercrime short story ebook.


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:

  1. Don't be tempted to use the times package. It's obsolete [15]. Use mathptmx instead.

  2. 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:

    xx xx

    The first two x's are in Times Roman and the second two are in Helvetica, which are somewhat larger. To compensate for this you need to scale the Helvetica font using the scaled option:
    \usepackage[scaled=0.9]{helvet}

  3. 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}
    Here, the text “This is a sample document” will be typeset in Computer Modern Roman. This is because \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.)
The PDF version of this document has used the following packages:
\usepackage[T1]{fontenc}
\usepackage[math]{anttor}
\usepackage{libris}
The fontenc package is used to switch to Type 1 font encoding[Why bother with inputenc and fontenc?], the anttor package is used to set the serif family to Antykwa Toruńska typeface, and the libris package is used to set the sans-serif family to the Libris ADF typeface.

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).

© 2012 Dickimaw Books. "Dickimaw", "Dickimaw Books" and the Dickimaw parrot logo are trademarks. The Dickimaw parrot was painted by Magdalene Pritchett.

Terms of Use Privacy Policy Cookies Site Map FAQs