Ã山ǿ¼é

St. Ã山ǿ¼é

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.

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:  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 is over 1 GB. You'll also need an editor (called an integrated development environment, an IDE, or a front end) for working with TeX documents.  is a great editor, available for free for all major operating systems.
    • for Windows
    • for MacOSX
    • for Unix/GNU/Linux

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.$$

The TeX editor TeXstudio includes 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
    • , 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."
    • , by Tobias Oetiker, Hubert Partl, Irene Hyna, and Elisabeth Schlegl.
  • For everyone
    •   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 of the commands for all symbols known by LaTeX.
    •   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.)
    •   A comprehensive 14-page reference of LaTeX commands, organized alphabetically.
    •   An indispensable four-page reference of the LaTeX commands that produce mathematical symbols, organized by category. Includes some commands from the amsmath package.
    •   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
    • 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


Suppose you're basing a talk on a paper that you wrote with LaTeX, and you want to include some of the mathematics of your paper in a PowerPoint presentation. You have a few options.

First, PowerPoint, like Word, includes an equation editor with point-and-click menus for symbols, so you could rebuild your mathematical expressions in your PowerPoint file.

You may be thinking, if I can copy text from my paper and paste it into a PowerPoint file, why can't I do the same with the math? You can (sort of)! The equation editors in both Word and PowerPoint recognize many LaTeX commands. 

So second, you could copy LaTeX code from your paper and paste it in an equation box in your PowerPoint file, hit enter, and PowerPoint should compile the commands and display the mathematical output. However, the equation editor in Word seems to be better at recognizing LaTeX commands than its counterpart in PowerPoint. Sometimes PowerPoint compiles only a portion of the LaTeX commands in an expression. (Perhaps this is reflected by the fact that Word's equation editor explicitly provides a LaTeX formatting option, labelled "{ } LaTeX,'' while this option does not yet appear in PowerPoint.) It may be more effective to copy your LaTeX code and paste it into an equation box in a Word doc, hit enter, and then copy the compiled output and paste it into an equation box in your PowerPoint file.

Third, you could download a program that allows you to insert LaTeX expressions into your PowerPoint presentation. The result is genuine gorgeous LaTeX output, rather than PowerPoint's or Word's version of it. is a free such program.

There is an alternative to PowerPoint for those who love LaTeX — 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. 

  • An overview and a list of additional references provided by Overleaf, an online LaTeX editor.
  •  An overview in Wikibooks.
  • The complete 240-page reference.

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.