Say I have a command like
\newcommand{\fntpal}[1]{{\fontfamily{ppl}\selectfont#1}}
used for changing the font of specific chunks of text to Palatino and I also want something similar for other fonts like Helvetica, Latin Modern Sans Serif, etc.
What's the quickest method to discover that the correct argument for Helvetica is phv
and that for Latin Modern Sans is lmss
?
I could have guessed the hv
part but I would have never guessed the p
in phv
(now I know the reason why it's there, but this is not the point).
What I did was:
- check the relevant LaTeX font catalogue page (nothing useful there);
- jump to the Helvetica CTAN page and search for some hint in the documentation till I found the inst.tex file.
This same method didn't work for Latin Modern (too much doc files there) and I had to randomly search the internet until I found the magic string.
So, is there some general reference list for this? And why this information is left out of the font catalogue pages?
edit: looks like someone on another group had a similar question and was pointed to: http://latex.silmaril.ie/formattinginformation/typographics.html (which isn't a complete list, however)
Best Answer
I'm afraid such a method doesn't exist.
In the Eighties, Karl Berry proposed a font naming scheme for TeX/LaTeX that ensured, as much as possible, that metric file names consisted of at most eight characters, which was a constraint forced basically by an operating system I don't want to mention; the same constraint was forced for file names on CD-ROM.
A “Berry name” consists of various parts:
(the square brackets represent optional parts), where
S
is one letter denoting the supplier (p
is Adobe,b
is Bitstream,u
is URW, and so on). What you're interested in isTT
, two alphanumeric characters representing the family name.The document “Fontname – Filenames for TeX fonts” by Karl Berry is available in the major TeX distributions with
texdoc fontname
or at texdoc.net (or on CTAN). There you find a long list of two letter family names with the correspondence with the “real” font name.Thus
phv
is “Adobe Helvetica”, whilebhv
can be “Bitstream Swiss 721” anduhv
is “URW Nimbus Sans”.Metafont based fonts don't follow the convention, so the family name for the Computer Modern Roman fonts is
cmr
. There is a family pairmr
(Madrone) and the supplierc
is Compugraphic; butcmr10
does not conform to the Berry naming scheme, so it can't misunderstood for a (probably inexistent) “Compugraphic Madrone”. If this font did exist problems would arise, though.This is the past, however. Nowadays operating systems have lifted the eight character restriction on file names (at least at user level). Suppliers of LaTeX fonts have started using freely file names and no convention is followed.
For instance, the Quattrocento font uses
Quattrocento-TLF
as family name, while Iwona usesiwona
and Linux Libertine hasLinuxLibertineT-xxx
(xxx
stands for a two or three letter addition. Thenewpxtext
package uses family names such asntxr
orntxss
.The shell command
which should find all
.fd
files relative to the T1 encoding finds 286 files; another 59 are found with/T1
(not all packages follow the recommendation that font description file names start with the encoding in lower case).Basically, an instruction such as
loads the font description file
<encoding><string>.fd
. Say we're using T1 as output encoding; then\fontfamily{xyz}
would load eithert1xyz.fd
orT1xyz.fd
(if existent on your system).Choosing from these font description file names is the only reliable way to find out what fonts you have.
Instead of the
locate
command one can exploit thels-R
file name cache of TeX Live, on Unix systems:Note. The
--all
option seems to be replaceable by-a
, which is what I've always used, but the short option is not documented.