28.03.2013 Views

Guide to LaTeX (4th Edition) (Tools and Techniques

Guide to LaTeX (4th Edition) (Tools and Techniques

Guide to LaTeX (4th Edition) (Tools and Techniques

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

378 Appendix A. The New Font Selection Scheme (NFSS)<br />

subf * is like the empty function, but issues a warning that an explicit<br />

substitute font has been loaded;<br />

fixed * loads the specified font at its normal size, ignoring the size part;<br />

if an optional argument is given, it is the point size <strong>to</strong> which the font<br />

is scaled, as in<br />

fixed * [11] cmr12 which loads cmr12 at 11 pt when<br />

10 pt is requested.<br />

All the above functions may be preceded by an s <strong>to</strong> suppress messages<br />

<strong>to</strong> the moni<strong>to</strong>r. Thus silent sub * is ssub *, <strong>and</strong> silent empty is s *.<br />

As another example, consider the definition of bold, italic, typewriter,<br />

for which there is no font in the Computer Modern collection:<br />

\DeclareFontShape{OT1}{cmtt}{bx}{it}{<br />

ssub * cmtt/m/it }{}<br />

This substitutes (silently) for all sizes () the medium italic typewriter<br />

attributes. Which fonts those are is determined by a \DeclareFontShape<br />

comm<strong>and</strong> with those attributes.<br />

The font definition comm<strong>and</strong>s may be issued in a package file, or even<br />

in the document itself. However, the normal procedure is <strong>to</strong> s<strong>to</strong>re each of<br />

the \DeclareFontEncoding comm<strong>and</strong>s in a file named codeenc.def (for<br />

example, ot1enc.def for the OT1 encoding), <strong>and</strong> <strong>to</strong> place the comm<strong>and</strong>s<br />

\DeclareFontFamily <strong>and</strong> \DeclareFontShape in a file whose name<br />

consists of the encoding <strong>and</strong> family designations plus the extension.fd.<br />

For example, the shape specifications for encoding OT1 <strong>and</strong> family cmr are<br />

<strong>to</strong> be found in ot1cmr.fd. When a coding <strong>and</strong> family combination that is<br />

not already defined is selected, LAT EX tries <strong>to</strong> find the appropriate.fd file<br />

for input. It is therefore not necessary <strong>to</strong> input such files explicitly, for<br />

they are loaded au<strong>to</strong>matically as required.<br />

Package: However, it is important that the encoding be declared beforeh<strong>and</strong>. If<br />

fontenc it is not already known in the current format, \DeclareFontEncoding<br />

must be issued, either explicitly, or by loading the codeenc.def file. One<br />

way <strong>to</strong> do this is <strong>to</strong> invoke the st<strong>and</strong>ard package fontenc, as for example<br />

\usepackage[OT2,T1]{fontenc}<br />

where the desired codings are listed as options in square brackets, the<br />

last of which is made current.<br />

The normal user will never need <strong>to</strong> worry about such problems. However,<br />

L AT E X programmers will find things considerably easier for them.<br />

For example, <strong>to</strong> install PostScript fonts under NFSS is almost trivial. The<br />

common PostScript fonts are already defined as separate families in .fd<br />

files of their own; for example, ot1ptm.fd associates PostScript Times<br />

fonts <strong>to</strong> a family named ptm. A package <strong>to</strong> activate these fonts is supplied<br />

under the name times.sty containing essentially the lines

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!