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.

\renewcomm<strong>and</strong>{\rmdefault}{ptm}<br />

\renewcomm<strong>and</strong>{\sfdefault}{phv}<br />

\renewcomm<strong>and</strong>{\ttdefault}{pcr}<br />

\renewcomm<strong>and</strong>{\bfdefault}{b}<br />

A.3. Installing fonts with NFSS 379<br />

This makes Times ptm the default Roman family, invoked with the comm<strong>and</strong><br />

\rmfamily, Helvetica phv the default sans serif family (called by<br />

\sffamily), <strong>and</strong> Courier pcr the default typewriter family (activated by<br />

\ttfamily). The default attribute for bold face is defined <strong>to</strong> be b instead<br />

of the regular bx, since bold extended is not provided by these fonts.<br />

Another two examples of the usefulness of NFSS are the Cyrillic fonts<br />

of the University of Washing<strong>to</strong>n (Section 12.4.2) <strong>and</strong> the extended EC fonts<br />

with the Cork encoding (Section G.4.3). Both of these may be activated<br />

within a document simply by selecting another encoding, OT2 for Cyrillic,<br />

T1 for the EC fonts. (These encodings must first be declared, for example<br />

with the fontenc package as illustrated on the facing page.)<br />

A.3.7 Encoding comm<strong>and</strong>s<br />

In L AT E X, special characters <strong>and</strong> accents are addressed by means of comm<strong>and</strong>s,<br />

! such as \O <strong>to</strong> print the Sc<strong>and</strong>inavian letter Ø. The position of this character in<br />

the font tables depends on the encoding (character 31 in OT1 <strong>and</strong> 216 in T1), so<br />

that it is necessary <strong>to</strong> redefine all such symbol comm<strong>and</strong>s when the encoding is<br />

altered. This is carried out with the help of certain encoding comm<strong>and</strong>s, which<br />

normally appear in the codeenc.def file along with the \DeclareFontEncoding<br />

comm<strong>and</strong>.<br />

To define a comm<strong>and</strong> that functions differently in the various encodings,<br />

\ProvideTextComm<strong>and</strong>{\cmd}{code}[narg][opt]{def }<br />

\DeclareTextComm<strong>and</strong>{\cmd}{code}[narg][opt]{def }<br />

are available <strong>and</strong> behave just like \providecomm<strong>and</strong> <strong>and</strong> \newcomm<strong>and</strong> except<br />

\cmd has the definition def only when the encoding code is active. Thus \cmd<br />

may have different definitions for each encoding.<br />

\DeclareTextSymbol{\cmd}{code}{pos}<br />

defines \cmd <strong>to</strong> print the character in the font position pos when encoding code<br />

is active.<br />

\DeclareTextAccent{\cmd}{code}{pos}<br />

defines \cmd <strong>to</strong> be an accent comm<strong>and</strong>, using the character in font position pos<br />

as the accent symbol, when encoding code is active.<br />

\DeclareTextComposite{\cmd}{code}{letter}{pos}<br />

\DeclareTextCompositeComm<strong>and</strong>{\cmd}{code}{letter}{def }<br />

define the action of comm<strong>and</strong> \cmd followed by the single letter either <strong>to</strong> print the<br />

character in font position pos or <strong>to</strong> execute the definition def. These declarations<br />

are most useful with the T1 encoding, where many accented letters are separate

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

Saved successfully!

Ooh no, something went wrong!