Skip to Main Content

How to Use LaTeX

A guide for installing and using the typesetting program \(\LaTeX\).

What are LaTeX Packages?

A basic TeX distribution doesn't actually provide much functionality. In most cases, creating a LaTeX document will require packages that provide additional options or functionality. There is an extremely broad range of packages available, but they generally fall into two categories:

  1. Packages that allow you to change the layout or structure of your document, like multicol
  2. Packages that allow you to include new or enhanced content within your document itself, like amsmath

Packages required by a document are called in the preamble of your LaTeX document, i.e. before the \begin{document} statement. The syntax to do so is \usepackage{ }, with the name of the package included in the brackets. Below is a screen capture of a LaTeX preamble that includes packages:

The orange text surrounded by square brackets in the above example are options for the package being called. These change how the package affects or is applied the document. Available options should be specified in the package's documentation.

How to Install LaTeX Packages

Some common packages, like amsmath, are included in most TeX distributions, but the vast majority are not. Any additional packages must be installed in order to compile the document.

Installation During Compiling (using MikTeX)

When processing a .tex file which has packages listed in its preamble that are not yet installed, MikTeX can install those packages as part of the process of compiling the document.

Installation using a Package Manager

MiKTeX and TeX Live both include package managers which will find and install a specified LaTeX package for the user.

For MiKTeX, this is done using the MiKTeX Console, a program which is included when MiKTeX is installed.

TeX Live (and hence MacTeX) installs packages via the command line or terminal. Installing the geometry package, for example, can be done using the following commands:

  • tlmgr install geometry with TeX Live (Linux)
  • sudo tlmgr install geometry with MacTeX (Mac)

Additional information can be found below:

Examples of General-Purpose Packages

The packages listed below are likely to be of use regardless of discipline or motivation for using LaTeX.