Welcome to the UK List of
TeX Frequently Asked Questions
on the Web

Searching

The index of Frequently Asked Questions about TeX is searchable.

Please enter your keyword here:   then press here: ,    or:
Google

Fonts at arbitrary sizes

Almost all fonts, nowadays, are provided with LaTeX control (.fd) files, so the temptation to risk the problems of \newfont is usually easy to resist.

However, one temptation remains, arising from the way that LaTeX restricts the sizes of fonts. In fact, the restriction only significantly applies to the default (Computer Modern) and the Cork-encoded (T1) EC fonts, but it is widely considered to be anomalous, nowadays. In recognition of this problem, there is a package fix-cm which will allow you to use the fonts, within LaTeX, at any size you choose. If you’re not using scaleable versions of the fonts, most modern distributions will just generate an appropriate bitmap for you.

So, suppose you want to produce a heading in Computer Modern Roman at 30 points, you might be tempted to write:

\newfont{\bigfont}{cmr10 at 30pt}
\begin{center}
  \bigfont Huge text
\end{center}

which will indeed work, but will actually produce a worse result than

\usepackage{fix-cm}
...
\begin{center}
  \fontsize{30}{36}\selectfont
  Huge text
\end{center}

Note that the fix-cm package was not distributed until the December 2003 edition of LaTeX; if you have an older distribution, the packages type1cm (for CM fonts) and type1ec (for EC fonts) are available.

Fix-cm doesn’t has one or two omissions — fonts the LaTeX team did not consider useful, or something; the CM dunhill fonts (as CM, but with stretched ascenders) and the CM fibonacci font (which is only available in 8-point design size) are certainly missing. If fix-cm doesn’t do the job, try the type1xx packages, or the anyfontsize package.

A further alternative might be to switch to the Latin Modern fonts (which provide a close simulacrum of the Computer Modern set); these fonts were scaleable from their first distribution, and don’t therefore need any such trick as the above.

anyfontsize.sty
macros/latex/contrib/anyfontsize (or browse the directory); catalogue entry
fix-cm.sty
Distributed as part of macros/latex/base (or browse the directory); catalogue entry (an unpacked version is available at macros/latex/unpacked/fix-cm.sty; catalogue entry)
Latin Modern fonts
fonts/lm (or browse the directory); catalogue entry
type1cm.sty
macros/latex/contrib/type1cm (or browse the directory); catalogue entry
type1ec.sty
fonts/ps-type1/cm-super/type1ec.sty; catalogue entry (the package is actually part of the fonts/ps-type1/cm-super (or browse the directory); catalogue entry distribution, but it works happily in the absence of the scaled fonts)

This answer last edited: 2013-06-04


Go to previous question, or next question

Go to FAQ home.

URL for this question: http://www.tex.ac.uk/cgi-bin/texfaq2html?label=fontsize

Comments, suggestions, or error reports? - see “how to improve the FAQ”.

This is FAQ version 3.28, released on 2014-06-10.