6

I have installed texlive at ~/texlive.

I have installed collection-fontsrecommended using tlmgr.

Now, ~/texlive/2014/texmf-dist/fonts/ has several folders: afm, cmap, enc, ... , vf.

Here is the output of tlmgr info helvetic

package:     helvetic
category:    Package
shortdesc:   URW "Base 35" font pack for LaTeX.
longdesc:    A set of fonts for use as "drop-in" replacements for Adobe's basic set, comprising: - Century Schoolbook (substituting for Adobe's New Century Schoolbook); - Dingbats (substituting for Adobe's Zapf Dingbats); - Nimbus Mono L (substituting for Abobe's Courier); - Nimbus Roman No9 L (substituting for Adobe's Times); - Nimbus Sans L (substituting for Adobe's Helvetica); - Standard Symbols L (substituting for Adobe's Symbol); - URW Bookman; - URW Chancery L Medium Italic (substituting for Adobe's Zapf Chancery); - URW Gothic L Book (substituting for Adobe's Avant Garde); and - URW Palladio L (substituting for Adobe's Palatino).
installed:   Yes
revision:    31835
sizes:       run: 2377k
relocatable: No
cat-date:    2012-06-06 22:57:48 +0200
cat-license: gpl
collection:  collection-fontsrecommended

But when I try to compile:

\documentclass{article}
\usepackage{helvetic}                                                           
\begin{document}
Hello World!
\end{document}

It gives an error:

