Article View: comp.text.tex
Article #403Re: Font selection in LateX
From: Rainer Schoepf
Date: Fri, 24 Jul 1992 10:38
Date: Fri, 24 Jul 1992 10:38
131 lines
6312 bytes
6312 bytes
In article <OSA.92Jun25161914@wilbur.unh.edu> osa@wilbur.unh.edu (Bart Simps... er.. Oktay Ahiska) writes:
Milt Epstein writes:
> In <1992Jun18.202145.16406@ctr.columbia.edu> burra@sun1.coe.ttu.edu (Gangadhar Burra) writes:
>>Can somebody give me a comprehensive summary of how to select fonts in
>>LaTeX. Maybe I am dumb, but Lamport's book really does not do a good
>>job on this issue.
>>
>>For example, if halfway thru my document, I want to change to
>>Helvetica Bold 14pt and then change back to default (whatever it might
>>be), how do I do it. What is the mapping between the rather cryptic
>>fontnames that come with the LaTeX directory and the more descriptive
>>ones like the font I mentioned above. Since I am a novice user of
>>LaTeX, any help would be appreciated.
> Well, you're not alone :-).
> I'd like to hear about this too, so perhaps followups can be posted to
> the group, or you can summarize the email responses you get.
YES! Please post -- There are at least three of us.
The best way to handle this kind of problems is to use the New Font
Selection Scheme. There are a number of other solutions based on the
old font selection scheme of LaTeX, but they invariably lack the
necessary flexibility. NFSS gives you full access to any number of
font families with any number of fonts (subject only to the memory
limits built into your TeX).
It would need a long explanation to describe the inner workings of
NFSS. Therefore I'll just say something about the basic design
principles:
a) Describe a font in terms of parameters as traditional printers do.
This means that in NFSS you select a font by giving four
parameters:
- family (e.g. computer modern roman or computer modern sans serif)
- series (this is weight and width of the font, like bold, bold
extended, light)
- shape (e.g. italic)
- size
For example, you could say: I want a cm sans serif font, bold,
italic in some size.
b) Make math fonts independent of text fonts.
Actually, they always were. But LaTeX followed the decision taken
for plain TeX, namely to make \rm a switch both for text and math.
NFSS allows you to do this separately (but doesn't force you, see
below).
c) Allow dynamic loading of fonts at runtime.
In original LaTeX, a lot of fonts have to be loaded when a format
file is created. The reason for this is that all math fonts that
might be needed at some time have to be present. NFSS allows you to
dynamically load any number of fonts (as long as you don't overflow
TeX's font memory, of course), so only those are loaded that are
necessary. The absolute minimum of fonts to be preloaded at dump
time is five; and this is only since LaTeX itself needs these five
fonts at that time.
Note that you can even dynamically specify what fonts you want; so
you can just tell the NFSS that you want to use some special
PostScript font that is built into your printer and off you go,
with everything working as expected, i.e., automatic size changes,
switching to bold/italic when you write \bf/\it, or whatever.
When we wrote the LaTeX interface, we decided to offer two choices:
- the so-called oldlfont option:
This makes NFSS under LaTeX behave like before, i.e. without NFSS.
\rm switches to cmr in text and in math.
- the so-called newlfont option:
This separates text and math font selection. You have to write \rm
in text, and \mathrm{<character>} in math. But if you don't like
this, you can define \mathrm to switch to another typeface instead
of taking an argument.
The second option was made the basis for the AMS-LaTeX font selection
interface.
There are two versions of NFSS in general distribution: One dated
about June 1990, and one from the end of 1991. These are functionally
the same, but the latter is made for the update of LaTeX that came out
in December 1991. This LaTeX update has some internal changes that
make it easier to interface with NFSS.
The only combination that will not work correctly is the older version
of NFSS together with a LaTeX dated Dec91 or later.
There is one caveat that applies to LaTeX documents that are written
for the OLD scheme: some of them use special styles for special fonts
(pslatex, times.sty for PostScript, etc.). These special styles will
not work under the NFSS. But there is now a large collection of style
files that were written for NFSS, among which:
- amsfonts.sty, as distributed by the American Mathematical Society to
give access to the AMSFONTS set.
- the so-called psnfss package, written by Sebastian Rathz, to give
access to PostScript fonts. To my knowledge, this is the best and most
complete method to use PostScript fonts.
Regarding plain TeX: again, this has nothing to do with NFSS. But
while you're all listening, I should take the opportunity to point out
that there is an interface between NFSS and plain TeX, written by
Wayne Sullivan.
I hope this answers your questions.
Rainer Schoepf
--
Rainer Schoepf
Konrad-Zuse-Zentrum ,,Ich mag es nicht, wenn
fuer Informationstechnik Berlin sich die Dinge so frueh
Heilbronner Strasse 10 am Morgen schon so
W-1000 Berlin 31 dynamisch entwickeln!''
Federal Republic of Germany
<Schoepf@sc.ZIB-Berlin.de> or <Schoepf@sc.ZIB-Berlin.dbp.de>
Technical Details
Message-ID:
<SCHOEPF.92Jul24113825@quattro.sc.ZIB-Berlin.de>Path:
arc1-ca.pugleaf.net!sparky!uunet!cs.utexas.edu!qt.cs.utexas.edu!yale.edu!ira.uka.de!math.fu-berlin.de!gibb.math.fu-berlin.de!SchoepfReferences:
<1992Jun18.202145.16406@ctr.columbia.edu> <1992Jun19.154023.5876@sunb10.cs.uiuc.edu> <OSA.92Jun25161914@wilbur.unh.edu>Show Full Headers
Complete Article Headers
Newsgroups: comp.text.tex Path: arc1-ca.pugleaf.net!sparky!uunet!cs.utexas.edu!qt.cs.utexas.edu!yale.edu!ira.uka.de!math.fu-berlin.de!gibb.math.fu-berlin.de!Schoepf From: Schoepf@sc.ZIB-Berlin.de (Rainer Schoepf) Subject: Re: Font selection in LateX In-Reply-To: osa@wilbur.unh.edu's message of Thu, 25 Jun 1992 21:19:14 GMT Message-ID: <SCHOEPF.92Jul24113825@quattro.sc.ZIB-Berlin.de> Sender: news@math.fu-berlin.de (Math Department) Reply-To: Schoepf@sc.ZIB-Berlin.de Organization: Konrad-Zuse-Zentrum fuer Informationstechnik Berlin References: <1992Jun18.202145.16406@ctr.columbia.edu> <1992Jun19.154023.5876@sunb10.cs.uiuc.edu> <OSA.92Jun25161914@wilbur.unh.edu> Date: Fri, 24 Jul 1992 10:38:25 GMT Lines: 131