Your support for our advertisers helps cover the cost of hosting, research, and maintenance of this document

Formatting Information — An introduction to typesetting with LATEX

Chapter 3: Plugins and support

In this chapter…

  1. Using classes and packages
  2. Installing extra classes and packages
  3. Where to go for help

In earlier chapters we have already seen the use of ‘classes’ (document templates), and ‘packages’ (styling add-ons or plug-ins) which add features to your document. Most of the packages can be used with any document class. Both classes and packages are stored in subdirectories of your TEX installation directory.

Packages

A LATEX package is a file or collection of files containing extra commands and programming which add new formatting features, or modify those already existing. There over 6,000 packages, and over 5,000 of them are pre-installed with every full distribution of LATEX, ready to be used in your documents immediately.

Package files mostly end with the .sty filetype (some computers hide this, but it’s there) — they used to be called ‘style files’. Packages may also include other files as well, like fonts or configuration files.

Classes

A LATEX class is a special kind of package which provides formatting template features for a whole document. There are over 600 of these, and over 500 of them are pre-installed with LATEX.

Class files all end with the .cls filetype (some computers hide this, but it’s there). Like ordinary packages, classes may also be distributed with ancillary files, like fonts or configuration files.

To find out if a particular package or class is already installed, type the kpsewhich command in a Terminal window (see the appendix ‘Commands and errors’ below); for example to see if the noto package (or the Noto font family) or the scrartcl class (for the Koma-Script ‘article’ class) is installed, type:

$ kpsewhich noto.sty
/usr/share/texlive/texmf-dist/tex/latex/noto/noto.sty
$ kpsewhich scrartcl.cls
/usr/share/texlive/texmf-dist/tex/latex/koma-script/scrartcl.cls

If the class or package is installed, this will tell you where the file is. If you get no response, it means it is not installed.

To find out what other packages are available and what they do, use the CTAN search page or Graham Williams’ comprehensive package catalogue.

  1. Koma-Script is a bundle of alternative classes by Markus Kohm. 

  2. MiKTEX users note that you cannot process TEX Installer (.ins and .dtx) files inside MiKTEX’s own installation folders: you have to process them elsewhere first, hence the need for a temporary directory. 

  3. For example, there is no separate xcolor.dtx and xcolor.ins for the xcolor package because it forms part of the graphics bundle, which is included with all LATEX systems anyway. Such packages change very rarely, as they form part of the kernel of LATEX and are very stable. You should never try to update these packages in isolation. 

  4. Almost all of these have been updated to work with LATEX, so they should be installed as in step 3 below, but there are a few remaining. 

  5. Note that this means newsreaders for the Usenet News (Network News Transfer Protocol (NNTP)) service. It does not mean readers for Really Simple Syndication (RSS) feeds, which are a different thing entirely — these are unfortunately also sometimes referred to as ‘newsreaders’.