! LaTeX Error: File `helvetic.sty' not found.

Type X to quit or <RETURN> to proceed,
or enter new name. (Default extension: sty)

I was expecting a document typeset using Helvetica font. Obviously, I am doing something wrong.

How do I set things right?

deshmukh
  • 2,435
  • 1
  • 26
  • 46
  • This is rather a broad question as it stands. I suggest starting here and trying out some of the different fonts supported by (pdf)LaTeX. You can also use system fonts with XeLaTeX/LuaLaTeX but for your current purposes, you are concerned with specifially TeX fonts and the Font Catalogue shows you what is available and how to use them. – cfr Sep 23 '14 at 22:08
  • If you use XeLaTeX for compiling, then you can use any font installed for your system, independently of whether it is specifically supported by TeX Live. If you want to benefit from TeX-specific support files, obviously you'd need to pick a package which supports that. You can still use 'standard' TeX fonts, but you don't have to. (Some packages, as Andrew Cashner mentions now configure the fonts using a switch method such that appropriate options are chosen to use the fonts for XeLaTeX, if that's what you use. In other cases, you'd be better off using system fonts with fontspec.) – cfr Oct 03 '14 at 21:30
  • @cfr I am aiming to have a ~/texlive installation that is, kind of, portable. So, want to be as independent of system fonts, etc. as possible – deshmukh Oct 08 '14 at 13:42
  • 2
    Then you don't want to use fontspec. Use the font catalogue for samples and examples of how to use font packages. You can still use XeLaTeX if you wish. – cfr Oct 08 '14 at 14:54

1 Answers1

12

Since you wish to use TeX Live rather than system fonts, it is better to look for information about the font packages available to you than to create lists of font files. This is because most packages will include many different files under texmf-dist/fonts and the relation of those files to package names will not always be at all obvious. (The directory names are likely to be a better guide but still not great.)

To see why this is, it is necessary to think a little bit about the different kinds of files included under texmf-dist/fonts. On my machine, I have the following:

afm/  cid/  cmap/  enc/  fea/  lig/  map/  misc/  ofm/  opentype/  ovf/  ovp/  pfm/  pk/  sfd/  source/  tfm/  truetype/  type1/  vf/
  • afm files are Adobe Font Metrics. TeX doesn't use these directly, as far as I know, but they are used to create other files.
  • cmap files are used to support searching. They help to map characters in PDFs, for example, to characters which can be searched. (They may have further uses I'm not aware of.)
  • enc files specify various encodings for fonts which TeX needs to figure out which 'slot' contains which character.
  • fea and lig are feature and ligature files for use with fontspec, I think.
  • map helps TeX to figure out which font file corresponds to which font, and whether the font encoding has been altered.
  • opentype self-explanatory.
  • pfm font metrics in a different format from afm files. The two can be converted into each other.
  • pk pre-prepared fonts based on metafont sources.
  • sfd ?? (FontForge source for fonts?)
  • source metafont sources used to generate pk files (either above or on-the-fly during typesetting as required)
  • tfm TeX font metrics generated from afm or pfm files together with other information. As far as TeX is concerned, these are fonts. They do not, however, include the glyphs. That is, they don't include the 'pictures' of characters. Instead, they contain information about the boxes needed to accommodate those characters, how to adjust the spacing between pairs of boxes, when to replace two boxes by a different box, box dimensions and more. (TeX typesets boxes. Like everything else, a character is a box.) These are not quite fonts as far as pdfTeX is concerned - it wants the pictures, too.
  • truetype self explanatory.
  • type1 somewhat self explanatory. These files contain nothing but pictures of characters. Without the metric information, they are not useful. (Postscript fonts are distributed with both type1 font files (.pfb or .pfa) and metric files (.afm or pfm). Unlike opentype and truetype fonts, there is no single file which is a postscript type1 font.
  • vf complicated. These are 'virtual fonts'. They tell TeX how to create new fonts from other fonts. For example, if you wanted to combine oldstyle figures and ligatures from a supplementary font with the characters from a primary font, you could create a virtual font which took the appropriate characters from each and combined them. TeX can then treat this font as a single font for typesetting purposes. The virtual font files tell TeX where to find the various bits of information and glyphs it needs to construct the virtual font. (Traditionally, oldstyle figures, small capitals and ligatures were often provided in a separate .pfb or .pfa file. To use these with TeX, you need to create a combined font using characters from the additional file along with those from the main one.) These files can also be used to 'fake' glyphs which are not present in the actual font, to approximate small capitals or an oblique shape, and to provide various other features.

Rather than trying to work out from the contents of these directories which fonts you have, then, it would be better to look for font packages which provide a coherent interface to groups of files which together support entire fonts and their families.

Since you are using TeX Live, you can get some information about the font packages available to you using tlmgr.

There are several different options here. tlmgr uses a concept of 'taxonomies' which can be used to search for packages according to various classifications e.g. characterization or keyword. Let's take keyword as an example.

We need to know first which keywords are available:

tlmgr search --list --keyword

will give us a list:

 Keywords:
        Computer Science
        DVI file manipulation
        Humanities
        Mathematics (the subject)
        MetaFont, Metapost
        Physics, Chemistry, Biology
        Social Science
        URLs, hyperlinks
        abbreviations, acronyms
        abstract
        alignment
        appendix
        arrays, matrices
        arrows
        article style
        author
        bibliography, formatting
        bibliography, management
        book style
        boxed text, frames
        calendar, schedule
        caption
        changebars
        chapters, sectioning
        collections, proceedings, conferences
        color
        columns, multiple columns
        commutative diagrams
        computer code, verbatim text
        cross references
        dates and times
        distributions, whole systems
        document style
        dropped letter, often initial letter
        editing, graphical work environment
        encodings, Unicode
        equations, subequations
        exams, exercises, answers
        external programs, interfacing
        figures, floating matter
        foils, overhead slides
        font selection
        fonts, mathematics
        fonts, text
        footnotes, end notes
        front matter, end matter
        glossary, dictionary
        graphics created inside TeX (pictures, PSTricks, PGF, etc.)
        graphics from outside TeX
        headers, footers
        help, documentation, FAQ
        hyphenation
        include file
        index, indexing
        justification
        languages other than English
        letters, envelopes, labels
        lists, bullets
        literate programming
        macro programming
        make, compilation systems
        marginal material
        minipage
        music
        output format PDF, PostScript
        output format other than PDF (HTML, etc.)
        output viewer
        page breaks
        page geometry (margins, etc.)
        page numbering
        page styles
        paper size, orientation
        paragraph
        presentations (powerpoint-like, using a beamer)
        proof sheets (typographical)
        proofs
        publisher's style
        punctuation
        quotation, poetry
        report style
        scientific units
        spacing, horizontal or vertical
        symbols, mathematical
        symbols, text
        table of contents
        tables
        text decoration (underline, etc.)
        theorems
        thesis style
        title, maketitle
        vita, CV, resume
        watermark, draftmark
        word processor conversion
        wrap around a figure

Several here are related to fonts: font selection, fonts, text and fonts, mathematics. The last two sound especially hopeful, so let's try those.

First, for text:

tlmgr search --keyword "fonts, text"
 amiri - A classical Arabic typeface, Naskh style.
 berenisadf - Berenis ADF fonts and TeX/LaTeX support.
 calligra-type1 - Type 1 version of Calligra.
 cantarell - LaTeX support for the Cantarell font family.
 cm-unicode - Computer Modern Unicode font family.
 comfortaa - Sans serif font, with LaTeX support.
 dejavu - LaTeX support for the DejaVu fonts.
 droid - LaTeX support for the Droid font families.
 fntproof - A programmable font test pattern generator.
 fontbook - Generate a font book.
 fonts-tlwg - Thai fonts for LaTeX from TLWG.
 fundus-calligra - Support for the calligra font in LaTeX documents.
 fundus-sueterlin - Sutterlin
 gillcm - Alternative unslanted italic Computer Modern fonts.
 gnu-freefont - A Unicode font, with rather wide coverage.
 hacm - Font support for the Arka language.
 ipaex - IPA and IPAex fonts from Information-technology Promotion Agency, Japan.
 latex-fonts - A collection of fonts used in LaTeX distributions.
 lato - Lato font family and LaTeX support.
 lcyw - Make Classic Cyrillic CM fonts accessible in LaTeX.
 lfb - A Greek font with normal and bold variants.
 lh - Cyrillic fonts that support LaTeX standard encodings.
 libris - Libris ADF fonts, with LaTeX support.
 linearA - Linear A script fonts.
 lm - Latin modern fonts in outline formats.
 marvosym - Martin Vogel's Symbols (marvosym) font.
 mathcomp - Text symbols in maths mode.
 mdsymbol - Symbol fonts to match Adobe Myriad Pro.
 mex - Polish formats for TeX.
 mf2pt1 - Produce PostScript Type 1 fonts from Metafont source.
 mxedruli - A pair of fonts for different Georgian alphabets.
 nkarta - A "new" version of the karta cartographic fonts.
 ocherokee - LaTeX Support for the Cherokee language.
 ocr-b - Fonts for OCR-B.
 ogham - Fonts for typesetting Ogham script.
 oldstandard - Old Standard: A Unicode Font for Classical and Medieval Studies.
 opensans - The Open Sans font family, and LaTeX support.
 orkhun - A font for orkhun script.
 pacioli - Fonts designed by Fra Luca de Pacioli in 1497.
 paratype - LaTeX support for free fonts by ParaType.
 phaistos - Disk of Phaistos font.
 phonetic - Metafont Phonetic fonts, based on Computer Modern.
 pigpen - A font for the pigpen (or masonic) cipher.
 poltawski - Antykwa Poltawskiego Family of Fonts.
 psnfss - Font support for common PostScript fonts.
 punk - Donald Knuth's punk font.
 punknova - OpenType version of Knuth's Punk font.
 pxfonts - Palatino-like fonts in support of mathematics.
 pxgreeks - Shape selection for PX fonts Greek letters.
 recycle - A font providing the "recyclable" logo.
 sanskrit - Sanskrit support.
 sauter - Wide range of design sizes for CM fonts.
 staves - Typeset Icelandic staves and runic letters.
 stix - OpenType Unicode maths fonts.
 superiors - Attach superior figures to a font family.
 tabfigures - Maintain vertical alignment of figures.
 tapir - A simple geometrical font.
 tipa - Fonts and macros for IPA phonetics characters.
 trajan - Fonts from the Trajan column in Rome.
 txgreeks - Shape selection for TX fonts Greek letters.
 typeface - Select a balanced set of fonts.
 uhc - Fonts for the Korean language.
 umtypewriter - Fonts to typeset with the xgreek package.
 universa - Herbert Bayer's 'universal' font.
 utopia - Adobe Utopia fonts.
 wadalab - Wadalab (Japanese) font packages.
 wnri - Ridgeway's fonts.
 wsuipa - International Phonetic Alphabet fonts.
 xecjk - Support for CJK documents in XeLaTeX.
 xepersian - Persian for LaTeX, using XeTeX.
 xits - A Scientific Times-like font with support for mathematical typesetting.
 yannisgr - Greek fonts by Yannis Haralambous.

And for maths:

tlmgr search --keyword "fonts, mathematics"
 a0poster - Support for designing posters on large paper.
 accfonts - Utilities to derive new fonts from existing ones.
 ae - Virtual fonts for T1 encoded CMR-fonts.
 aeguill - Add several kinds of guillemets to the ae fonts.
 allrunes - Fonts and LaTeX package for almost all runes.
 amsfonts - TeX fonts from the American Mathematical Society.
 antt - Antykwa Torunska: a Type 1 family of a Polish traditional type.
 arabtex - Macros and fonts for typesetting Arabic.
 aramaic-serto - Fonts and LaTeX for Syriac written in Serto.
 archaic - A collection of archaic fonts.
 arev - Fonts and LaTeX support files for Arev Sans.
 arphic - Arphic (Chinese) font packages.
 augie - Calligraphic font for typesetting handwriting.
 auncial-new - Artificial Uncial font and LaTeX support macros.
 aurical - Calligraphic fonts for use with LaTeX in T1 encoding.
 b1encoding - LaTeX encoding tools for Bookhands fonts.
 bbding - A symbol (dingbat) font and LaTeX macros for its use.
 bbm - "Blackboard-style" cm fonts.
 bbm-macros - LaTeX support for "blackboard-style" cm fonts.
 bbold - Sans serif blackboard bold.
 bbold-type1 - An Adobe Type 1 format version of the bbold font.
 belleek - Free replacement for basic MathTime fonts.
 bera - Bera fonts.
 beton - Use Concrete fonts.
 blacklettert1 - T1-encoded versions of Haralambous old German fonts.
 boisik - A font inspired by Baskerville design.
 bold-extra - Use bold small caps and typewriter fonts.
 boondox - Mathematical alphabets derived from the STIX fonts.
 brushscr - A handwriting script font.
 calligra - Calligraphic font.
 calrsfs - Copperplate calligraphic letters in LaTeX.
 casyl - Typeset Cree/Inuktitut in Canadian Aboriginal Syllabics.
 cbcoptic - Coptic fonts and LaTeX macros for general usage and for philology.
 cc-pl - Polish extension of Computer Concrete fonts.
 charter - Charter fonts.
 cherokee - A font for the Cherokee script.
 cm - Computer Modern fonts.
 cm-lgc - Type 1 CM-based fonts for Latin, Greek and Cyrillic.
 cm-super - CM-Super family of fonts
 cm-unicode - Computer Modern Unicode font family.
 cmbright - Computer Modern Bright fonts.
 cmcyr - Computer Modern fonts with cyrillic extensions.
 cmpica - A Computer Modern Pica variant.
 cmsd - Interfaces to the CM Sans Serif Bold fonts.
 cmtiup - Upright punctuation with CM italic.
 concmath - Concrete Math fonts.
 concmath-fonts - Concrete mathematics fonts.
 concrete - Concrete Roman fonts.
 cryst - Font for graphical symbols used in crystallography.
 cyklop - The Cyclop typeface.
 dancers - Font for Conan Doyle's "The Dancing Men".
 doublestroke - Typeset mathematical double stroke symbols.
 duerer - Computer Duerer fonts.
 dutchcal - A reworking of ESSTIX13, adding a bold version.
 ec - Computer modern fonts in T1 and TS1 encodings.
 ecc - Sources for the European Concrete fonts.
 eiad - Traditional style Irish fonts.
 elmath - Mathematics in Greek texts.
 epiolmec - Typesetting the Epi-Olmec Language.
 esint - Extended set of integrals for Computer Modern.
 esint-type1 - Font esint10 in Type 1 format
 esstix - PostScript versions of the ESSTIX, with macro support.
 ethiop - LaTeX macros and fonts for typesetting Amharic.
 ethiop-t1 - Type 1 versions of Amharic fonts.
 eulervm - Euler virtual math fonts.
 euro-ce - Euro and CE sign font.
 eurosym - Metafont and macros for Euro sign.
 fc - Fonts for African languages.
 fdsymbol - A maths symbol font.
 fntproof - A programmable font test pattern generator.
 foekfont - The title font of the Mads Fok magazine.
 fontbook - Generate a font book.
 fourier - Using Utopia fonts in LaTeX documents.
 fpl - SC and OsF fonts for URW Palladio L
 frcursive - French cursive hand fonts.
 gothic - A collection of old German-style fonts.
 greektex - Fonts for typesetting Greek/English documents.
 hfbright - The hfbright fonts.
 hyphenat - Disable/enable hypenation.
 ibygrk - Fonts and macros to typeset ancient Greek.
 ifsym - A collection of symbols.
 inconsolata - A monospaced font, with support files for use with TeX.
 initials - Adobe Type 1 decorative initial fonts.
 iwona - A two-element sans-serif font.
 junicode - A TrueType font for mediaevalists.
 kerkis - Kerkis (Greek) font family.
 kpfonts - A complete set of fonts for text and mathematics.
 kurier - A two-element sans-serif typeface.
 latex-fonts - A collection of fonts used in LaTeX distributions.
 libgreek - Use Libertine or Biolinum Greek glyphs in mathematics.
 lm - Latin modern fonts in outline formats.
 lm-math - OpenType maths fonts for Latin Modern.
 mathabx - Three series of mathematical symbols.
 mathabx-type1 - Outline version of the mathabx fonts.
 mathdesign - Mathematical fonts to fit with particular text fonts.
 mathpazo - Fonts to typeset mathematics to match Palatino.
 mathspec - Specify arbitrary fonts for mathematics in XeTeX.
 mdputu - Upright digits in Adobe Utopia Italic.
 mdsymbol - Symbol fonts to match Adobe Myriad Pro.
 mex - Polish formats for TeX.
 mf2pt1 - Produce PostScript Type 1 fonts from Metafont source.
 mnsymbol - Mathematical symbol font for Adobe MinionPro.
 prodint - A font that provides the product integral symbol.
 pxfonts - Palatino-like fonts in support of mathematics.
 pxtxalfa - Virtual maths alphabets based on pxfonts and txfonts.
 rsfs - Ralph Smith's Formal Script font.
 sansmathaccent - Correct placement of accents in sans-serif maths.
 sauter - Wide range of design sizes for CM fonts.
 shuffle - A symbol for the shuffle product.
 stmaryrd - St Mary Road symbols for theoretical computer science.
 tex-gyre-math - Maths fonts to match tex-gyre text fonts.
 trsym - Symbols for transformations.
 txfonts - Times-like fonts in support of mathematics.
 typeface - Select a balanced set of fonts.
 urwchancal - Use URW's clone of Zapf Chancery as a maths alphabet.
 xits - A Scientific Times-like font with support for mathematical typesetting.
 yhmath - Extended maths fonts for LaTeX.

From this list, you can select packages for further investigation. Further information about any particular package can be obtained in various ways. First, tlmgr can itself provide basic information about a package:

tlmgr info urwchancal
package:     urwchancal
category:    Package
shortdesc:   Use URW's clone of Zapf Chancery as a maths alphabet.
longdesc:    The package allows (the URW clone of) Zapf Chancery to function as a maths alphabet, the target of \mathcal or \mathscr, with accents appearing where they should, and other spacing parameters set to reasonable (not very tight) values. This package supersedes the pzccal package.
installed:   Yes
revision:    21701
sizes:       doc: 37k, run: 17k
relocatable: Yes
cat-version: 1
cat-date:    2014-02-26 23:03:13 +0100
cat-license: lppl
collection:  collection-fontsextra

Second, texdoc can be used to examine locally installed documentation:

texdoc urwchancal

Occasionally, texdoc doesn't give you the most useful document. In that case, you can also look in texmf-dist/doc/fonts/<packagename> to see if something else is available.

Finally, as others have said, if you want to pick fonts in a more visual way, the Font Catalogue allows you to browse possibilities. Note, however, that not all of the fonts listed will be installed on your machine as not all are part of TeX Live. This information is, however, provided as part of the catalogue record for the font.

Addendum

If the font you wish to use is one of the base postscript fonts, such as Helvetica, texdoc psnfss provides information about usage. The manual tells us that to use Helvetica, we need

\usepackage{helvet}% See notes about scaling if using in combination with something like Times

However, by itself, this will not use Helvetica for the body text since Helvetica is a sans serif font. What the package does is installs Helvetica (actually a clone) as the default sans family. To use it, you have to switch to the sans font:

\sffamily abc

or

\textsf{abc}

If you want the entire document to use sans, you can change the default serif family to match the sans:

\documentclass{article}
\usepackage{helvet}
\renewcommand*{\rmdefault}{\sfdefault}
\begin{document}
Hello World!
\end{document}

Helvetica (clone)

cfr
  • 198,882
  • This answer is much more specific to the question and provides detailed information not available elsewhere. I wanted that bounty, but this one deserves it more. – musarithmia Oct 09 '14 at 02:08
  • @AndrewCashner Thank you. Not trying to tread on your toes ;). – cfr Oct 09 '14 at 02:15
  • @cfr We are closer to the answer, I guess. The problem is, \usepackage{helvetic} does not help set the font. I have edited the question and made it more specific now, with an MWE :) – deshmukh Oct 10 '14 at 13:40
  • 2
    @deshmukh Helvetica is a sans serif font. If you want to use it for the body of your document, you'd have to issue \sffamily at the start or \renewcommand*{\rmdefault}{\sfdefault}. However, Helvetica is one of the base postscript fonts so for information about using it, you'd need texdoc psnfss. That tells you that the package name is actually helvet. – cfr Oct 10 '14 at 13:55
  • @deshmukh See updated answer. – cfr Oct 10 '14 at 14:01
  • @deshmukh I'm glad it worked. It would have been nice if you'd awarded the bounty to somebody, though :). – cfr Oct 14 '14 at 16:16
  • @cfr I agree and apologies, I did not award the bounty. Will remember for the next time. – deshmukh Oct 15 '14 at 12:56