St. Bonaventure University

Typing Mathematics: LaTeX


This page addresses issues commonly faced by students who are writing papers or giving presentations with substantial mathematical content. The following topics are discussed.


Introduction to LaTeX


LaTeX (pronounced "lah-tek" or "lay-tek") is the document-preparation program of choice among mathematicians, computer scientists, engineers, physicists, economists, and other scholars. LaTeX sets the world's standard for mathematical typesetting.

Donald Knuth of Stanford University developed TeX (pronounced "tek") in the 1970s and '80s to allow anyone to create professional-looking documents, particularly documents that contain mathematics. Knuth designated TeX as freeware. A friendlier version of TeX called LaTeX was subsequently developed by Leslie Lamport and has largely replaced the original "plain'' TeX. Like its predecessor, LaTeX is freeware. These days, when someone speaks of "TeX,'' they are almost certainly referring to LaTeX.

While Microsoft Word and similar programs are wysiwyg (what you see is what you get) programs, LaTeX uses commands to format content. A LaTeX file consists of your content along with commands that specify how the content should be displayed. By compiling (also called building) a LaTeX file, you create a PDF with your content formatted as the commands dictate.

LaTeX has become the de facto standard for typesetting in mathematics and allied disciplines. Indeed, LaTeX has been used to typeset thousands of textbooks and numerous journals, and is the primary method of displaying formulas on Wikipedia.

You may use an online LaTeX editor without downloading the program or you may download LaTeX for free to your own computer. For more information, see Typing a mathematical paper using LaTeX.


Typing a mathematical paper using LaTeX


Accessing LaTeX

To use LaTeX, you may use an online LaTeX editor without downloading the program or you may download LaTeX to your own computer.

  • Online: Overleaf offers an online, collaborative LaTeX editor. If you'll work alone or with one collaborator, the free Personal version will suffice. The for-pay Collaborator and Professional versions are for people who'll be working with multiple collaborators. The for-pay versions also track document history.
  • TeXstudio iconOn your own computer: You'll need to install a TeX distribution, which is a collection of TeX-related software. A TeX distribution for any of the major operating systems may be downloaded for free from the sites below. The download includes an editor (referred to as an integrated development environment, an IDE, or a front end), such as TeXstudio or TeXnicCenter, for working with TeX documents. The download is over 1 GB.

Creating LaTeX documents

To create a document using LaTeX, the user creates a plain text file consisting of the manuscript text and LaTeX commands; the commands will inform a compiler how to format the content. The plain text file may be created in virtually any text editor, but by creating the file within a TeX editor, the user can then compile to file to create a PDF or DVI file with the content formatted as desired. The result can be as professional-looking as pages in a textbook.

For example, the LaTeX commands

\displaystyle{\sum_{n=0}^{\infty} ar^n}

produce the mathematical expression

$$\sum_{n=0}^{\infty}ar^n.$$

TeXstudio, TeXnicCenter, and other TeX editors include point-and-click menus for inserting the commands for a wide range of mathematical symbols, eliminating the need for the user to learn or look up many commands.

Resources

  • For St. Bonaventure students
    • Sample LaTeX file  This file contains the global formatting commands that would be suitable for most mathematics assignments and projects at St. Bonaventure. In a TeX editor (such as TeXstudio or Overleaf), copy the contents of this file into a new LaTeX file and then add the desired content where the file indicates.
  • For beginners
    • Getting something out of LaTeX, by Jim Hefferon. "This is for people considering using LaTeX. This is not a tutorial. Instead, it takes you through making a first document. If this quick taste leaves you wanting more then you are ready to go through a tutorial."
    • The Not-So-Short Introduction to LaTeX2e, by Tobias Oetiker, Hubert Partl, Irene Hyna, and Elisabeth Schlegl.
  • For everyone
    • Detexify  An approach to simplify finding LaTeX symbols. If you can't remember the command for a certain symbol, just draw the symbol in the square area, and the site will give you possible options for the appropriate command. The site also provides a complete list of the commands for all symbols known by LaTeX.
    • LaTeX Tips  Created by A.J. Hildebrand of the University of Illinois at Urbana-Champaign, this well-organized, superbly-written resource addresses issues of interest to novices and professionals alike. These tips are part of Hildebrand's TeX Resources.
    • LaTeX Basic Tutorial and Quick Reference  A concise summary of typesetting math using LaTeX. (It's called a "MathJax tutorial," but MathJax is simply the resource that renders the math symbols on that webpage.)
    • Summary of LaTeX commands  A comprehensive 14-page reference of LaTeX commands, organized alphabetically.
    • LaTeX mathematical symbols  An indispensable four-page reference of the LaTeX commands that produce mathematical symbols, organized by category. Includes some commands from the amsmath package.
    • TeX-LaTeX Stack Exchange  A free question-and-answer site for users of TeX, LaTeX, and related typesetting systems. Note, however, that LaTeX is used by so many people that any question you have has surely already been asked and answered somewhere on the Web, so an internet search using keywords from your question will likely lead to the answer.
  • For web editors
    • MathJax is a free JavaScript engine that displays beautiful mathematical notation in all web browsers, using LaTeX markup (with a few modifications). 

Mathematical presentations using PowerPoint and LaTeX


If you are basing your talk on a paper that you wrote with LaTeX, and you want the beautiful expressions rendered by LaTeX in a PowerPoint presentation, then you'll need to download a program that allows you to insert LaTeX expressions into a PowerPoint presentation. There are several programs available—some free and some not. Here are three.

  • IguanaTeX A free PowerPoint plug-in. Easy to download and easy to use. 
  • MyTeXPoint A free simplified version of TeXPoint (see the next program).
  • TeXPoint A formerly-free program that now has a modest cost.

For the sake of completeness, I'll point out that there is a low-tech alternative to these programs. To get a LaTeX expression onto a PowerPoint slide, you could take a screen shot of the LaTeX output, copy the image onto a PowerPoint slide, and crop the image until only the pertinent piece of mathematics remains. This process would need to be repeated for every expression you wanted in your presentation. There are serious drawbacks to this approach. First, when the cropped image is enlarged, the math within will lose its sharpness. By planning ahead and enlarging the original output just so, the cropped image could be arranged to be about the desired size, but this seems like a pain. Second, the math in the image cannot be edited.

If you like LaTeX so much that you're actually considering any of the above options, see the next section for an alternative—Beamer.


Mathematical presentations using Beamer and LaTeX


A sample Beamer slideBeamer is a TeX package for creating presentations. If you already know and like LaTeX, then you might consider using Beamer instead of PowerPoint for your presentation.

Be aware that some of Beamer's commands are specific to Beamer, so even if you're quite familiar with LaTeX, you'll still need to invest one or two hours learning to use Beamer.

Beamer is included in the MikTeX 2.9 distribution. To designate a LaTeX file as a Beamer presentation, specify the document class as "beamer", that is, use the command \documentclass{beamer} as the first line of the file.

Here are some helpful resources for learning and using Beamer. 

Beamer was created by Till Tantau, Joseph Wright, and Vedran Miletićin in 2003. Its name is taken from the German word Beamer, which is a pseudo-anglicism for video projector.