See {\bf bold and then \tt typewriter}under the old <LaTeX>, the
\tt
completely overrides the effect
of \bf
, but in the new system, they are different attributes,
so the command \tt
changes the family to (perhaps) cmtt, but the bold series attribute is unchanged, so the system
will load a bold typewriter font (which you may or may not have).
A rather more worrying situation occurs when you have defined a new
command without thinking through the ramifications. Thus if in a style
file or document preamble, we have said
\newcommand{\PS}{{\sc PostScript}}so that
\PS
produces POSTSCRIPT, and the later we write
\section{How \PS\ changed my life}we may have a problem, if the
\section
command is defined to
set its argument in a bold sans-serif typeface. The definition of
\PS
says that the word is in small caps. This is a
change in shape, so the family (a sans-serif font) stays
unchanged, as does the series (bold). So the system tries to
load a small caps bold sans-serif font, which you may not have (you
don't in Computer Modern, for instance). Here a very important feature
of NFSS2 comes into action, font substitution; it follows a set
of rules (which the user can change) and finds the closest possible
match. This may not be at all what the user intended, and it will
probably produce a different effect from the old <LaTeX>. However,
NFSS2 always puts out clear warnings on the terminal and log file when
it is substituting, and the problem is usually obvious when you see
your printout. Some more careful discipline is required when writing
new documents, and emending old ones. Bear in mind that the strange
effects are not mistakes by <LaTeX>, but simply a stricter
interpretation of the input than the old <LaTeX>.
How do we persuade <LaTeX> to choose the attributes we want? The same
commands which we already have work as expected, with two new ones
available; these are listed in Table .
The size changing commands have an important difference compared to old <LaTeX>: they only change the font size attribute (in the old <LaTeX> they changed the series and shape back to `normal roman').
The font changing in <LaTeX> declarations have always been rather
anomalous, in that they affect the text within the {
and
}
group where they used, instead of having an argument like
most other commands. <LaTeX> beginners often mistakenly type
\em{hello}
when trying to typeset hello. It is therefore
a very good idea to start using a different set of commands, which are
provided by the style option fontcmds, listed in Table
.
|
If you want to change the default action associated with any of
the above commands, you can do so with the \renewcommand
macro;
each of the declarations above has a corresponding command with a
suffix of default. Thus you could change the effect produced by
\tt
by saying (in the document preamble or a style file):
\renewcommand{\ttdefault}{courier}if you had a font family called `courier'. There may be problems with the encoding, if this is a PostScript font, but we will discuss that in appendix 1.
`How', the suspicious reader will ask, `do I know what values are allowed for the font attributes? How do I know that boldness is indicated by a series of ``bx''?' In fact, more or less any value for the attributes is permitted, but if you want your document to be useable by others, it would be as well to stick to a conventional set. If you ask for a shape of `grotesque', you will get the right font if the fd contains an entry for that combination of attributes. Conventional values are as follows (for the Computer Modern family):
\rm
, \sf
and
\tt
. A palatino.sty, for instance, will
set things up so that the roman font is Palatino-Roman, the sans
font is Helvetica and the typewriter font is Courier. A
set of suitable fd files and style files for common PostScript
fonts is distributed with NFSS2. The only problem here is agreeing on
family names for fonts, and having suitable fd files, but
this is done for a great many typefaces in the standard NFSS2
distribution, with the family names listed in Table
|